diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/FeaturedBrandsPanel.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/FeaturedBrandsPanel.jsx index 1bdde00f..598f6c4c 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/FeaturedBrandsPanel.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/FeaturedBrandsPanel.jsx @@ -67,6 +67,7 @@ import Showroom from "./Showroom/Showroom"; import TodaysDeals from "./TodaysDeals/TodaysDeals"; import UpComing from "./UpComing/UpComing"; import { setContainerLastFocusedElement } from "@enact/spotlight/src/container"; +import { sortedIndexOf } from "lodash"; const STRING_CONF = { CANCEL: "CANCEL", @@ -317,36 +318,35 @@ const FeaturedBrandsPanel = ({ isOnTop, panelInfo, spotlightId }) => { ) { return; } + + const foundElement = sortedBrandLayoutInfo.find( + (el) => el.shptmBrndOptTpCd === containerId + ); + const actualShelfOrder = foundElement ? foundElement.expsOrd : null; + const selectedBrand = `${LOG_MENU.FEATURED_BRANDS}/${selectedPatncNm}`; const currentShelf = `${getMenuByContainerId(containerId)}`; const menu = selectedBrand && currentShelf && `${selectedBrand} ${currentShelf}`; - dispatch(sendLogGNB(menu)); - - // sortedBrandLayoutInfo.forEach((el) => { - // if (el.shptmBrndOptTpNm === currentShelf) { - // console.log("###el", el); - // } - // console.log("###shelfOrder", shelfOrder); - // }); dispatch( sendLogTotalRecommend({ contextName: LOG_CONTEXT_NAME.FEATURED_BRANDS, messageId: LOG_MESSAGE_ID.SHELF, partner: selectedPatncNm, - shelfLocation: shelfOrder, + shelfLocation: actualShelfOrder, shelfId: containerId, shelfTitle: currentShelf, }) ); + dispatch(sendLogGNB(menu)); setIsLogGNBSent(true); prevSelectedPatncNmRef.current = selectedPatncNm; lastMenuRef.current = getMenuByContainerId(containerId); }, - [selectedPatncNm, sortedBrandLayoutInfo, selectedPatncNm] + [selectedPatncNm, sortedBrandLayoutInfo] ); const focusOnMount = useCallback((targetId) => {