created ShopperAgent component and refactored useMiaw hook to just a …#2370
Merged
sf-mkosak merged 5 commits intoSalesforceCommerceCloud:feature-shopper-agent-exp-v3.0from Apr 23, 2025
Conversation
alexvuong
reviewed
Apr 22, 2025
| commerceAgenticEsdName: process.env.COMMERCE_AGENTIC_EMBEDDED_SERVICE_DEVELOPER_NAME || "MIAW_Guided_Shopper_production_functional38", | ||
| commerceAgenticEsdEndpoint: process.env.COMMERCE_AGENTIC_EMBEDDED_SERVICE_FULL_ENDPOINT || "https://orgfarm-7455a909de.test1.my.pc-rnd.site.com/ESWMIAWGuidedShopperpr1743525851212", | ||
| commerceAgenticEsdScriptSourceUrl: process.env.COMMERCE_AGENTIC_EMBEDDED_SERVICE_SCRIPT_SOURCE_URL || "https://orgfarm-7455a909de.test1.my.pc-rnd.site.com/ESWMIAWGuidedShopperpr1743525851212/assets/js/bootstrap.min.js", | ||
| commerceAgenticScrt2Url: process.env.COMMERCE_AGENTIC_SCRT2_URL || "https://orgfarm-7455a909de.test1.my.pc-rnd.salesforce-scrt.com", |
Contributor
There was a problem hiding this comment.
Would it better if we scope these fields under commerceAgent ?
app: {
commerceAgent: {
miawEnabled: process.env.COMMERCE_AGENTIC_MIAW_ENABLED || "true"
... the rest of config
}
}
Author
There was a problem hiding this comment.
Yes! I believe we are collapsing these all into one variable. See #2369 . That will likely land first and I'll adjust this PR.
de3c30d to
13c34ac
Compare
sf-mkosak
commented
Apr 22, 2025
| const {data: customer} = useCurrentCustomer() | ||
| const {data: basket} = useCurrentBasket() | ||
| const config = getConfig(); | ||
| const config = getConfig() |
Author
There was a problem hiding this comment.
I guess the linting doesn't like semi colons
sf-mkosak
commented
Apr 22, 2025
| import {useEffect, useState} from 'react' | ||
| import useScript from '@salesforce/retail-react-app/app/hooks/use-script' | ||
|
|
||
| const onClient = typeof window !== 'undefined' |
Author
There was a problem hiding this comment.
Not sure what the best practice is here. Admittedly this was copy and pasted from another spot.
| return ( | ||
| <Box className="sf-app" {...styles.container}> | ||
| <StorefrontPreview getToken={getTokenWhenReady}> | ||
| <ShopperAgent |
| "extract-default-translations": "node ./scripts/translations/extract-default-messages.js en-US en-GB", | ||
| "format": "pwa-kit-dev format \"**/*.{js,jsx}\"", | ||
| "lint": "pwa-kit-dev lint \"**/*.{js,jsx}\"", | ||
| "lint": "pwa-kit-dev lint \"**/*.{js,jsx}\" --fix", |
khan-salesforce
approved these changes
Apr 22, 2025
13c34ac to
066c939
Compare
packages/template-retail-react-app/app/components/shopper-agent/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/shopper-agent/index.jsx
Show resolved
Hide resolved
ac60f86
into
SalesforceCommerceCloud:feature-shopper-agent-exp-v3.0
8 of 9 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…useScript hook
Description
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization