Problem/Motivation
The vartheme_bs5:heading SDC component does not appear in the Drupal Canvas library, and its Storybook stories fail to render. Both issues stem from empty-string handling around enum-typed props
(text_size, text_color, align, font_weight, font_style, target):
- Canvas
ComponentMetadataRequirementsChecker disqualifies any prop whose enum contains ''.
- SDC strict validation rejects empty-string values passed by Storybook stories that aren't in the enum.
Steps to reproduce
- Install Varbase (minimal) with vartheme_bs5 and the Canvas + Storybook modules enabled.
- Open
/canvas/editor/canvas_page/<id> → Library → Base. Heading is missing.
- Open
/?path=/story/base-heading--default in Storybook. Story stays on Preparing story…; drush watchdog:show reports:
[vartheme_bs5:heading/text_size] Does not have a value in the enumeration [...]. The provided value is: "".
Proposed resolution
heading.component.yml drop - '' from each affected enum so Canvas accepts the schema.
heading.stories.twig — remove empty-string args from stories and the Default empty options in argTypes; rely on the Twig template's |default('') for unset props.
heading.stories.json — regenerate via drush storybook:generate-all-stories.
Result: Heading appears under Base in Canvas, inserts as <h3>Your heading goes here</h3>; all five Storybook stories render and controls work.
Remaining tasks
- ✅ File an issue about this project
- ✅ Addition/Change/Update/Fix to this project
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Update Release Notes
- ❌ Release varbase-11.0.0-alpha1, varbase_starter-1.0.0-alpha1, vartheme_bs5-5.0.0-alpha2
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
API changes
Data model changes
Release notes snippet
- fix: #3587468 Heading component for Drupal Canvas + Storybook
Comments
Comment #3
rajab natshahComment #4
rajab natshahComment #6
rajab natshah✅ Released vartheme_bs5-5.0.0-alpha2