Problem/Motivation

#2922033-33: Use the Layout Builder for EntityViewDisplays raised concerns about the workflow for reverting a layout override:

As it stands, it totally functions and is ok, but going forward, we basically we have to ask ourselves what we think is a more common task, reverting a custom layout and promptly building a new custom layout based on the default, or simply reverting the custom layout. In the case of the latter, we should be going to the canonical url. In the case of the former, we should go to the layout builder url. I think the "revert and done" action will be the far more common action to perform.

Likewise, in the case of reverting and being done, the user has to click revert and THEN cancel. I know this because I understand what those buttons do. I suspect most end users will click "revert" and then click "save" which is actually the opposite of what we want them to do. NOT visiting /layout ui paths as a redirect from reverting would prevent this behavior entirely.

Proposed resolution

Redirect back to the canonical view (/node/5) after a revert instead of the Layout Builder UI (/node/5/layout)

Remaining tasks

N/A

User interface changes

No changes to individual pages, just the flow of where you are redirected after reverting.

API changes

N/A

Data model changes

N/A

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Component: layout.module » layout_builder.module

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

tim.plunkett’s picture

Issue tags: +Usability
tim.plunkett’s picture

Issue summary: View changes
Status: Postponed » Active

This doesn't need to be postponed on that issue, now that we know the scope of the solution there.
Updated the issue summary

tim.plunkett’s picture

Title: Discuss improvements to Layout Builder workflow when switching between overrides and defaults » After reverting an override it is not clear that a new override was set in tempstore
Category: Task » Bug report
StatusFileSize
new1.26 KB
new1.95 KB

Also, I should note that there was one other concern about reverting: currently in HEAD if you remove all of the sections from an override, it's the same as reverting. And this is very confusing!
But, that's being fixed in #3030647: Do not add a section when editing an empty layout, or differentiate between new layouts and existing empty layouts which is RTBC.

tim.plunkett’s picture

Status: Active » Needs review

The last submitted patch, 9: 2936501-postrevert-7-FAIL.patch, failed testing. View results

tim.plunkett’s picture

Issue summary: View changes

I meant to mention: I filled in the issue summary based on both the historical comment from @EclipseGc as well as a conversation today.
Also, I am re-updating the issue summary based on discussion with @DyanneNova where she expressed interest for the redirect fix solution.

  1. +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
    @@ -251,12 +251,13 @@ public function testLayoutBuilderUi() {
    +    $assert_session->addressEquals('node/1');
    

    Just one additional check to ensure we're in the right place after reverting.

  2. +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
    @@ -251,12 +251,13 @@ public function testLayoutBuilderUi() {
    -    $assert_session->pageTextContains('Placeholder for the "Extra label" field');
    +    $assert_session->pageTextContains('Extra, Extra read all about it.');
    

    These two strings are asserted multiple times throughout the test. One is used when viewing the Layout Builder UI and one is when viewing the actual result. Because of the changed redirect after reverting, this switches the expectation.

tim.plunkett’s picture

Issue tags: +Needs usability review

Tagging for usability review

tedbow’s picture

The code and test look good here! I think RTBC ready pending the usability reiview

bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs usability review

I presented this at the Feb 26 2018 UX meeting and the group agreed the patch functionality was AOK.

xjm’s picture

Title: After reverting an override it is not clear that a new override was set in tempstore » Reverting an override redirects the user to an edit form for a new override and therefore still sets the new override in the tempstore, which is confusing

xjm credited jrockowitz.

xjm credited phenaproxima.

xjm credited webchick.

xjm’s picture

Title: Reverting an override redirects the user to an edit form for a new override and therefore still sets the new override in the tempstore, which is confusing » Reverting an override redirects the user to an edit form for a new override and therefore still sets the new override as "unsaved changes", which is confusing

xjm credited benjifisher.

xjm’s picture

  • xjm committed 34aa830 on 8.7.x
    Issue #2936501 by tim.plunkett, andrewmacpherson, EclipseGc, DyanneNova...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

I tested this myself and the new behavior is much more intuitive, even though it didn't seem like it would be when I read the IS. Nice work!

Committed to 8.7.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.