From d03f3dfd503a9a320148f67a78c4ff8a6254444c Mon Sep 17 00:00:00 2001 From: Ben Pearey Date: Thu, 14 Aug 2025 15:37:51 +0100 Subject: [PATCH 1/3] feat: dnd hierarchy navigation placeholders (#91) * feat: using ecomm category placeholders to order navigation hierarchy * feat: adding stricter types and immutability when enriching hierarchy nodes * feat: only use selectable placeholder * fix: hide placeholder if 'is active button' unchecked * fix: pass child content active state when generating cms categories * feat: ecomm container renamed to match schemas * feat: removing need for autopopulate ecomm flag * feat: add placeholder indication * feat: add show all ecomm categories switch * feat: making sure the correct category id is passed * refactor: renaming properties for better visibility * fix: moving empty array check earlier * refactor: removing unnecessary map return * fix: rename item type to match refactor name change * feat: replace ecomm category with cms override (#97) * feat: only display category node when not used as an override * fix: category overrides ecomm category in hierarchy * fix: update to use renamed categoryId property --------- Co-authored-by: DB --- .../cms-modern/Navigation/Navigation.tsx | 92 +++++----- .../core/Masthead/NavigationContext.tsx | 48 ++---- components/core/Masthead/walkNavigation.tsx | 160 ++++++++++-------- pages/category/[slug].tsx | 7 +- 4 files changed, 156 insertions(+), 151 deletions(-) diff --git a/components/cms-modern/Navigation/Navigation.tsx b/components/cms-modern/Navigation/Navigation.tsx index 345208d2..a9c37b3d 100644 --- a/components/cms-modern/Navigation/Navigation.tsx +++ b/components/cms-modern/Navigation/Navigation.tsx @@ -16,6 +16,7 @@ const Navigation = ({ pages, style }: NavigationProps) => { const { navigationToggle, toggleNavigation } = useUI(); const [selectedMenuKey, setSelectedMenuKey] = useState(null); const router = useRouter(); + const vse = router.query.vse; const isRouteActive = (href: string | undefined, category: any): boolean => { // !!using the first word in the category slug as the current category // => full path should be present in slugs, and 1st level category slug shouldn't contain '-' @@ -61,52 +62,57 @@ const Navigation = ({ pages, style }: NavigationProps) => { setSelectedMenuKey(null); }; + const itemType = (type: string) => { + switch (type) { + case 'ecommerce-category-generated': + return 'Commerce Item'; + case 'category': + return 'CMS Override Item'; + default: + return 'CMS Item'; + } + }; + return (