-
Notifications
You must be signed in to change notification settings - Fork 1
[DEV-3015] Add generic filtered grid #1738
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 45d593c 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 |
# Conflicts: # apps/nextjs-website/src/components/organisms/FilteredGridLayout/FilteredGridLayout.tsx # apps/nextjs-website/src/components/organisms/TutorialsList/TutorialsList.tsx
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-3015 |
<TutorialsList | ||
<FilteredGridLayout | ||
items={mappedTutorials} | ||
tags={product.tags || []} |
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 put a default value for tags on the FilteredGridLayout component itself allowing it to take undefined or falsey tags and handle the case with a fallback to empty array in the component
tags={product.tags || []} | |
tags={product.tags} |
<UseCaseList | ||
<FilteredGridLayout | ||
items={mappedUseCases} | ||
tags={product.tags || []} |
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.
tags={product.tags || []} | |
tags={product.tags} |
readonly useCases: readonly UseCase[]; | ||
type FilteredGridLayoutProps = { | ||
readonly items: readonly (INewsroomItem & { tags: readonly Tag[] })[]; | ||
readonly tags: readonly Tag[]; |
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.
Would put this optional
readonly tags: readonly Tag[]; | |
readonly tags?: readonly Tag[] | null; |
return ( | ||
selectedTag === 0 || | ||
useCase.tags?.some((tag) => tag.name === updatedTags[selectedTag].name) | ||
item.tags?.some((tag) => tag.name === updatedTags[selectedTag].name) |
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.
this should already handle the null tags scenario
List of Changes
Generalise filtered grid for use cases, tutorials and webinars
Motivation and Context
How Has This Been Tested?
lolcalhost
Screenshots (if appropriate):
Types of changes
Checklist: