$response =
new AjaxResponse();
$response->
addCommand(new CloseModalDialogCommand());
$response->
addCommand(new ShowButtonsCommand(!
empty($view->changed
)));
$response->
addCommand(new TriggerPreviewCommand());
if ($page_title =
$form_state->
get('page_title'
)) { $response->
addCommand(new ReplaceTitleCommand($page_title));
} } // If this form was for view-wide changes, there's no need to regenerate
// the display section of the form.
if ($display_id !== ''
) { \Drupal::
entityTypeManager()->
getFormObject('view', 'edit'
)->
rebuildCurrentTab($view,
$response,
$display_id);
} return $response;
} /**
* Wrapper for handling AJAX forms.
*
* Wrapper around \Drupal\Core\Form\FormBuilderInterface::buildForm() to
* handle some AJAX stuff automatically.
* This makes some assumptions about the client.
*
* @param \Drupal\Core\Form\FormInterface|string $form_class
* The value must be one of the following:
* - The name of a class that implements \Drupal\Core\Form\FormInterface.
* - An instance of a class that implements \Drupal\Core\Form\FormInterface.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return \Drupal\Core\Ajax\AjaxResponse|string|array
* Returns one of three possible values:
* - A \Drupal\Core\Ajax\AjaxResponse object.
* - The rendered form, as a string.
* - A render array with the title in #title and the rendered form in the
* #markup array.
*/