-
Notifications
You must be signed in to change notification settings - Fork 54
Ability to create RTL variants of specific/all stories of a kind as substories #2453
Conversation
const matchesStoryName = name => story => story.name === name; | ||
|
||
const buildRTLSubstory = (kind, name, storyFn) => { | ||
const arabicServiceDecorator = withServicesKnob({ defaultService: 'arabic' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth adding change this to:
const rtlServiceDecorator = withServicesKnob({ defaultService: 'arabic', services:['arabic', 'persian', 'urdu', 'pashto'] });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that all the rtl services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, I just confirmed on slack.
…nto build-rtl-variant-changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, you just need to create follow up issues to apply these changes across our repos. 👍
This sounds right to me 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #1673
Overall change: Changes
buildRTLSubstories
to create RTL variants of all stories of a specific kind or specific stories of specific kind. PreviouslybuildRTLSubstories
would create RTL variants of all stories which was considered not a good approach because this would double the length of time it takes for ChromaticQA to run in the CI pipeline which is something we are actively trying to reduce.The original plan was to do this with a new decorator that we could decorate individual or many stories with however it's not possible to create new substories this way.
Examples of use:
create RTL variants of all stories of a kind
create RTL variants of specific stories of a kind
This would produce new substories in Storybook:
This new substory is then automatically added to ChromaticQA as the RTL example of the original story.
Code changes:
buildRTLSubstories.js
API and tests.