-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat(commerce): atomic-product-field-condition #3959
feat(commerce): atomic-product-field-condition #3959
Conversation
Related to #3956 Adds the `atomic-product-field-condition` component to enable conditional rendering based on commerce-specific fields in Coveo's UI Kit. - Implements the component with properties `ifDefined` and `ifNotDefined` to check for the presence or absence of specified fields. - Introduces `mustMatch` and `mustNotMatch` properties for conditional rendering based on matching field values, utilizing `ProductTemplatesHelpers`. - Ensures the component evaluates conditions on component load and removes itself from the DOM if conditions are not met, maintaining clean template structure. - Utilizes `@ProductContext` to access the current product's properties for condition evaluation. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/coveo/ui-kit/issues/3956?shareId=c1d4fa4c-3d58-4aab-a30d-db1259b300e5).
Pull Request Report PR Title ❌ Title should follow the conventional commit spec: (optional scope): Example: feat(headless): add result-list controller Bundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support product-recommendation : missing SSR support product-listing : missing SSR support case-assist : missing SSR support insight : missing SSR support |
Introduces the
For more details, open the Copilot Workspace session. |
Introduces the `atomic-product-field-condition` component and implements it in commerce example pages. - Adds the `atomic-product-field-condition` component definition in `components.d.ts`, including properties for verifying if specified fields are defined or not defined. - Implements the `atomic-product-field-condition` component in the `atomic-product-field-condition.tsx` file, with logic to conditionally render content based on product field definitions. - Updates commerce example pages (`homepage.html` and `search.html`) to replace `atomic-field-condition` with the new `atomic-product-field-condition` component for conditional rendering based on product fields. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/coveo/ui-kit/pull/3959?shareId=052a354e-c767-4be7-a8ed-fd0a509dea68).
...ic/src/components/commerce/atomic-product-field-condition/atomic-product-field-condition.tsx
Show resolved
Hide resolved
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.
Should this be marked as internal?
…ondition/atomic-product-field-condition.tsx Co-authored-by: ylakhdar <[email protected]>
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support product-recommendation : missing SSR support product-listing : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
913d1b8
to
565c1dd
Compare
565c1dd
to
7068d88
Compare
Related to #3956
Adds the
atomic-product-field-condition
component to enable conditional rendering based on commerce-specific fields in Coveo's UI Kit.ifDefined
andifNotDefined
to check for the presence or absence of specified fields.mustMatch
andmustNotMatch
properties for conditional rendering based on matching field values, utilizingProductTemplatesHelpers
.@ProductContext
to access the current product's properties for condition evaluation.KIT-3058
For more details, open the Copilot Workspace session.