Skip to content

Draft: Issue #3338369: Layout Builder - Add a refresh layout defaults feature

Daniel Rodríguez requested to merge issue/drupal-3338369:3338369-10.0.x into 10.0.x

Issue #3338369: Layout Builder - Add a refresh layout defaults feature

In order to include the new "Refresh layout defaults" button, it will require the following code changes and additions in the layout builder module:

API changes

  • Update \Drupal\layout_builder\Form\OverridesEntityForm::actions() to include the render array of the new button.
  • Create the new refresh layout confirmation form \Drupal\layout_builder\Form\RefreshOverridesForm which extends from \Drupal\Core\Form\ConfirmFormBase and implements the Refresh layout defaults functionality.
  • Update \Drupal\layout_builder\Routing\LayoutBuilderRoutesTrait::buildLayoutRoutes() to create a new route /refresh where the new button should redirect to the confirmation form.

Pending API changes

  • Include the unit test for "Refresh to layout defaults" button in \Drupal\Tests\layout_builder\Unit\OverridesSectionStorageTest::testBuildRoutes().
  • Include the functional test for "Refresh to layout defaults" button in \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testLayoutBuilderUi().
  • Include the functional test for "Refresh to layout defaults" button in \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testLayoutBuilderUiFullViewMode().

Merge request reports

Loading