1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-02 18:17:46 +01:00

suggested changes

This commit is contained in:
--global 2024-12-20 21:46:41 -05:00
parent 72cc46bf8a
commit c698779511
17 changed files with 49 additions and 39 deletions

View File

@ -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";
@ -36,7 +36,7 @@ export class ExposedPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormService: DefaultCipherFormConfigService,
cipherFormService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -33,7 +33,7 @@ export class InactiveTwoFactorReportComponent
organizationService: OrganizationService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -34,7 +34,7 @@ export class ReusedPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -33,7 +33,7 @@ export class UnsecuredWebsitesReportComponent
i18nService: I18nService,
syncService: SyncService,
collectionService: CollectionService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -36,7 +36,7 @@ export class WeakPasswordsReportComponent
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -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) => {

View File

@ -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";
@ -23,6 +23,7 @@ describe("ExposedPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
syncServiceMock = mock<SyncService>();
auditService = mock<AuditService>();
organizationService = mock<OrganizationService>();
@ -61,8 +62,8 @@ describe("ExposedPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],

View File

@ -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";
@ -29,7 +29,7 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -23,6 +23,7 @@ describe("InactiveTwoFactorReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
@ -60,8 +61,8 @@ describe("InactiveTwoFactorReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
{
provide: CipherReportComponent,

View File

@ -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";
@ -32,7 +32,7 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -21,6 +21,7 @@ describe("ReusedPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
@ -54,8 +55,8 @@ describe("ReusedPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],

View File

@ -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";
@ -28,7 +28,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -23,6 +23,7 @@ describe("UnsecuredWebsitesReportComponent", () => {
let collectionService: MockProxy<CollectionService>;
beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
syncServiceMock = mock<SyncService>();
@ -61,8 +62,8 @@ describe("UnsecuredWebsitesReportComponent", () => {
useValue: collectionService,
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],

View File

@ -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";
@ -27,7 +27,7 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
i18nService: I18nService,
syncService: SyncService,
private collectionService: CollectionService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -23,6 +23,7 @@ describe("WeakPasswordsReportComponent", () => {
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
let cipherFormConfigServiceMock: MockProxy<CipherFormConfigService>;
syncServiceMock = mock<SyncService>();
passwordStrengthService = mock<PasswordStrengthServiceAbstraction>();
organizationService = mock<OrganizationService>();
@ -61,8 +62,8 @@ describe("WeakPasswordsReportComponent", () => {
useValue: mock<I18nService>(),
},
{
provide: DefaultCipherFormConfigService,
useValue: mock<DefaultCipherFormConfigService>(),
provide: CipherFormConfigService,
useValue: cipherFormConfigServiceMock,
},
],
schemas: [],

View File

@ -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";
@ -35,7 +35,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
cipherFormConfigService: DefaultCipherFormConfigService,
cipherFormConfigService: CipherFormConfigService,
) {
super(
cipherService,

View File

@ -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";
@ -39,6 +39,11 @@ import { ReportsSharedModule } from "./shared";
UnsecuredWebsitesReportComponent,
WeakPasswordsReportComponent,
],
providers: [DefaultCipherFormConfigService],
providers: [
{
provide: CipherFormConfigService,
useClass: DefaultCipherFormConfigService,
},
],
})
export class ReportsModule {}