Problem/Motivation

Since #3617547: Make pattern presets buildable, presets are hard to reach from the builder.

Proposed resolution

The Instances panel lists presets in their own Presets tab, next to Displays, open first while building a preset.
They are listed under their group, the preset being built first in its group.
A help icon says what a preset is.
The View more cap is removed.
Publishing a preset says the displays already using it do not change.
Saving a preset links to the presets list, in a new tab.
The add form says the content is built in the next step.
Group and Enabled get a description.
PatternPreset declared an admin_permission that does not exist, now fixed.

Remaining tasks

Review. The presets list part moved to #3631292: Filter, sort and page the presets list.

API changes

New optional description on #[DisplayBuildable], new optional group on DisplayReference, new active prop on the tabs component.

CommentFileSizeAuthor
#11 displays.png23.9 KBpdureau
#11 presets.png21.43 KBpdureau
#6 3624934_preview.jpg154.16 KBmogtofu33
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Assigned: mogtofu33 » pdureau
Status: Needs work » Needs review
mogtofu33’s picture

mogtofu33’s picture

mogtofu33’s picture

StatusFileSize
new154.16 KB

Updated with a split instances and some common with the instances list to rationalize the filters.

preview instances and colletion

Instances panel

  • Presets have their own Presets tab next to Displays, instead of a collapsed group at the end. They no longer push the displays down, and the "Groups shown collapsed" profile setting is gone.
  • Presets are listed by group, as in the library. The sentence saying what a preset is became a help icon beside the heading.
  • The display being built comes first in its group. The "View more" cap is removed: the filter covers long lists, and the buildables already cap their own queries.
  • The status dot of a disabled display no longer says "This page layout is disabled" whatever the display is.

Presets list

  • Filter by group, context and label. Sort by label, publication or last update, the most recent first by default. 20 a page. Filters, sort and page are in the URL.
  • New Status column: enabled and published are independent, a disabled preset can be published.
  • No more drag ordering: weight is removed, with a post update. The library lists presets by group, then by label.
  • The add form says the content is built in the next step. Group and Enabled have a description.

Instances list

  • Filters and sort moved from the session to the URL, on the same code as the presets list: FilteredListBuilderTrait and ListFilterFormBase. The name filter matches the label or the ID, whatever the case.

Fixed on the way

  • PatternPreset declared admin_permission: 'administer Pattern preset', a permission that does not exist, so entity edit and delete access only passed for users with every permission.
  • The row links of the Instances panel were 4.09:1 on white, now --sl-color-primary-700.
  • The front-end theme no longer styles the chrome headings and the link of the preset toast.

API and data changes

  • #[DisplayBuildable]: new optional description.
  • DisplayReference: new optional group.
  • display_builder.pattern_preset.*: weight removed. Change record to publish on merge: "Pattern presets no longer have a weight". The Bootstrap recipe drops it too.
mogtofu33’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Needs work

Rebased, will try to simplify and perhaps split to simplify review.

mogtofu33’s picture

Title: Show presets in the Instances panel and improve the presets list » Show presets in the Instances panel

I moved the presets list part to #3631292: Filter, sort and page the presets list, so each MR can be reviewed on its own.
This one keeps the Instances panel: a Presets tab next to Displays, presets listed under their group, the messages after publishing and saving a preset, and help texts on the add form.
It also fixes the admin_permission of PatternPreset, which named a permission that does not exist. The two MRs merge in either order.

mogtofu33’s picture

Issue summary: View changes
mogtofu33’s picture

Assigned: mogtofu33 » pdureau
Status: Needs work » Needs review
pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new21.43 KB
new23.9 KB

Presets tab

Presets have their own Presets tab next to Displays, instead of a collapsed group at the end. They no longer push the displays down, and the "Groups shown collapsed" profile setting is gone.

I am not sure about having a preset list here and allowing the creation of a preset from here:
a
It looks busy and confusing to me, to have:

  • an extra level of tabs in Instance panel
  • 2 different places about "Pattern presets' in the sidebar

So I would humbly recommend to skip this tab and call the "Instance" panel "Display" instead:
a

However, this is not a necessarily a RTBC blocker because:

  • This is mitigated by the fact than this feature is "locked" behind the "Administer Display Builder presets" permission
  • I am not an expert and I didn't do an extensive review of other tools like you did, so if this change comes from such study, consider my opinion secondary.

Other changes

  • mogtofu33 committed 6ec34e2e on 1.0.x
    task: #3624934 Show presets in the Instances panel
    
    By: mogtofu33
    By:...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Has been shipped in beta9

pdureau’s picture

Status: Fixed » Closed (fixed)