chore: Fix links to Reactist components in storybook stories using LinkTo #795
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.
Short description
Follow-up to #794 where I tried to fix a couple of broken links in our storybook stories.
It turns out I didn't actually fix anything at all as the links are still missing the appropriate
/reactist
path which it seems not to be included inwindow.location.origin
😅In this PR, I initially tried to address this by concatenating
window.location.origin
withwindow.location.pathname
to (hopefully) get the correct Reactist URL path. However, that doesn't work either, becausepathname
will include/iframe.html
as well (since the link is inside an iframe) so what I'm doing in this PR doesn't work either. To be fair, even if the concatenation had worked, it would not have looked great in our code 😅I changed my approach to actually use the official Reactist add-on that "should" be used to link from a story to another story: https://storybook.js.org/addons/@storybook/addon-links (storybookjs/storybook#8618) and hopefully that will do the trick (for real, this time).
This seems to be working well when testing on the storybook dev version deployed via Chromatic (linked in the builds below)
CleanShot.2023-07-31.at.16.55.41.mp4
...so I have hopes it will work when it gets deployed to https://doist.github.io/reactist/
PR Checklist
npm run validate
and made sure no errors / warnings were shownCHANGELOG.md
package.json
andpackage-lock.json
(npm --no-git-tag-version version <major|minor|patch>
) refVersioning
Bumped patch. This is just a doc change.