From eeb407b8a438e9d01333d7d93de689e55812e6d9 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 21 Dec 2022 16:50:41 -0500 Subject: [PATCH] [SM-43] create product-switcher (#4189) * rebase to master * use bit-menu in product switcher; add focusStrategy to bit-menu * recommit locales after rebase * add light style to iconButton, use in product-switcher * move out of component library * add buttonType input * gate behind sm flag * update aria-label * add role input to bit-menu * style changes * simplify partition logic * split into two components for Storybook * update focus styles; update grid sizing to relative * fix underline on hover * update attribute binding * move to layouts dir * add bitLink; update grid gap * reorder loose components * move orgs mock * move a11y module * fix aria role bug; add aria label to menu * update colors * update ring color * simplify colors * remove duplicate link module --- .storybook/main.js | 6 + .../web/src/app/layouts/navbar.component.html | 1 + .../src/app/layouts/product-switcher/index.ts | 1 + .../product-switcher-content.component.html | 39 +++++ .../product-switcher-content.component.ts | 93 ++++++++++++ .../product-switcher.component.html | 9 ++ .../product-switcher.component.ts | 19 +++ .../product-switcher.module.ts | 18 +++ .../product-switcher.stories.ts | 134 ++++++++++++++++++ .../src/app/shared/loose-components.module.ts | 9 +- apps/web/src/app/shared/shared.module.ts | 4 +- apps/web/src/locales/en/messages.json | 6 + .../layout/filter.component.html | 1 - .../layout/filter.component.ts | 7 - .../layout/header.component.html | 2 +- .../shared/sm-shared.module.ts | 6 +- .../src/icon-button/icon-button.component.ts | 13 +- .../src/icon-button/icon-button.stories.ts | 11 +- .../src/menu/menu-trigger-for.directive.ts | 21 ++- libs/components/src/menu/menu.component.html | 5 +- libs/components/src/menu/menu.component.ts | 11 +- libs/components/src/menu/menu.module.ts | 3 +- 22 files changed, 387 insertions(+), 32 deletions(-) create mode 100644 apps/web/src/app/layouts/product-switcher/index.ts create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher-content.component.html create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher-content.component.ts create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher.component.html create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher.component.ts create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher.module.ts create mode 100644 apps/web/src/app/layouts/product-switcher/product-switcher.stories.ts delete mode 100644 bitwarden_license/bit-web/src/app/secrets-manager/layout/filter.component.html delete mode 100644 bitwarden_license/bit-web/src/app/secrets-manager/layout/filter.component.ts diff --git a/.storybook/main.js b/.storybook/main.js index 83fe7fef3d..3db3964022 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -20,6 +20,12 @@ module.exports = { builder: "webpack5", disableTelemetry: true, }, + env: (config) => ({ + ...config, + FLAGS: JSON.stringify({ + secretsManager: true, + }), + }), webpackFinal: async (config, { configType }) => { config.resolve.plugins = [new TsconfigPathsPlugin()]; return config; diff --git a/apps/web/src/app/layouts/navbar.component.html b/apps/web/src/app/layouts/navbar.component.html index b7e5a69fb6..0146a83af3 100644 --- a/apps/web/src/app/layouts/navbar.component.html +++ b/apps/web/src/app/layouts/navbar.component.html @@ -38,6 +38,7 @@ +