Commit e5472e48 authored by webchick's avatar webchick

Issue #3037550 by bendeguz.csirmaz, tedbow, andrewmacpherson, tim.plunkett:...

Issue #3037550 by bendeguz.csirmaz, tedbow, andrewmacpherson, tim.plunkett: Clarify which block or section is being removed in layout builder dialog
parent 4d6928db
......@@ -30,7 +30,13 @@ class RemoveBlockForm extends LayoutRebuildConfirmFormBase {
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to remove this block?');
$label = $this->sectionStorage
->getSection($this->delta)
->getComponent($this->uuid)
->getPlugin()
->label();
return $this->t('Are you sure you want to remove the %label block?', ['%label' => $label]);
}
/**
......
......@@ -23,7 +23,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to remove this section?');
return $this->t('Are you sure you want to remove section @section?', ['@section' => $this->delta + 1]);
}
/**
......
......@@ -200,7 +200,8 @@ public function testLayoutBuilderUi() {
// Remove a block.
$this->clickContextualLink('.block-system-powered-by-block', 'Remove block');
$this->assertOffCanvasFormAfterWait('layout_builder_remove_block');
$assert_session->pageTextContains('Are you sure you want to remove the This is the new label block?');
$assert_session->pageTextContains('This action cannot be undone.');
$page->pressButton('Remove');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNoElementAfterWait('#drupal-off-canvas');
......@@ -226,6 +227,8 @@ public function testLayoutBuilderUi() {
$assert_session->linkExists('Remove section');
$this->clickLink('Remove section');
$this->assertOffCanvasFormAfterWait('layout_builder_remove_section');
$assert_session->pageTextContains('Are you sure you want to remove section 1?');
$assert_session->pageTextContains('This action cannot be undone.');
$page->pressButton('Remove');
$assert_session->assertWaitOnAjaxRequest();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment