From 5bfa61254429bf594a0ff18311b7626242c3664a Mon Sep 17 00:00:00 2001 From: Will Martin Date: Mon, 26 Feb 2024 20:21:49 -0500 Subject: [PATCH] temporarily disable web-header stories (#8105) --- .../layouts/header/web-header.skip-stories.ts | 232 ++++++++++++++++++ .../app/layouts/header/web-header.stories.ts | 232 ------------------ 2 files changed, 232 insertions(+), 232 deletions(-) create mode 100644 apps/web/src/app/layouts/header/web-header.skip-stories.ts delete mode 100644 apps/web/src/app/layouts/header/web-header.stories.ts diff --git a/apps/web/src/app/layouts/header/web-header.skip-stories.ts b/apps/web/src/app/layouts/header/web-header.skip-stories.ts new file mode 100644 index 0000000000..8db4aea306 --- /dev/null +++ b/apps/web/src/app/layouts/header/web-header.skip-stories.ts @@ -0,0 +1,232 @@ +// import { CommonModule } from "@angular/common"; +// import { Component, importProvidersFrom, Injectable, Input } from "@angular/core"; +// import { RouterModule } from "@angular/router"; +// import { +// applicationConfig, +// componentWrapperDecorator, +// Meta, +// moduleMetadata, +// Story, +// } from "@storybook/angular"; +// import { BehaviorSubject, combineLatest, map, of } from "rxjs"; + +// import { JslibModule } from "@bitwarden/angular/jslib.module"; +// import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service"; +// import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum"; +// import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; +// import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +// import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; +// import { +// AvatarModule, +// BreadcrumbsModule, +// ButtonModule, +// IconButtonModule, +// IconModule, +// InputModule, +// MenuModule, +// NavigationModule, +// TabsModule, +// TypographyModule, +// } from "@bitwarden/components"; + +// import { DynamicAvatarComponent } from "../../components/dynamic-avatar.component"; +// import { PreloadedEnglishI18nModule } from "../../core/tests"; +// import { WebHeaderComponent } from "../header/web-header.component"; + +// import { WebLayoutMigrationBannerService } from "./web-layout-migration-banner.service"; + +// @Injectable({ +// providedIn: "root", +// }) +// class MockStateService { +// activeAccount$ = new BehaviorSubject("1").asObservable(); +// accounts$ = new BehaviorSubject({ "1": { profile: { name: "Foo" } } }).asObservable(); +// } + +// class MockMessagingService implements MessagingService { +// send(subscriber: string, arg?: any) { +// alert(subscriber); +// } +// } + +// class MockVaultTimeoutService { +// availableVaultTimeoutActions$() { +// return new BehaviorSubject([VaultTimeoutAction.Lock]).asObservable(); +// } +// } + +// class MockPlatformUtilsService { +// isSelfHost() { +// return false; +// } +// } + +// @Component({ +// selector: "product-switcher", +// template: ``, +// }) +// class MockProductSwitcher {} + +// @Component({ +// selector: "dynamic-avatar", +// template: ``, +// standalone: true, +// imports: [CommonModule, AvatarModule], +// }) +// class MockDynamicAvatar implements Partial { +// protected name$ = combineLatest([ +// this.stateService.accounts$, +// this.stateService.activeAccount$, +// ]).pipe( +// map( +// ([accounts, activeAccount]) => accounts[activeAccount as keyof typeof accounts].profile.name, +// ), +// ); + +// @Input() +// text: string; + +// constructor(private stateService: MockStateService) {} +// } + +// export default { +// title: "Web/Header", +// component: WebHeaderComponent, +// decorators: [ +// componentWrapperDecorator( +// (story) => `
${story}
`, +// ), +// moduleMetadata({ +// imports: [ +// JslibModule, +// AvatarModule, +// BreadcrumbsModule, +// ButtonModule, +// IconButtonModule, +// IconModule, +// InputModule, +// MenuModule, +// TabsModule, +// TypographyModule, +// NavigationModule, +// MockDynamicAvatar, +// ], +// declarations: [WebHeaderComponent, MockProductSwitcher], +// providers: [ +// { provide: StateService, useClass: MockStateService }, +// { +// provide: WebLayoutMigrationBannerService, +// useValue: { +// showBanner$: of(false), +// } as Partial, +// }, +// { provide: PlatformUtilsService, useClass: MockPlatformUtilsService }, +// { provide: VaultTimeoutSettingsService, useClass: MockVaultTimeoutService }, +// { +// provide: MessagingService, +// useFactory: () => { +// return new MockMessagingService(); +// }, +// }, +// ], +// }), +// applicationConfig({ +// providers: [ +// importProvidersFrom(RouterModule.forRoot([], { useHash: true })), +// importProvidersFrom(PreloadedEnglishI18nModule), +// ], +// }), +// ], +// } as Meta; + +// export const KitchenSink: Story = (args) => ({ +// props: args, +// template: ` +// +// +// Foo +// Bar +// +// +// +// +// +// Foo +// Bar +// +// +// `, +// }); + +// export const Basic: Story = (args) => ({ +// props: args, +// template: ` +// +// `, +// }); + +// export const WithLongTitle: Story = (args) => ({ +// props: args, +// template: ` +// +// `, +// }); + +// export const WithBreadcrumbs: Story = (args) => ({ +// props: args, +// template: ` +// +// +// Foo +// Bar +// +// +// `, +// }); + +// export const WithSearch: Story = (args) => ({ +// props: args, +// template: ` +// +// +// +// `, +// }); + +// export const WithSecondaryContent: Story = (args) => ({ +// props: args, +// template: ` +// +// +// +// `, +// }); + +// export const WithTabs: Story = (args) => ({ +// props: args, +// template: ` +// +// +// Foo +// Bar +// +// +// `, +// }); + +// export const WithTitleSuffixComponent: Story = (args) => ({ +// props: args, +// template: ` +// +// +// +// `, +// }); diff --git a/apps/web/src/app/layouts/header/web-header.stories.ts b/apps/web/src/app/layouts/header/web-header.stories.ts deleted file mode 100644 index 0d2251ee44..0000000000 --- a/apps/web/src/app/layouts/header/web-header.stories.ts +++ /dev/null @@ -1,232 +0,0 @@ -import { CommonModule } from "@angular/common"; -import { Component, importProvidersFrom, Injectable, Input } from "@angular/core"; -import { RouterModule } from "@angular/router"; -import { - applicationConfig, - componentWrapperDecorator, - Meta, - moduleMetadata, - Story, -} from "@storybook/angular"; -import { BehaviorSubject, combineLatest, map, of } from "rxjs"; - -import { JslibModule } from "@bitwarden/angular/jslib.module"; -import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service"; -import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum"; -import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; -import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; -import { - AvatarModule, - BreadcrumbsModule, - ButtonModule, - IconButtonModule, - IconModule, - InputModule, - MenuModule, - NavigationModule, - TabsModule, - TypographyModule, -} from "@bitwarden/components"; - -import { DynamicAvatarComponent } from "../../components/dynamic-avatar.component"; -import { PreloadedEnglishI18nModule } from "../../core/tests"; -import { WebHeaderComponent } from "../header/web-header.component"; - -import { WebLayoutMigrationBannerService } from "./web-layout-migration-banner.service"; - -@Injectable({ - providedIn: "root", -}) -class MockStateService { - activeAccount$ = new BehaviorSubject("1").asObservable(); - accounts$ = new BehaviorSubject({ "1": { profile: { name: "Foo" } } }).asObservable(); -} - -class MockMessagingService implements MessagingService { - send(subscriber: string, arg?: any) { - alert(subscriber); - } -} - -class MockVaultTimeoutService { - availableVaultTimeoutActions$() { - return new BehaviorSubject([VaultTimeoutAction.Lock]).asObservable(); - } -} - -class MockPlatformUtilsService { - isSelfHost() { - return false; - } -} - -@Component({ - selector: "product-switcher", - template: ``, -}) -class MockProductSwitcher {} - -@Component({ - selector: "dynamic-avatar", - template: ``, - standalone: true, - imports: [CommonModule, AvatarModule], -}) -class MockDynamicAvatar implements Partial { - protected name$ = combineLatest([ - this.stateService.accounts$, - this.stateService.activeAccount$, - ]).pipe( - map( - ([accounts, activeAccount]) => accounts[activeAccount as keyof typeof accounts].profile.name, - ), - ); - - @Input() - text: string; - - constructor(private stateService: MockStateService) {} -} - -export default { - title: "Web/Header", - component: WebHeaderComponent, - decorators: [ - componentWrapperDecorator( - (story) => `
${story}
`, - ), - moduleMetadata({ - imports: [ - JslibModule, - AvatarModule, - BreadcrumbsModule, - ButtonModule, - IconButtonModule, - IconModule, - InputModule, - MenuModule, - TabsModule, - TypographyModule, - NavigationModule, - MockDynamicAvatar, - ], - declarations: [WebHeaderComponent, MockProductSwitcher], - providers: [ - { provide: StateService, useClass: MockStateService }, - { - provide: WebLayoutMigrationBannerService, - useValue: { - showBanner$: of(false), - } as Partial, - }, - { provide: PlatformUtilsService, useClass: MockPlatformUtilsService }, - { provide: VaultTimeoutSettingsService, useClass: MockVaultTimeoutService }, - { - provide: MessagingService, - useFactory: () => { - return new MockMessagingService(); - }, - }, - ], - }), - applicationConfig({ - providers: [ - importProvidersFrom(RouterModule.forRoot([], { useHash: true })), - importProvidersFrom(PreloadedEnglishI18nModule), - ], - }), - ], -} as Meta; - -export const KitchenSink: Story = (args) => ({ - props: args, - template: ` - - - Foo - Bar - - - - - - Foo - Bar - - - `, -}); - -export const Basic: Story = (args) => ({ - props: args, - template: ` - - `, -}); - -export const WithLongTitle: Story = (args) => ({ - props: args, - template: ` - - `, -}); - -export const WithBreadcrumbs: Story = (args) => ({ - props: args, - template: ` - - - Foo - Bar - - - `, -}); - -export const WithSearch: Story = (args) => ({ - props: args, - template: ` - - - - `, -}); - -export const WithSecondaryContent: Story = (args) => ({ - props: args, - template: ` - - - - `, -}); - -export const WithTabs: Story = (args) => ({ - props: args, - template: ` - - - Foo - Bar - - - `, -}); - -export const WithTitleSuffixComponent: Story = (args) => ({ - props: args, - template: ` - - - - `, -});