Skip to content

Commit

Permalink
fix: all release notes link with no filters (#2013)
Browse files Browse the repository at this point in the history
Co-authored-by: Fady Attia <[email protected]>
  • Loading branch information
gabriele-ct and FFawzy authored Jun 24, 2024
1 parent cd5f2fd commit 1e83b4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-olives-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-docs/gatsby-theme-docs': patch
---

All release notes link will send users to unfiltered release notes page
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { buildReleaseNotesQueryString } from '../utils/release-notes';
import { useSiteData } from './use-site-data';

const OTHER_GROUP_SITE_PREFIXES = ['/docs']; // let's yse pathPrefix to identify websites (works only on prod)
const OTHER_GROUP_SITE_PREFIXES = ['/docs']; // let's use pathPrefix to identify websites (works only on prod)
const RELEASE_NOTES_BASE_URL = '/docs/release-notes'; // only prod url

const useReleaseNotesConfig = () => {
const {
Expand All @@ -17,10 +18,10 @@ const useReleaseNotesConfig = () => {
product,
title
);
return `/docs/release-notes?${queryString}`; // only prod url
return `${RELEASE_NOTES_BASE_URL}?${queryString}`;
};

return { getReleaseNotesUrl };
return { getReleaseNotesUrl, RELEASE_NOTES_BASE_URL };
};

export default useReleaseNotesConfig;
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const LayoutReleaseNotesDetail = (props) => {
const { ref } = useInView();
const layoutState = useLayoutState();
const siteData = useSiteData();
const { getReleaseNotesUrl } = useReleaseNotesConfig();
const { RELEASE_NOTES_BASE_URL } = useReleaseNotesConfig();
const excludeFromSearchIndex =
props.pageData.excludeFromSearchIndex ||
siteData.siteMetadata.excludeFromSearchIndex;
Expand Down Expand Up @@ -61,7 +61,7 @@ const LayoutReleaseNotesDetail = (props) => {
<LayoutPage>
<LayoutPageHeader>
<Link
href={`/..${getReleaseNotesUrl()}`}
href={`/..${RELEASE_NOTES_BASE_URL}`}
nounderline={true}
css={css`
svg {
Expand Down

0 comments on commit 1e83b4a

Please sign in to comment.