mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-2276] Upgrade Storybook to v7 (#5258)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, importProvidersFrom } from "@angular/core";
|
||||
import { RouterModule } from "@angular/router";
|
||||
import { Meta, Story, moduleMetadata } from "@storybook/angular";
|
||||
import { Meta, Story, applicationConfig, moduleMetadata } from "@storybook/angular";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
|
||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
@@ -28,43 +28,46 @@ export default {
|
||||
component: LayoutComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
[
|
||||
{
|
||||
path: "",
|
||||
component: LayoutComponent,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
redirectTo: "secrets",
|
||||
pathMatch: "full",
|
||||
},
|
||||
{
|
||||
path: "secrets",
|
||||
component: StoryContentComponent,
|
||||
data: {
|
||||
title: "secrets",
|
||||
searchTitle: "searchSecrets",
|
||||
},
|
||||
},
|
||||
{
|
||||
outlet: "sidebar",
|
||||
path: "",
|
||||
component: NavigationComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
{ useHash: true }
|
||||
),
|
||||
LayoutModule,
|
||||
IconModule,
|
||||
PreloadedEnglishI18nModule,
|
||||
],
|
||||
imports: [RouterModule, LayoutModule, IconModule],
|
||||
declarations: [StoryContentComponent],
|
||||
providers: [{ provide: OrganizationService, useClass: MockOrganizationService }],
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [
|
||||
importProvidersFrom(
|
||||
RouterModule.forRoot(
|
||||
[
|
||||
{
|
||||
path: "",
|
||||
component: LayoutComponent,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
redirectTo: "secrets",
|
||||
pathMatch: "full",
|
||||
},
|
||||
{
|
||||
path: "secrets",
|
||||
component: StoryContentComponent,
|
||||
data: {
|
||||
title: "secrets",
|
||||
searchTitle: "searchSecrets",
|
||||
},
|
||||
},
|
||||
{
|
||||
outlet: "sidebar",
|
||||
path: "",
|
||||
component: NavigationComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
{ useHash: true }
|
||||
)
|
||||
),
|
||||
importProvidersFrom(PreloadedEnglishI18nModule),
|
||||
],
|
||||
}),
|
||||
],
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { importProvidersFrom } from "@angular/core";
|
||||
import { RouterModule } from "@angular/router";
|
||||
import { Meta, Story, moduleMetadata } from "@storybook/angular";
|
||||
import { Meta, Story, applicationConfig, moduleMetadata } from "@storybook/angular";
|
||||
import { delay, of, startWith } from "rxjs";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
@@ -14,24 +15,15 @@ export default {
|
||||
component: OnboardingComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [
|
||||
JslibModule,
|
||||
RouterModule.forRoot(
|
||||
[
|
||||
{
|
||||
path: "",
|
||||
component: OnboardingComponent,
|
||||
},
|
||||
],
|
||||
{ useHash: true }
|
||||
),
|
||||
LinkModule,
|
||||
IconModule,
|
||||
ProgressModule,
|
||||
PreloadedEnglishI18nModule,
|
||||
],
|
||||
imports: [JslibModule, RouterModule, LinkModule, IconModule, ProgressModule],
|
||||
declarations: [OnboardingTaskComponent],
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [
|
||||
importProvidersFrom(RouterModule.forRoot([], { useHash: true })),
|
||||
importProvidersFrom(PreloadedEnglishI18nModule),
|
||||
],
|
||||
}),
|
||||
],
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { Component, Injectable } from "@angular/core";
|
||||
import { Component, Injectable, importProvidersFrom } from "@angular/core";
|
||||
import { RouterModule } from "@angular/router";
|
||||
import { Meta, Story, moduleMetadata, componentWrapperDecorator } from "@storybook/angular";
|
||||
import {
|
||||
Meta,
|
||||
Story,
|
||||
moduleMetadata,
|
||||
componentWrapperDecorator,
|
||||
applicationConfig,
|
||||
} from "@storybook/angular";
|
||||
import { BehaviorSubject, combineLatest, map } from "rxjs";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
@@ -16,8 +22,8 @@ import {
|
||||
NavigationModule,
|
||||
TabsModule,
|
||||
TypographyModule,
|
||||
InputModule,
|
||||
} from "@bitwarden/components";
|
||||
import { InputModule } from "@bitwarden/components/src/input/input.module";
|
||||
import { PreloadedEnglishI18nModule } from "@bitwarden/web-vault/app/tests/preloaded-english-i18n.module";
|
||||
|
||||
import { HeaderComponent } from "./header.component";
|
||||
@@ -68,15 +74,7 @@ export default {
|
||||
moduleMetadata({
|
||||
imports: [
|
||||
JslibModule,
|
||||
RouterModule.forRoot(
|
||||
[
|
||||
{
|
||||
path: "",
|
||||
component: HeaderComponent,
|
||||
},
|
||||
],
|
||||
{ useHash: true }
|
||||
),
|
||||
RouterModule,
|
||||
AvatarModule,
|
||||
BreadcrumbsModule,
|
||||
ButtonModule,
|
||||
@@ -87,7 +85,6 @@ export default {
|
||||
TabsModule,
|
||||
TypographyModule,
|
||||
NavigationModule,
|
||||
PreloadedEnglishI18nModule,
|
||||
],
|
||||
declarations: [HeaderComponent, MockProductSwitcher, MockDynamicAvatar],
|
||||
providers: [
|
||||
@@ -100,6 +97,12 @@ export default {
|
||||
},
|
||||
],
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [
|
||||
importProvidersFrom(RouterModule.forRoot([], { useHash: true })),
|
||||
importProvidersFrom(PreloadedEnglishI18nModule),
|
||||
],
|
||||
}),
|
||||
],
|
||||
} as Meta;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user