From 57d82f7ea46d52430900dd76ee6ba0b141db9421 Mon Sep 17 00:00:00 2001 From: Gabriele Antonini <106664971+gabriele-ct@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:28:11 +0200 Subject: [PATCH] chore: don't select any product area in doc microsite release notes (#2101) * chore: don't select any product area in doc microsite release notes * chore: changeset * chore: fix link --- .changeset/many-singers-tan.md | 5 +++++ .../gatsby-theme-docs/src/hooks/use-release-notes-config.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/many-singers-tan.md diff --git a/.changeset/many-singers-tan.md b/.changeset/many-singers-tan.md new file mode 100644 index 0000000000..c0c8184ee2 --- /dev/null +++ b/.changeset/many-singers-tan.md @@ -0,0 +1,5 @@ +--- +'@commercetools-docs/gatsby-theme-docs': patch +--- + +Add the ability to disable per microsite the productArea release notes filter. diff --git a/packages/gatsby-theme-docs/src/hooks/use-release-notes-config.js b/packages/gatsby-theme-docs/src/hooks/use-release-notes-config.js index 6c7abd28da..d8bd04047b 100644 --- a/packages/gatsby-theme-docs/src/hooks/use-release-notes-config.js +++ b/packages/gatsby-theme-docs/src/hooks/use-release-notes-config.js @@ -2,6 +2,7 @@ import { buildReleaseNotesQueryString } from '../utils/release-notes'; import { useSiteData } from './use-site-data'; const OTHER_GROUP_SITE_PREFIXES = []; // let's use pathPrefix to identify websites that point to others tab (works only on prod), docs-team asked to point all to product sofar +const NO_PRODUCT_AREA_SITE_PREFIXES = ['/docs']; // when matching these site prefixes, the productArea param will not be added to the release notes url const RELEASE_NOTES_BASE_URL = '/docs/release-notes'; // only prod url const useReleaseNotesConfig = () => { @@ -16,7 +17,7 @@ const useReleaseNotesConfig = () => { const queryString = buildReleaseNotesQueryString( OTHER_GROUP_SITE_PREFIXES.includes(pathPrefix) ? 'other' : 'product', product, - title + NO_PRODUCT_AREA_SITE_PREFIXES.includes(pathPrefix) ? undefined : title ); return `${RELEASE_NOTES_BASE_URL}?${queryString}`; };