$response = $this->ajaxFormWrapper($form_class, $form_state); } elseif(!$form_state->get('ajax')){ // if nothing on the stack, non-js forms just go back to the main view editor.
$display_id = $form_state->get('display_id'); returnnewRedirectResponse(Url::fromRoute('entity.view.edit_display_form', ['view' => $view->id(), 'display_id' => $display_id], ['absolute' => TRUE])->toString()); } else{ $response = newAjaxResponse(); $response->addCommand(newCloseModalDialogCommand()); $response->addCommand(newShowButtonsCommand(!empty($view->changed))); $response->addCommand(newTriggerPreviewCommand()); if($page_title = $form_state->get('page_title')){ $response->addCommand(newReplaceTitleCommand($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); }