-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DEV-2101][DEV-2102] Add release note page to product section #1338
base: main
Are you sure you want to change the base?
[DEV-2101][DEV-2102] Add release note page to product section #1338
Conversation
…ease-note-codec-page-and-link
🦋 Changeset detectedLatest commit: 636c82b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Branch is not up to date with base branch@marcobottaro it seems this Pull Request is not updated with base branch. |
…ease-note-codec-page-and-link
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-2101 |
bodyConfig.gitBookPagesWithTitle | ||
); | ||
|
||
const breadcrumbsItems: { name?: string; item?: string }[] = breadcrumbs.map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name this type BreadcrumbItem
and have it defined in @/helpers/breadcrumbs.helpers
export function gitBookPageToBreadcrumbs( | ||
pagePath: string, | ||
gitBookPagesWithTitle: readonly { | ||
readonly title: string; | ||
readonly path: string; | ||
}[] | ||
): readonly BreadcrumbSegment[] { | ||
const currentPageBreadcrumbPaths = pagePath | ||
.split('/') | ||
.filter(Boolean) | ||
.map((_, index, arr) => '/' + arr.slice(0, index + 1).join('/')) | ||
.slice(2); | ||
|
||
return gitBookPagesWithTitle | ||
.filter(({ path }) => currentPageBreadcrumbPaths.includes(path)) | ||
.map(({ title, path }) => ({ | ||
name: title, | ||
path, | ||
})) | ||
.sort((a, b) => a.path.length - b.path.length); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add some comment to explain what this does
export function gitBookPageToBreadcrumbs( | |
pagePath: string, | |
gitBookPagesWithTitle: readonly { | |
readonly title: string; | |
readonly path: string; | |
}[] | |
): readonly BreadcrumbSegment[] { | |
const currentPageBreadcrumbPaths = pagePath | |
.split('/') | |
.filter(Boolean) | |
.map((_, index, arr) => '/' + arr.slice(0, index + 1).join('/')) | |
.slice(2); | |
return gitBookPagesWithTitle | |
.filter(({ path }) => currentPageBreadcrumbPaths.includes(path)) | |
.map(({ title, path }) => ({ | |
name: title, | |
path, | |
})) | |
.sort((a, b) => a.path.length - b.path.length); | |
} | |
export function gitBookPageToBreadcrumbs( | |
pagePath: string, | |
gitBookPagesWithTitle: readonly { | |
readonly title: string; | |
readonly path: string; | |
}[] | |
): readonly BreadcrumbSegment[] { | |
// Generate a list of hierarchical breadcrumb paths from the page path | |
const currentPageBreadcrumbPaths = pagePath | |
.split('/') // Split the path into parts based on '/' | |
.filter(Boolean) // Remove empty segments (e.g., leading or trailing slashes) | |
.map((_, index, arr) => '/' + arr.slice(0, index + 1).join('/')) // Reconstruct breadcrumb paths | |
.slice(2); // Ignore the first two levels (e.g., "/docs/category/page" -> ["category", "page"]) | |
// Match breadcrumb paths with available pages and sort them in hierarchical order | |
return gitBookPagesWithTitle | |
.filter(({ path }) => currentPageBreadcrumbPaths.includes(path)) // Keep only the paths present in breadcrumbs | |
.map(({ title, path }) => ({ | |
name: title, // Assign title as breadcrumb name | |
path, // Keep the corresponding path | |
})) | |
.sort((a, b) => a.path.length - b.path.length); // Sort breadcrumbs by path length (ensuring hierarchy) | |
}``` |
This PR depends on #1325
List of Changes
Add release note codec
Add product release note page
Add link to product release note in product menu
Motivation and Context
The page was missing
How Has This Been Tested?
By using the local Strapi instance to add a new Release note item (pointing to this space
JzXl8H23oVGyUzZoVWiY
) and to add the relation with a random Product.Screenshots (if appropriate):
Strapi:
Types of changes
Checklist: