diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/layout/layout.stories.ts b/bitwarden_license/bit-web/src/app/secrets-manager/layout/layout.stories.ts index 419de00875f..5c35051d169 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/layout/layout.stories.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/layout/layout.stories.ts @@ -1,13 +1,22 @@ import { Component } from "@angular/core"; import { RouterModule } from "@angular/router"; import { Meta, Story, moduleMetadata } from "@storybook/angular"; +import { BehaviorSubject } from "rxjs"; -import { NavigationModule, IconModule } from "@bitwarden/components"; +import { OrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction"; +import { Organization } from "@bitwarden/common/models/domain/organization"; +import { IconModule } from "@bitwarden/components"; import { PreloadedEnglishI18nModule } from "@bitwarden/web-vault/app/tests/preloaded-english-i18n.module"; import { LayoutComponent } from "./layout.component"; +import { LayoutModule } from "./layout.module"; import { NavigationComponent } from "./navigation.component"; +class MockOrganizationService implements Partial { + private static _orgs = new BehaviorSubject([]); + organizations$ = MockOrganizationService._orgs; // eslint-disable-line rxjs/no-exposed-subjects +} + @Component({ selector: "story-content", template: `

Content

`, @@ -49,11 +58,12 @@ export default { ], { useHash: true } ), + LayoutModule, IconModule, - NavigationModule, PreloadedEnglishI18nModule, ], - declarations: [LayoutComponent, NavigationComponent, StoryContentComponent], + declarations: [StoryContentComponent], + providers: [{ provide: OrganizationService, useClass: MockOrganizationService }], }), ], } as Meta; diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.html b/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.html index 5ebf5cb9ca0..3b058077b2a 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.html +++ b/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.html @@ -1,5 +1,5 @@ - - + + diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.ts index 1d757c90ce2..cf8b74a2358 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/layout/navigation.component.ts @@ -12,13 +12,11 @@ import { SecretsManagerLogo } from "./secrets-manager-logo"; templateUrl: "./navigation.component.html", }) export class NavigationComponent { + protected readonly logo = SecretsManagerLogo; + protected orgFilter = (org: Organization) => org.canAccessSecretsManager; protected isAdmin$ = this.route.params.pipe( map((params) => this.organizationService.get(params.organizationId)?.isAdmin) ); - protected readonly logo = SecretsManagerLogo; - - protected orgFilter = (org: Organization) => org.canAccessSecretsManager; - constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {} } diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/layout/secrets-manager-logo.ts b/bitwarden_license/bit-web/src/app/secrets-manager/layout/secrets-manager-logo.ts index 890daea9528..70f0f46540e 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/layout/secrets-manager-logo.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/layout/secrets-manager-logo.ts @@ -1,7 +1,5 @@ import { svgIcon } from "@bitwarden/components"; export const SecretsManagerLogo = svgIcon` - - - + `;