From 07076ebf9de1bb2cf6fda580ed72e7834fb4641e Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Thu, 16 May 2024 08:18:58 -0500 Subject: [PATCH] [PM-7231] Product Switcher within navigation sidebar (#8810) * refactor: move logic for products into a service - This is in preparation for having having the navigation menu show products based off of the same logic. * add extra small font size to tailwind config * remove absolute positioning from toggle width component - it now sits beneath the product switcher * update product switcher to have UI details that are only shown in the navigation pane * add navigation oriented product switcher * integrate navigation product switcher into secrets manager * integrate navigation product switcher into provider console * integrate navigation product switcher into user layout * integrate navigation product switcher into organizations * add translation for "switch" * hide active styles from navigation product switcher * update storybook for product switcher stories * remove unneeded full width style * use protected readonly variable instead of getter * migrate stories to CSF3 * remove double subscription to `moreProducts$` * only use wrapping div in navigation switcher story - less vertical space is taken up * update to satisfies * refactor `navigationUI` to `otherProductOverrides` * move observables to protected readonly * apply margin-top via class on the host component * remove switch text from the navigation product switcher * Allow for the active navigation switcher to be shown * remove xxs font style * remove unneeded module * remove switch from stories * remove defensive nullish coalescing * remove merge leftovers * Defect PM-7899 - show organizations product at the top of the other products list * Defect PM-7951 use attr.icon to keep the icon as an attribute after prod mode is enabled * Defect PM-7948 update path based on the current org * force active styles for navigation items (#9128) * add horizontal margin to icon --------- Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> --- .../organization-layout.component.html | 8 +- .../layouts/organization-layout.component.ts | 2 + .../navigation-switcher.component.html | 35 +++ .../navigation-switcher.component.spec.ts | 194 ++++++++++++++++ .../navigation-switcher.component.ts | 24 ++ .../navigation-switcher.stories.ts | 171 ++++++++++++++ .../product-switcher-content.component.ts | 138 +---------- .../product-switcher.module.ts | 12 +- .../product-switcher.stories.ts | 67 ++++-- .../shared/product-switcher.service.spec.ts | 216 ++++++++++++++++++ .../shared/product-switcher.service.ts | 189 +++++++++++++++ .../src/app/layouts/toggle-width.component.ts | 1 - .../app/layouts/user-layout.component.html | 4 +- .../src/app/layouts/user-layout.component.ts | 2 + apps/web/src/locales/en/messages.json | 6 + .../providers/providers-layout.component.html | 5 +- .../providers/providers-layout.component.ts | 2 + .../secrets-manager/layout/layout.module.ts | 2 + .../layout/navigation.component.html | 4 +- .../src/navigation/nav-item.component.ts | 7 +- .../src/navigation/nav-item.stories.ts | 11 + 21 files changed, 932 insertions(+), 168 deletions(-) create mode 100644 apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.html create mode 100644 apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.spec.ts create mode 100644 apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.ts create mode 100644 apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.stories.ts create mode 100644 apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.spec.ts create mode 100644 apps/web/src/app/layouts/product-switcher/shared/product-switcher.service.ts diff --git a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html index 2b3be14974..d1a48a78e1 100644 --- a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html +++ b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html @@ -1,5 +1,9 @@ -