Draft: Issue #3338369: Layout Builder - Add a refresh layout defaults feature
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\RefreshOverridesFormwhich extends from\Drupal\Core\Form\ConfirmFormBaseand implements the Refresh layout defaults functionality. - Update
\Drupal\layout_builder\Routing\LayoutBuilderRoutesTrait::buildLayoutRoutes()to create a new route/refreshwhere 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().