Problem/Motivation

When we call a component story and we override some slots and/or props value:

type: component
component: 'ui_suite_bootstrap:button'
story: preview
 slots:
   label: Test
props:
  variant: success

The override doesn't work

Proposed resolution

Reverse the merges:

-    $slots = array_merge($element["#slots"] ?? [], $story["slots"] ?? []);
+    $slots = array_merge($story["slots"] ?? [], $element["#slots"] ?? []);

-    $element["#props"] = array_merge($element["#props"] ?? [], $story["props"] ?? []);
+    $element["#props"] = array_merge($story["props"] ?? [], $element["#props"] ?? []);
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.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Needs review

  • pdureau committed 56348467 on 2.0.x
    Issue #3478622 by pdureau: Fix component stories overrides
    
pdureau’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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