Add stories for assign attribute value modals#6334
Merged
witoszekdev merged 12 commits intomainfrom Feb 12, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 8b4d8b1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6538135 to
a80795b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6334 +/- ##
==========================================
- Coverage 42.58% 42.55% -0.04%
==========================================
Files 2495 2499 +4
Lines 43305 43338 +33
Branches 10249 9855 -394
==========================================
Hits 18442 18442
- Misses 23547 24859 +1312
+ Partials 1316 37 -1279 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Differences FoundExpandLicense Package MIT @mizdra/graphql-codegen-typescript-fabbrica MIT graphql-relay SummaryExpand
|
lkostrowski
approved these changes
Feb 12, 2026
This was referenced Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added stories for "Assign ..." modals + configuration for writing more stories, see below.
Stories have manual controls (to hide data props and
on*handlers) and setup to display user actions in storybook (e.g.onFilterChange)Preview
Factories for creating mock data
Previous Dashboard stories had very large files with mock data, which were very similar to each other. These were used to render entire dashboard views. This was hard to maintain, because each props change required updates in numerous storybook files.
Instead in this PR we'll use factories to define how to create each GraphQL type (e.g. Channel, Image, etc.) which can be reused anywhere.
Configured new codegen plugin:
@mizdra/graphql-codegen-typescript-fabbrica. It generates factories, that can be used for easily writing mock data to use with tests and stories. Factories are fully typed, they accept default data (which can be also dynamic). Then to build the mock data, we can just callFactory.build(). There are different build methods, e.g..buildListto generate n items in an array.Example:
Static fields
Dynamic fields
More details: https://github.com/mizdra/graphql-codegen-typescript-fabbrica
Request mocking PoC
Added
ApolloProviderwhich usesApolloLinkto return mocked GraphQL responses, based on the document name (e.g._GetPageTypesChoicesDocument). This allows mocking simple data that is deeply nested (e.g. ConditionalFilters define their own queries, which are reused everywhere)See: storybookUtils/AssignDialogShared/storyDecorators.tsx
This works for simple use-cases, where we just need to have static definition of responses.
Next steps
esnextorbundlermoduleResolution, right now we need to hack around this with.d.ts