/**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $selection = $form_state->getValue('selection');
     $entity_type = $form_state->getValue('entity_type');
     $entity = $this->getEntityFromSelection($entity_type, $selection);
     $this->staticContext = ['label' => $form_state->getValue('label'), 'type' => 'entity:' . $entity_type, 'value' => $entity->uuid()];
     $this->pageVariant->setStaticContext($form_state->getValue('machine_name'), $this->staticContext);
     $this->pageVariant->save();
     // Set the submission message.
     drupal_set_message($this->submitMessageText());
     $form_state->setRedirectUrl($this->pageVariant->toUrl('edit-form'));
 }