Skip to content

created ShopperAgent component and refactored useMiaw hook to just a …#2370

Merged
sf-mkosak merged 5 commits intoSalesforceCommerceCloud:feature-shopper-agent-exp-v3.0from
sf-mkosak:preChatContextFollowup
Apr 23, 2025
Merged

created ShopperAgent component and refactored useMiaw hook to just a …#2370
sf-mkosak merged 5 commits intoSalesforceCommerceCloud:feature-shopper-agent-exp-v3.0from
sf-mkosak:preChatContextFollowup

Conversation

@sf-mkosak
Copy link

…useScript hook

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • (step1)

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@sf-mkosak sf-mkosak requested a review from a team as a code owner April 22, 2025 19:14
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",
Copy link
Contributor

@alexvuong alexvuong Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it better if we scope these fields under commerceAgent ?

app: {
   commerceAgent: {
      miawEnabled: process.env.COMMERCE_AGENTIC_MIAW_ENABLED || "true"
      ... the rest of config 
   }
  
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I believe we are collapsing these all into one variable. See #2369 . That will likely land first and I'll adjust this PR.

@sf-mkosak sf-mkosak force-pushed the preChatContextFollowup branch from de3c30d to 13c34ac Compare April 22, 2025 19:40
const {data: customer} = useCurrentCustomer()
const {data: basket} = useCurrentBasket()
const config = getConfig();
const config = getConfig()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the linting doesn't like semi colons

import {useEffect, useState} from 'react'
import useScript from '@salesforce/retail-react-app/app/hooks/use-script'

const onClient = typeof window !== 'undefined'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

"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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove option?

@sf-mkosak sf-mkosak force-pushed the preChatContextFollowup branch from 13c34ac to 066c939 Compare April 23, 2025 16:15
Copy link

@gurpreetsainisalesforce gurpreetsainisalesforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sf-mkosak sf-mkosak merged commit ac60f86 into SalesforceCommerceCloud:feature-shopper-agent-exp-v3.0 Apr 23, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants