From 82b07cfdd7739ec6aba7661e36cf79a33b1bf9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20F=C3=BCrhoff?= <12294151+imagoiq@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:26:39 +0100 Subject: [PATCH] fix(documentation): edit on Github breaks page without stories attached (#2267) Fix Changelog and search for icons page after https://github.com/swisspost/design-system/pull/2132. If `storyIdToCSFFile` is not defined for example on docs page without stories attached, it breaks the whole page. ![image](https://github.com/swisspost/design-system/assets/12294151/0fea4b6e-ee95-4300-8c5c-17c0af0600ae) --- .changeset/clean-files-wonder.md | 5 +++++ packages/documentation/.storybook/blocks/footer.tsx | 10 ++++++---- packages/documentation/.storybook/blocks/layout.tsx | 6 ++++-- .../src/stories/components/input/input.docs.mdx | 2 ++ .../icons/search-icons/search-icons.blocks.tsx | 1 + .../stories/icons/search-icons/search-icons.docs.mdx | 3 ++- .../icons/search-icons/search-icons.stories.ts | 11 +++++++++++ .../src/stories/misc/changelog/changelog.docs.mdx | 5 ++--- .../src/stories/misc/changelog/changelog.stories.ts | 11 +++++++++++ 9 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 .changeset/clean-files-wonder.md create mode 100644 packages/documentation/src/stories/icons/search-icons/search-icons.stories.ts create mode 100644 packages/documentation/src/stories/misc/changelog/changelog.stories.ts diff --git a/.changeset/clean-files-wonder.md b/.changeset/clean-files-wonder.md new file mode 100644 index 0000000000..a973c09117 --- /dev/null +++ b/.changeset/clean-files-wonder.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-documentation': patch +--- + +Added attached stories to changelog and search-icons pages to fix "Edit this page on Github" feature. diff --git a/packages/documentation/.storybook/blocks/footer.tsx b/packages/documentation/.storybook/blocks/footer.tsx index 4475b58911..75d20668eb 100644 --- a/packages/documentation/.storybook/blocks/footer.tsx +++ b/packages/documentation/.storybook/blocks/footer.tsx @@ -35,12 +35,14 @@ function getGitHubUrl(path: String) { return `${BASEURL}${path.replace(/^\./, '').replace(/\.stories\.ts$/, '.docs.mdx')}`; } -export default (params: { pathToStoryFile: String }) => ( +export default (params: { pathToStoryFile?: String }) => ( <>