Problem/Motivation

In #3360373-8: [2.0.0-beta2] Allow multiple previews for each pattern, Florent asked:

I think it would be nice to have a mechanism which allows a module or theme to add stories to an existing component without having to redeclare the component.

Proposed resolution

Do we introduce a component story plugin type?

So, we can implement discoveries for :

  • UI Patterns 2 stories, based on Render arrays serialized in YML. We move them to separate files (as initially asked by Duaelfr)? One story by file? It will make compoennt definitions YML smaller and allow to declare additional stories as asked by Florent.
  • JSON schema examples, as described in #3414774: JSON schema examples property
  • Former Mateu's CL JSON format
  • New Mateu's Twig format (this one looks complicated to parse)
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

pdureau created an issue. See original summary.

grimreaper’s picture

Issue summary: View changes
pdureau’s picture

Status: Active » Closed (won't fix)

Checked with Florent, no need for this anymore

grimreaper’s picture

Status: Closed (won't fix) » Active

After a night of sleep I remember why I put this comment.

In a project using a UI Suite theme and having a sub theme, you will use patterns with styles in Layout Builder or anywhere else.

The idea was to enrich the patterns preview in libraries with the styles applied on the project.

pdureau’s picture

Assigned: Unassigned » pdureau
pdureau’s picture

Title: [2.0.0-beta1] Add a stories specific discovery » [2.0.0-beta2] Add a stories specific discovery

Not enough time left in Beta 1.

pdureau’s picture

Status: Active » Postponed
pdureau’s picture

Status: Postponed » Needs work

Work has started

pdureau’s picture

Title: [2.0.0-beta2] Add a stories specific discovery » [2.0.0-beta3] Add a stories specific discovery

pdureau’s picture

We will need #3475153: Make DirectoryWithMetadataDiscovery generic and reusable to make the implementation nice

pdureau’s picture

Title: [2.0.0-beta3] Add a stories specific discovery » [2.0.0-beta4] Add a stories specific discovery
pdureau’s picture

Title: [2.0.0-beta4] Add a stories specific discovery » [2.0.0-beta5] Add a stories specific discovery
pdureau’s picture

Mostly done.

Next steps:

  • check why stories from theme are loaded as plugins, but not loaded by ::getComponentStories()
  • #story in render element: use machineName instead of plugin ID
  • tests?
pdureau’s picture

Title: [2.0.0-beta5] Add a stories specific discovery » [2.0.0-beta4] Add a stories specific discovery

Moved back to beta4.

Next steps:

  • update component converter (drush upm)
pdureau’s picture

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

Assigned: grimreaper » pdureau
Status: Needs review » Reviewed & tested by the community
g4mbini’s picture

Already tested with alert component, it's working !

Now I will apply this to all other components to finish my test process.

g4mbini’s picture

RTBC +1 :)

Finally updated all DaisyUI components. Worked like a charm !

Just wondering: is it possible to manage ordered stories when we have more than one ?

pdureau’s picture

Status: Reviewed & tested by the community » Needs work

I need to update ui_patterns_devel too

pdureau’s picture

Status: Needs work » Needs review
pdureau’s picture

  • pdureau committed d6c3638a on 2.0.x
    Issue #3455354 by pdureau, grimreaper, g4mbini: Add a stories specific...
pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs review » Fixed
pdureau’s picture

Status: Fixed » Closed (fixed)