Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
--global committed Dec 21, 2024
1 parent 72cc46b commit c698779
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { PasswordRepromptService, DefaultCipherFormConfigService } from "@bitwarden/vault";
import { PasswordRepromptService, CipherFormConfigService } from "@bitwarden/vault";

// eslint-disable-next-line no-restricted-imports
import { ExposedPasswordsReportComponent as BaseExposedPasswordsReportComponent } from "../../../tools/reports/pages/exposed-passwords-report.component";
Expand All @@ -36,7 +36,7 @@ export class ExposedPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormService: DefaultCipherFormConfigService,
cipherFormService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

// eslint-disable-next-line no-restricted-imports
import { InactiveTwoFactorReportComponent as BaseInactiveTwoFactorReportComponent } from "../../../tools/reports/pages/inactive-two-factor-report.component";
Expand All @@ -33,7 +33,7 @@ export class InactiveTwoFactorReportComponent
organizationService: OrganizationService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

// eslint-disable-next-line no-restricted-imports
import { ReusedPasswordsReportComponent as BaseReusedPasswordsReportComponent } from "../../../tools/reports/pages/reused-passwords-report.component";
Expand All @@ -34,7 +34,7 @@ export class ReusedPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

// eslint-disable-next-line no-restricted-imports
import { UnsecuredWebsitesReportComponent as BaseUnsecuredWebsitesReportComponent } from "../../../tools/reports/pages/unsecured-websites-report.component";
Expand All @@ -33,7 +33,7 @@ export class UnsecuredWebsitesReportComponent
i18nService: I18nService,
syncService: SyncService,
collectionService: CollectionService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

// eslint-disable-next-line no-restricted-imports
import { WeakPasswordsReportComponent as BaseWeakPasswordsReportComponent } from "../../../tools/reports/pages/weak-passwords-report.component";
Expand All @@ -36,7 +36,7 @@ export class WeakPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService, TableDataSource } from "@bitwarden/components";
import {
CipherFormConfig,
DefaultCipherFormConfigService,
CipherFormConfigService,
PasswordRepromptService,
} from "@bitwarden/vault";

Expand Down Expand Up @@ -56,7 +56,7 @@ export class CipherReportComponent implements OnDestroy {
protected organizationService: OrganizationService,
protected i18nService: I18nService,
private syncService: SyncService,
private cipherFormConfigService: DefaultCipherFormConfigService,
private cipherFormConfigService: CipherFormConfigService,
) {
this.organizations$ = this.organizationService.organizations$;
this.organizations$.pipe(takeUntil(this.destroyed$)).subscribe((orgs) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { ExposedPasswordsReportComponent } from "./exposed-passwords-report.component";
import { cipherData } from "./reports-ciphers.mock";
Expand All @@ -23,6 +23,7 @@ describe("ExposedPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;

beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
syncServiceMock = mock<SyncService>();
auditService = mock<AuditService>();
organizationService = mock<OrganizationService>();
Expand Down Expand Up @@ -61,8 +62,8 @@ describe("ExposedPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";

Expand All @@ -29,7 +29,7 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";
import { InactiveTwoFactorReportComponent } from "./inactive-two-factor-report.component";
Expand All @@ -23,6 +23,7 @@ describe("InactiveTwoFactorReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;

beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
Expand Down Expand Up @@ -60,8 +61,8 @@ describe("InactiveTwoFactorReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
{
provide: CipherReportComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";

Expand All @@ -32,7 +32,7 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { cipherData } from "./reports-ciphers.mock";
import { ReusedPasswordsReportComponent } from "./reused-passwords-report.component";
Expand All @@ -21,6 +21,7 @@ describe("ReusedPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;

beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
Expand Down Expand Up @@ -54,8 +55,8 @@ describe("ReusedPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";

Expand All @@ -28,7 +28,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { cipherData } from "./reports-ciphers.mock";
import { UnsecuredWebsitesReportComponent } from "./unsecured-websites-report.component";
Expand All @@ -23,6 +23,7 @@ describe("UnsecuredWebsitesReportComponent", () => {
let collectionService: MockProxy<CollectionService>;

beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
Expand Down Expand Up @@ -61,8 +62,8 @@ describe("UnsecuredWebsitesReportComponent", () => {
useValue: collectionService,
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";

Expand All @@ -27,7 +27,7 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
i18nService: I18nService,
syncService: SyncService,
private collectionService: CollectionService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/pass
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { cipherData } from "./reports-ciphers.mock";
import { WeakPasswordsReportComponent } from "./weak-passwords-report.component";
Expand All @@ -23,6 +23,7 @@ describe("WeakPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;

beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
syncServiceMock = mock<SyncService>();
passwordStrengthService = mock<PasswordStrengthServiceAbstraction>();
organizationService = mock<OrganizationService>();
Expand Down Expand Up @@ -61,8 +62,8 @@ describe("WeakPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { BadgeVariant, DialogService } from "@bitwarden/components";
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
import { CipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";

import { CipherReportComponent } from "./cipher-report.component";

Expand All @@ -35,7 +35,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,
Expand Down
9 changes: 7 additions & 2 deletions apps/web/src/app/tools/reports/reports.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";

import { DefaultCipherFormConfigService } from "@bitwarden/vault";
import { CipherFormConfigService, DefaultCipherFormConfigService } from "@bitwarden/vault";

import { HeaderModule } from "../../layouts/header/header.module";
import { SharedModule } from "../../shared";
Expand Down Expand Up @@ -39,6 +39,11 @@ import { ReportsSharedModule } from "./shared";
UnsecuredWebsitesReportComponent,
WeakPasswordsReportComponent,
],
providers: [DefaultCipherFormConfigService],
providers: [
{
provide: CipherFormConfigService,
useClass: DefaultCipherFormConfigService,
},
],
})
export class ReportsModule {}

0 comments on commit c698779

Please sign in to comment.