-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adapt release notes back links to the new format (#2005)
* chore: adapt release notes back links to the new format * chore: changeset
- Loading branch information
1 parent
7c8ee9e
commit cf28c03
Showing
4 changed files
with
26 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@commercetools-docs/gatsby-theme-docs': patch | ||
--- | ||
|
||
Adapt the release notes pages back links to the new parameters format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
export const MIN_DATERANGE = 0; | ||
export const MAX_DATERANGE = 2537011284; | ||
|
||
export const buildReleaseNotesQueryString = (group, product, productArea) => { | ||
let searchState = { | ||
range: { | ||
dateTimestamp: `${MIN_DATERANGE}:${MAX_DATERANGE}`, | ||
}, | ||
}; | ||
const queryStringParams = new URLSearchParams(); | ||
|
||
// tab param | ||
if (group) { | ||
searchState.configure = { | ||
...searchState.configure, | ||
facetFilters: `group:${group}`, | ||
}; | ||
queryStringParams.set('tab', group); | ||
} | ||
|
||
// product param | ||
if (product) { | ||
searchState.refinementList = { | ||
...searchState.refinementList, | ||
product: [product], | ||
}; | ||
queryStringParams.set('product', product); | ||
} | ||
|
||
// productArea param | ||
if (productArea) { | ||
searchState.refinementList = { | ||
...searchState.refinementList, | ||
productArea: [productArea], | ||
}; | ||
queryStringParams.set('productArea', productArea); | ||
} | ||
return searchState.refinementList | ||
? `?searchState=${encodeURIComponent(JSON.stringify(searchState))}` | ||
: ''; | ||
|
||
return `${queryStringParams.toString()}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters