-
Notifications
You must be signed in to change notification settings - Fork 391
upcoming: [UIE-9814] - Implement the main product grid with category grouping and load more functionality #13267
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: develop
Are you sure you want to change the base?
Conversation
…grouping and load more functionality
| placeholderData: keepPreviousData, | ||
| }); | ||
|
|
||
| export const useAllMarketplacePartnersQuery = ( |
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.
Could we update this name to useAllMarketplacePartnersMapQuery for more clarity?
| return { | ||
| partnersById, | ||
| }; |
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.
| return { | |
| partnersById, | |
| }; | |
| return partnersById; |
packages/manager/src/features/Marketplace/MarketplaceLanding/CategorySection.tsx
Show resolved
Hide resolved
| export interface ProductCardData { | ||
| data: { | ||
| companyName: string; | ||
| description: string; | ||
| logoUrl: string; | ||
| productName: string; | ||
| productTag?: string; | ||
| type: string; | ||
| }; | ||
| id: number; | ||
| } |
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.
| export interface ProductCardData { | |
| data: { | |
| companyName: string; | |
| description: string; | |
| logoUrl: string; | |
| productName: string; | |
| productTag?: string; | |
| type: string; | |
| }; | |
| id: number; | |
| } | |
| export interface ProductCardItem { | |
| data: ProductCardData; | |
| id: number; | |
| } |
Let's reuse the ProductCardData type defined in ProductSelectionCard to avoid duplicating types and names
| const products = React.useMemo( | ||
| () => | ||
| productsData?.pages.flatMap((page) => page.data) ?? | ||
| filteredProducts ?? | ||
| [], | ||
| [productsData, filteredProducts] | ||
| ); |
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.
We can simplify this since filteredProducts isn't needed here:
const products = React.useMemo(
() => productsData?.pages.flatMap((page) => page.data) ?? [],
[productsData]
);
| isLoading, | ||
| } = useAllMarketplaceCategoriesQuery({}, {}, true); | ||
|
|
||
| const filteredProducts = marketplaceProductFactory.buildList(5); |
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.
| const filteredProducts = marketplaceProductFactory.buildList(5); |
|
|
||
| const filteredProducts = marketplaceProductFactory.buildList(5); | ||
|
|
||
| const categories = categoriesData || marketplaceCategoryFactory.buildList(5); |
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.
| const categories = categoriesData || marketplaceCategoryFactory.buildList(5); |
Let's avoid using factories here
|
|
||
| export const MarketplaceLanding = () => { | ||
| const { | ||
| data: categoriesData, |
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.
| data: categoriesData, | |
| data: categories, |
| <CategorySection | ||
| key={category.id} | ||
| {...category} | ||
| filteredProducts={filteredProducts} |
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.
| filteredProducts={filteredProducts} | |
| filters={globalFilters} |
reason mentioned here: #13267 (comment)
| category.products_count > 0 && ( | ||
| <CategorySection | ||
| key={category.id} | ||
| {...category} |
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.
| {...category} | |
| category={category} |
Cloud Manager UI test results🔺 1 failing test on test run #2 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts" |
|||||||||||||||||
Description 📝
Highlight the Pull Request's context and intentions.
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
Please specify a release date (and environment, if applicable) to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.
Preview 📷
Include a screenshot
<img src="" />or video<video src="" />of the change.🔒 Use the Mask Sensitive Data setting for security.
💡 For changes requiring multiple steps to validate, prefer a video for clarity.
How to test 🧪
Prerequisites
(How to setup test environment)
Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅