Skip to content

[polaris.shopify.com] Fix editPageLinkPath to include leading slash for correct URL generation #13982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spicy-states-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'polaris.shopify.com': patch
---

Fix `editPageLinkPath` to include leading slash for correct URL generation
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Fullscreen bar
category: Navigation
category: Deprecated
keywords:
- topbar
- top bar
Expand All @@ -14,7 +14,8 @@ examples:
- fileName: fullscreen-bar-no-children.tsx
title: No children
description: Use this default to show ONLY the Back button.
previewImg: /images/components/navigation/fullscreen-bar.png
status: Deprecated
previewImg: /images/components/deprecated/fullscreen-bar.png
---

# {frontmatter.title}
Expand All @@ -25,6 +26,14 @@ The Fullscreen bar is a header component that should be presented at the top of

</Lede>

<StatusBanner status={frontmatter.status}>
This component is no longer supported. Please use the [App Bridge Modal
API](https://shopify.dev/docs/api/app-bridge-library/web-components/ui-modal?example=modals-with-different-options-opening-a-max-size-modal)
in combination with the [App Bridge Title Bar
API](https://shopify.dev/docs/api/app-bridge-library/web-components/ui-title-bar)
instead.
</StatusBanner>

<Examples />

<Props componentName={frontmatter.title} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Page actions
shortDescription: Allows merchants to take key actions at the bottom of specific pages in the interface.
category: Actions
category: Deprecated
keywords:
- PageActions
- bottom of page actions
Expand All @@ -25,7 +25,8 @@ examples:
- fileName: page-actions-with-custom-secondary-action.tsx
title: With custom secondary action
description: Use to create a custom secondary action.
previewImg: /images/components/actions/page-actions.png
status: Deprecated
previewImg: /images/components/deprecated/page-actions.png
---

# {frontmatter.title}
Expand All @@ -36,6 +37,11 @@ Page actions let merchants take key actions at the bottom of specific pages in t

</Lede>

<StatusBanner status={frontmatter.status}>
This component is no longer supported. Please use the [App Bridge Save Bar
API](https://shopify.dev/docs/api/app-bridge-library/apis/save-bar) instead.
</StatusBanner>

<Examples />

<Props componentName={frontmatter.title} />
Expand Down
2 changes: 1 addition & 1 deletion polaris.shopify.com/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
20 changes: 10 additions & 10 deletions polaris.shopify.com/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ const actions = [
destination: '/components/actions/button',
permanent: true,
},
{
source: '/components/page-actions',
destination: '/components/actions/page-actions',
permanent: true,
},
];

const deprecated = [
Expand All @@ -260,6 +255,11 @@ const deprecated = [
destination: '/components/deprecated/display-text',
permanent: true,
},
{
source: '/components/fullscreen-bar',
destination: '/components/deprecated/fullscreen-bar',
permanent: true,
},
{
source: '/components/heading',
destination: '/components/deprecated/heading',
Expand All @@ -285,6 +285,11 @@ const deprecated = [
destination: '/components/deprecated/legacy-tabs',
permanent: true,
},
{
source: '/components/page-actions',
destination: '/components/deprecated/page-actions',
permanent: true,
},
{
source: '/components/selection-and-input/setting-toggle',
destination: '/components/deprecated/setting-toggle',
Expand Down Expand Up @@ -585,11 +590,6 @@ const navigation = [
destination: '/components/navigation/footer-help',
permanent: true,
},
{
source: '/components/fullscreen-bar',
destination: '/components/navigation/fullscreen-bar',
permanent: true,
},
{
source: '/components/link',
destination: '/components/navigation/link',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const getStaticProps: GetStaticProps<
const relativeMdPath = `content/components/${groupSlug}/${componentSlug}.mdx`;

const mdFilePath = path.resolve(process.cwd(), relativeMdPath);
const editPageLinkPath = `polaris.shopify.com/${relativeMdPath}`;
const editPageLinkPath = `/polaris.shopify.com/${relativeMdPath}`;

if (fs.existsSync(mdFilePath)) {
const [mdx, data] = await serializeMdx<FrontMatter>(mdFilePath, {load});
Expand Down