Skip to content
Snippets Groups Projects
Verified Commit eb9a1025 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3427398 by aaron.ferris, alexpott, sdhruvi5142, rkoller, smustgrave,...

Issue #3427398 by aaron.ferris, alexpott, sdhruvi5142, rkoller, smustgrave, DanielVeza: Cancel button on the discard changes in the layout builder confirmation step should take you back to the layout builder

(cherry picked from commit 8c50a65a)
parent e28809ff
No related branches found
No related tags found
5 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type"
...@@ -79,7 +79,7 @@ public function getQuestion() { ...@@ -79,7 +79,7 @@ public function getQuestion() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getCancelUrl() { public function getCancelUrl() {
return $this->sectionStorage->getRedirectUrl(); return $this->sectionStorage->getLayoutBuilderUrl();
} }
/** /**
...@@ -100,7 +100,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ...@@ -100,7 +100,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$this->messenger->addMessage($this->t('The changes to the layout have been discarded.')); $this->messenger->addMessage($this->t('The changes to the layout have been discarded.'));
$form_state->setRedirectUrl($this->getCancelUrl()); $form_state->setRedirectUrl($this->sectionStorage->getRedirectUrl());
} }
} }
...@@ -94,10 +94,17 @@ public function testUnsavedChangesMessage() { ...@@ -94,10 +94,17 @@ public function testUnsavedChangesMessage() {
$assert_session = $this->assertSession(); $assert_session = $this->assertSession();
$page = $this->getSession()->getPage(); $page = $this->getSession()->getPage();
// Make and then discard changes.
$this->assertModifiedLayout(static::FIELD_UI_PREFIX . '/display/default/layout'); $this->assertModifiedLayout(static::FIELD_UI_PREFIX . '/display/default/layout');
// Discard then cancel.
$page->pressButton('Discard changes');
$page->clickLink('Cancel');
$assert_session->addressEquals(static::FIELD_UI_PREFIX . '/display/default/layout');
$assert_session->pageTextContainsOnce('You have unsaved changes.');
// Discard then confirm.
$page->pressButton('Discard changes'); $page->pressButton('Discard changes');
$page->pressButton('Confirm'); $page->pressButton('Confirm');
$assert_session->addressEquals(static::FIELD_UI_PREFIX . '/display/default');
$assert_session->pageTextNotContains('You have unsaved changes.'); $assert_session->pageTextNotContains('You have unsaved changes.');
// Make and then save changes. // Make and then save changes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment