mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Updating reports to use new modal for view/edit cipher
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
@@ -9,7 +8,8 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
|||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { PasswordRepromptService, DefaultCipherFormConfigService } from "@bitwarden/vault";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { ExposedPasswordsReportComponent as BaseExposedPasswordsReportComponent } from "../../../tools/reports/pages/exposed-passwords-report.component";
|
import { ExposedPasswordsReportComponent as BaseExposedPasswordsReportComponent } from "../../../tools/reports/pages/exposed-passwords-report.component";
|
||||||
@@ -28,21 +28,23 @@ export class ExposedPasswordsReportComponent
|
|||||||
constructor(
|
constructor(
|
||||||
cipherService: CipherService,
|
cipherService: CipherService,
|
||||||
auditService: AuditService,
|
auditService: AuditService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
auditService,
|
auditService,
|
||||||
organizationService,
|
organizationService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { InactiveTwoFactorReportComponent as BaseInactiveTwoFactorReportComponent } from "../../../tools/reports/pages/inactive-two-factor-report.component";
|
import { InactiveTwoFactorReportComponent as BaseInactiveTwoFactorReportComponent } from "../../../tools/reports/pages/inactive-two-factor-report.component";
|
||||||
@@ -24,22 +24,24 @@ export class InactiveTwoFactorReportComponent
|
|||||||
{
|
{
|
||||||
constructor(
|
constructor(
|
||||||
cipherService: CipherService,
|
cipherService: CipherService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
logService: LogService,
|
logService: LogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
organizationService,
|
organizationService,
|
||||||
modalService,
|
dialogService,
|
||||||
logService,
|
logService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { ReusedPasswordsReportComponent as BaseReusedPasswordsReportComponent } from "../../../tools/reports/pages/reused-passwords-report.component";
|
import { ReusedPasswordsReportComponent as BaseReusedPasswordsReportComponent } from "../../../tools/reports/pages/reused-passwords-report.component";
|
||||||
@@ -26,20 +26,22 @@ export class ReusedPasswordsReportComponent
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
cipherService: CipherService,
|
cipherService: CipherService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
organizationService,
|
organizationService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import { Component, OnInit } from "@angular/core";
|
|||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { CollectionService } from "@bitwarden/admin-console/common";
|
import { CollectionService } from "@bitwarden/admin-console/common";
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { UnsecuredWebsitesReportComponent as BaseUnsecuredWebsitesReportComponent } from "../../../tools/reports/pages/unsecured-websites-report.component";
|
import { UnsecuredWebsitesReportComponent as BaseUnsecuredWebsitesReportComponent } from "../../../tools/reports/pages/unsecured-websites-report.component";
|
||||||
@@ -24,22 +24,24 @@ export class UnsecuredWebsitesReportComponent
|
|||||||
{
|
{
|
||||||
constructor(
|
constructor(
|
||||||
cipherService: CipherService,
|
cipherService: CipherService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
collectionService: CollectionService,
|
collectionService: CollectionService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
organizationService,
|
organizationService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
collectionService,
|
collectionService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
||||||
@@ -9,7 +8,8 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
|||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { WeakPasswordsReportComponent as BaseWeakPasswordsReportComponent } from "../../../tools/reports/pages/weak-passwords-report.component";
|
import { WeakPasswordsReportComponent as BaseWeakPasswordsReportComponent } from "../../../tools/reports/pages/weak-passwords-report.component";
|
||||||
@@ -28,21 +28,23 @@ export class WeakPasswordsReportComponent
|
|||||||
constructor(
|
constructor(
|
||||||
cipherService: CipherService,
|
cipherService: CipherService,
|
||||||
passwordStrengthService: PasswordStrengthServiceAbstraction,
|
passwordStrengthService: PasswordStrengthServiceAbstraction,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
passwordStrengthService,
|
passwordStrengthService,
|
||||||
organizationService,
|
organizationService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
VaultTimeoutInputComponent,
|
VaultTimeoutInputComponent,
|
||||||
} from "@bitwarden/auth/angular";
|
} from "@bitwarden/auth/angular";
|
||||||
import { LayoutComponent, NavigationModule } from "@bitwarden/components";
|
import { LayoutComponent, NavigationModule } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { OrganizationLayoutComponent } from "../admin-console/organizations/layouts/organization-layout.component";
|
import { OrganizationLayoutComponent } from "../admin-console/organizations/layouts/organization-layout.component";
|
||||||
import { EventsComponent as OrgEventsComponent } from "../admin-console/organizations/manage/events.component";
|
import { EventsComponent as OrgEventsComponent } from "../admin-console/organizations/manage/events.component";
|
||||||
@@ -244,5 +245,6 @@ import { SharedModule } from "./shared.module";
|
|||||||
HeaderModule,
|
HeaderModule,
|
||||||
DangerZoneComponent,
|
DangerZoneComponent,
|
||||||
],
|
],
|
||||||
|
providers: [DefaultCipherFormConfigService],
|
||||||
})
|
})
|
||||||
export class LooseComponentsModule {}
|
export class LooseComponentsModule {}
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
|
import { DialogRef } from "@angular/cdk/dialog";
|
||||||
import { Directive, ViewChild, ViewContainerRef, OnDestroy } from "@angular/core";
|
import { Directive, ViewChild, ViewContainerRef, OnDestroy } from "@angular/core";
|
||||||
import { BehaviorSubject, Observable, Subject, takeUntil } from "rxjs";
|
import { BehaviorSubject, lastValueFrom, Observable, Subject, takeUntil } from "rxjs";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { OrganizationId } from "@bitwarden/common/types/guid";
|
import { CipherId, CollectionId, OrganizationId } from "@bitwarden/common/types/guid";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type";
|
import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { TableDataSource } from "@bitwarden/components";
|
import { DialogService, TableDataSource } from "@bitwarden/components";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import {
|
||||||
|
CipherFormConfig,
|
||||||
|
DefaultCipherFormConfigService,
|
||||||
|
PasswordRepromptService,
|
||||||
|
} from "@bitwarden/vault";
|
||||||
|
|
||||||
import { AddEditComponent } from "../../../vault/individual-vault/add-edit.component";
|
import {
|
||||||
import { AddEditComponent as OrgAddEditComponent } from "../../../vault/org-vault/add-edit.component";
|
VaultItemDialogComponent,
|
||||||
|
VaultItemDialogMode,
|
||||||
|
VaultItemDialogResult,
|
||||||
|
} from "../../../vault/components/vault-item-dialog/vault-item-dialog.component";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class CipherReportComponent implements OnDestroy {
|
export class CipherReportComponent implements OnDestroy {
|
||||||
@@ -37,14 +44,16 @@ export class CipherReportComponent implements OnDestroy {
|
|||||||
currentFilterStatus: number | string;
|
currentFilterStatus: number | string;
|
||||||
protected filterOrgStatus$ = new BehaviorSubject<number | string>(0);
|
protected filterOrgStatus$ = new BehaviorSubject<number | string>(0);
|
||||||
private destroyed$: Subject<void> = new Subject();
|
private destroyed$: Subject<void> = new Subject();
|
||||||
|
private vaultItemDialogRef?: DialogRef<VaultItemDialogResult> | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
private modalService: ModalService,
|
private dialogService: DialogService,
|
||||||
protected passwordRepromptService: PasswordRepromptService,
|
protected passwordRepromptService: PasswordRepromptService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
private syncService: SyncService,
|
private syncService: SyncService,
|
||||||
|
private cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
this.organizations$ = this.organizationService.organizations$;
|
this.organizations$ = this.organizationService.organizations$;
|
||||||
this.organizations$.pipe(takeUntil(this.destroyed$)).subscribe((orgs) => {
|
this.organizations$.pipe(takeUntil(this.destroyed$)).subscribe((orgs) => {
|
||||||
@@ -125,43 +134,46 @@ export class CipherReportComponent implements OnDestroy {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.hasLoaded = true;
|
this.hasLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectCipher(cipher: CipherView) {
|
async selectCipher(cipher: CipherView) {
|
||||||
if (!(await this.repromptCipher(cipher))) {
|
const cipherFormConfig = await this.cipherFormConfigService.buildConfig(
|
||||||
|
"edit",
|
||||||
|
cipher.id as CipherId,
|
||||||
|
cipher.type,
|
||||||
|
);
|
||||||
|
|
||||||
|
await this.openVaultItemDialog("view", cipherFormConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the combined view / edit dialog for a cipher.
|
||||||
|
* @param mode - Starting mode of the dialog.
|
||||||
|
* @param formConfig - Configuration for the form when editing/adding a cipher.
|
||||||
|
* @param activeCollectionId - The active collection ID.
|
||||||
|
*/
|
||||||
|
async openVaultItemDialog(
|
||||||
|
mode: VaultItemDialogMode,
|
||||||
|
formConfig: CipherFormConfig,
|
||||||
|
activeCollectionId?: CollectionId,
|
||||||
|
) {
|
||||||
|
this.vaultItemDialogRef = VaultItemDialogComponent.open(this.dialogService, {
|
||||||
|
mode,
|
||||||
|
formConfig,
|
||||||
|
activeCollectionId,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await lastValueFrom(this.vaultItemDialogRef.closed);
|
||||||
|
this.vaultItemDialogRef = undefined;
|
||||||
|
|
||||||
|
// When the dialog is closed for a premium upgrade, return early as the user
|
||||||
|
// should be navigated to the subscription settings elsewhere
|
||||||
|
if (result === VaultItemDialogResult.PremiumUpgrade) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const type = this.organization != null ? OrgAddEditComponent : AddEditComponent;
|
// If the dialog was closed by deleting the cipher, refresh the report.
|
||||||
|
if (result === VaultItemDialogResult.Deleted || result === VaultItemDialogResult.Saved) {
|
||||||
const [modal, childComponent] = await this.modalService.openViewRef(
|
await this.load();
|
||||||
type,
|
}
|
||||||
this.cipherAddEditModalRef,
|
|
||||||
(comp: OrgAddEditComponent | AddEditComponent) => {
|
|
||||||
if (this.organization != null) {
|
|
||||||
(comp as OrgAddEditComponent).organization = this.organization;
|
|
||||||
comp.organizationId = this.organization.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
comp.cipherId = cipher == null ? null : cipher.id;
|
|
||||||
// eslint-disable-next-line rxjs/no-async-subscribe
|
|
||||||
comp.onSavedCipher.subscribe(async () => {
|
|
||||||
modal.close();
|
|
||||||
await this.load();
|
|
||||||
});
|
|
||||||
// eslint-disable-next-line rxjs/no-async-subscribe
|
|
||||||
comp.onDeletedCipher.subscribe(async () => {
|
|
||||||
modal.close();
|
|
||||||
await this.load();
|
|
||||||
});
|
|
||||||
// eslint-disable-next-line rxjs/no-async-subscribe
|
|
||||||
comp.onRestoredCipher.subscribe(async () => {
|
|
||||||
modal.close();
|
|
||||||
await this.load();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
return childComponent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async setCiphers() {
|
protected async setCiphers() {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
@@ -8,7 +7,8 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
|||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { CipherReportComponent } from "./cipher-report.component";
|
import { CipherReportComponent } from "./cipher-report.component";
|
||||||
|
|
||||||
@@ -25,18 +25,20 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
|
|||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
protected auditService: AuditService,
|
protected auditService: AuditService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
organizationService,
|
organizationService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
@@ -9,7 +8,8 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
|||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { CipherReportComponent } from "./cipher-report.component";
|
import { CipherReportComponent } from "./cipher-report.component";
|
||||||
|
|
||||||
@@ -25,19 +25,21 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
|
|||||||
constructor(
|
constructor(
|
||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
organizationService,
|
organizationService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { CipherReportComponent } from "./cipher-report.component";
|
import { CipherReportComponent } from "./cipher-report.component";
|
||||||
|
|
||||||
@@ -22,18 +22,20 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
|
|||||||
constructor(
|
constructor(
|
||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
organizationService,
|
organizationService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { CollectionService, Collection } from "@bitwarden/admin-console/common";
|
import { CollectionService, Collection } from "@bitwarden/admin-console/common";
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { CipherReportComponent } from "./cipher-report.component";
|
import { CipherReportComponent } from "./cipher-report.component";
|
||||||
|
|
||||||
@@ -22,19 +22,21 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
|
|||||||
constructor(
|
constructor(
|
||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
private collectionService: CollectionService,
|
private collectionService: CollectionService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
organizationService,
|
organizationService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
@@ -9,8 +8,8 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
|||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import { BadgeVariant } from "@bitwarden/components";
|
import { BadgeVariant, DialogService } from "@bitwarden/components";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { DefaultCipherFormConfigService, PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { CipherReportComponent } from "./cipher-report.component";
|
import { CipherReportComponent } from "./cipher-report.component";
|
||||||
|
|
||||||
@@ -30,18 +29,20 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
protected passwordStrengthService: PasswordStrengthServiceAbstraction,
|
protected passwordStrengthService: PasswordStrengthServiceAbstraction,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
modalService: ModalService,
|
dialogService: DialogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
syncService: SyncService,
|
syncService: SyncService,
|
||||||
|
cipherFormConfigService: DefaultCipherFormConfigService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
modalService,
|
dialogService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
organizationService,
|
organizationService,
|
||||||
i18nService,
|
i18nService,
|
||||||
syncService,
|
syncService,
|
||||||
|
cipherFormConfigService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user