mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
fix(8560): refreshing reports pages displays empty pages (#8700)
This commit is contained in:
@@ -6,6 +6,7 @@ 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";
|
||||||
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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -29,6 +30,7 @@ export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportC
|
|||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
@@ -37,6 +39,7 @@ export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportC
|
|||||||
modalService,
|
modalService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
|
syncService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorRepor
|
|||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
@@ -34,6 +36,7 @@ export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorRepor
|
|||||||
logService,
|
logService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
|
syncService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -27,8 +28,16 @@ export class ReusedPasswordsReportComponent extends BaseReusedPasswordsReportCom
|
|||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, organizationService, modalService, passwordRepromptService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
organizationService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
@@ -24,8 +25,16 @@ export class UnsecuredWebsitesReportComponent extends BaseUnsecuredWebsitesRepor
|
|||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, organizationService, modalService, passwordRepromptService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
organizationService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/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";
|
||||||
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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -29,6 +30,7 @@ export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportCompone
|
|||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
cipherService,
|
cipherService,
|
||||||
@@ -37,6 +39,7 @@ export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportCompone
|
|||||||
modalService,
|
modalService,
|
||||||
passwordRepromptService,
|
passwordRepromptService,
|
||||||
i18nService,
|
i18nService,
|
||||||
|
syncService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/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 { 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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -40,6 +41,7 @@ export class CipherReportComponent implements OnDestroy {
|
|||||||
protected passwordRepromptService: PasswordRepromptService,
|
protected passwordRepromptService: PasswordRepromptService,
|
||||||
protected organizationService: OrganizationService,
|
protected organizationService: OrganizationService,
|
||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
|
private syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
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) => {
|
||||||
@@ -106,6 +108,7 @@ export class CipherReportComponent implements OnDestroy {
|
|||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
await this.syncService.fullSync(false);
|
||||||
// when a user fixes an item in a report we want to persist the filter they had
|
// when a user fixes an item in a report we want to persist the filter they had
|
||||||
// if they fix the last item of that filter we will go back to the "All" filter
|
// if they fix the last item of that filter we will go back to the "All" filter
|
||||||
if (this.currentFilterStatus) {
|
if (this.currentFilterStatus) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ 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";
|
||||||
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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { ExposedPasswordsReportComponent } from "./exposed-passwords-report.component";
|
import { ExposedPasswordsReportComponent } from "./exposed-passwords-report.component";
|
||||||
@@ -19,8 +20,10 @@ describe("ExposedPasswordsReportComponent", () => {
|
|||||||
let fixture: ComponentFixture<ExposedPasswordsReportComponent>;
|
let fixture: ComponentFixture<ExposedPasswordsReportComponent>;
|
||||||
let auditService: MockProxy<AuditService>;
|
let auditService: MockProxy<AuditService>;
|
||||||
let organizationService: MockProxy<OrganizationService>;
|
let organizationService: MockProxy<OrganizationService>;
|
||||||
|
let syncServiceMock: MockProxy<SyncService>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
syncServiceMock = mock<SyncService>();
|
||||||
auditService = mock<AuditService>();
|
auditService = mock<AuditService>();
|
||||||
organizationService = mock<OrganizationService>();
|
organizationService = mock<OrganizationService>();
|
||||||
organizationService.organizations$ = of([]);
|
organizationService.organizations$ = of([]);
|
||||||
@@ -49,6 +52,10 @@ describe("ExposedPasswordsReportComponent", () => {
|
|||||||
provide: PasswordRepromptService,
|
provide: PasswordRepromptService,
|
||||||
useValue: mock<PasswordRepromptService>(),
|
useValue: mock<PasswordRepromptService>(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: SyncService,
|
||||||
|
useValue: syncServiceMock,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
provide: I18nService,
|
provide: I18nService,
|
||||||
useValue: mock<I18nService>(),
|
useValue: mock<I18nService>(),
|
||||||
@@ -82,4 +89,8 @@ describe("ExposedPasswordsReportComponent", () => {
|
|||||||
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
||||||
expect(component.ciphers[1].edit).toEqual(true);
|
expect(component.ciphers[1].edit).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call fullSync method of syncService", () => {
|
||||||
|
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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";
|
||||||
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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -26,8 +27,16 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
|
|||||||
modalService: ModalService,
|
modalService: ModalService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
organizationService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { InactiveTwoFactorReportComponent } from "./inactive-two-factor-report.component";
|
import { InactiveTwoFactorReportComponent } from "./inactive-two-factor-report.component";
|
||||||
@@ -18,10 +19,12 @@ describe("InactiveTwoFactorReportComponent", () => {
|
|||||||
let component: InactiveTwoFactorReportComponent;
|
let component: InactiveTwoFactorReportComponent;
|
||||||
let fixture: ComponentFixture<InactiveTwoFactorReportComponent>;
|
let fixture: ComponentFixture<InactiveTwoFactorReportComponent>;
|
||||||
let organizationService: MockProxy<OrganizationService>;
|
let organizationService: MockProxy<OrganizationService>;
|
||||||
|
let syncServiceMock: MockProxy<SyncService>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
organizationService = mock<OrganizationService>();
|
organizationService = mock<OrganizationService>();
|
||||||
organizationService.organizations$ = of([]);
|
organizationService.organizations$ = of([]);
|
||||||
|
syncServiceMock = mock<SyncService>();
|
||||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -47,6 +50,10 @@ describe("InactiveTwoFactorReportComponent", () => {
|
|||||||
provide: PasswordRepromptService,
|
provide: PasswordRepromptService,
|
||||||
useValue: mock<PasswordRepromptService>(),
|
useValue: mock<PasswordRepromptService>(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: SyncService,
|
||||||
|
useValue: syncServiceMock,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
provide: I18nService,
|
provide: I18nService,
|
||||||
useValue: mock<I18nService>(),
|
useValue: mock<I18nService>(),
|
||||||
@@ -87,4 +94,8 @@ describe("InactiveTwoFactorReportComponent", () => {
|
|||||||
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
||||||
expect(component.ciphers[1].edit).toEqual(true);
|
expect(component.ciphers[1].edit).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call fullSync method of syncService", () => {
|
||||||
|
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
|
|||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -28,8 +29,16 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
|
|||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
organizationService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ 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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { cipherData } from "./reports-ciphers.mock";
|
import { cipherData } from "./reports-ciphers.mock";
|
||||||
@@ -17,10 +18,12 @@ describe("ReusedPasswordsReportComponent", () => {
|
|||||||
let component: ReusedPasswordsReportComponent;
|
let component: ReusedPasswordsReportComponent;
|
||||||
let fixture: ComponentFixture<ReusedPasswordsReportComponent>;
|
let fixture: ComponentFixture<ReusedPasswordsReportComponent>;
|
||||||
let organizationService: MockProxy<OrganizationService>;
|
let organizationService: MockProxy<OrganizationService>;
|
||||||
|
let syncServiceMock: MockProxy<SyncService>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
organizationService = mock<OrganizationService>();
|
organizationService = mock<OrganizationService>();
|
||||||
organizationService.organizations$ = of([]);
|
organizationService.organizations$ = of([]);
|
||||||
|
syncServiceMock = mock<SyncService>();
|
||||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -42,6 +45,10 @@ describe("ReusedPasswordsReportComponent", () => {
|
|||||||
provide: PasswordRepromptService,
|
provide: PasswordRepromptService,
|
||||||
useValue: mock<PasswordRepromptService>(),
|
useValue: mock<PasswordRepromptService>(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: SyncService,
|
||||||
|
useValue: syncServiceMock,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
provide: I18nService,
|
provide: I18nService,
|
||||||
useValue: mock<I18nService>(),
|
useValue: mock<I18nService>(),
|
||||||
@@ -73,4 +80,8 @@ describe("ReusedPasswordsReportComponent", () => {
|
|||||||
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
||||||
expect(component.ciphers[1].edit).toEqual(true);
|
expect(component.ciphers[1].edit).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call fullSync method of syncService", () => {
|
||||||
|
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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 { 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 { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
@@ -24,8 +25,16 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
|
|||||||
modalService: ModalService,
|
modalService: ModalService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
organizationService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ 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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { cipherData } from "./reports-ciphers.mock";
|
import { cipherData } from "./reports-ciphers.mock";
|
||||||
@@ -17,10 +18,12 @@ describe("UnsecuredWebsitesReportComponent", () => {
|
|||||||
let component: UnsecuredWebsitesReportComponent;
|
let component: UnsecuredWebsitesReportComponent;
|
||||||
let fixture: ComponentFixture<UnsecuredWebsitesReportComponent>;
|
let fixture: ComponentFixture<UnsecuredWebsitesReportComponent>;
|
||||||
let organizationService: MockProxy<OrganizationService>;
|
let organizationService: MockProxy<OrganizationService>;
|
||||||
|
let syncServiceMock: MockProxy<SyncService>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
organizationService = mock<OrganizationService>();
|
organizationService = mock<OrganizationService>();
|
||||||
organizationService.organizations$ = of([]);
|
organizationService.organizations$ = of([]);
|
||||||
|
syncServiceMock = mock<SyncService>();
|
||||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -42,6 +45,10 @@ describe("UnsecuredWebsitesReportComponent", () => {
|
|||||||
provide: PasswordRepromptService,
|
provide: PasswordRepromptService,
|
||||||
useValue: mock<PasswordRepromptService>(),
|
useValue: mock<PasswordRepromptService>(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: SyncService,
|
||||||
|
useValue: syncServiceMock,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
provide: I18nService,
|
provide: I18nService,
|
||||||
useValue: mock<I18nService>(),
|
useValue: mock<I18nService>(),
|
||||||
@@ -73,4 +80,8 @@ describe("UnsecuredWebsitesReportComponent", () => {
|
|||||||
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
||||||
expect(component.ciphers[1].edit).toEqual(true);
|
expect(component.ciphers[1].edit).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call fullSync method of syncService", () => {
|
||||||
|
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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 { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
@@ -22,8 +23,16 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
|
|||||||
modalService: ModalService,
|
modalService: ModalService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
organizationService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/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";
|
||||||
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 { PasswordRepromptService } from "@bitwarden/vault";
|
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||||
|
|
||||||
import { cipherData } from "./reports-ciphers.mock";
|
import { cipherData } from "./reports-ciphers.mock";
|
||||||
@@ -19,8 +20,10 @@ describe("WeakPasswordsReportComponent", () => {
|
|||||||
let fixture: ComponentFixture<WeakPasswordsReportComponent>;
|
let fixture: ComponentFixture<WeakPasswordsReportComponent>;
|
||||||
let passwordStrengthService: MockProxy<PasswordStrengthServiceAbstraction>;
|
let passwordStrengthService: MockProxy<PasswordStrengthServiceAbstraction>;
|
||||||
let organizationService: MockProxy<OrganizationService>;
|
let organizationService: MockProxy<OrganizationService>;
|
||||||
|
let syncServiceMock: MockProxy<SyncService>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
syncServiceMock = mock<SyncService>();
|
||||||
passwordStrengthService = mock<PasswordStrengthServiceAbstraction>();
|
passwordStrengthService = mock<PasswordStrengthServiceAbstraction>();
|
||||||
organizationService = mock<OrganizationService>();
|
organizationService = mock<OrganizationService>();
|
||||||
organizationService.organizations$ = of([]);
|
organizationService.organizations$ = of([]);
|
||||||
@@ -49,6 +52,10 @@ describe("WeakPasswordsReportComponent", () => {
|
|||||||
provide: PasswordRepromptService,
|
provide: PasswordRepromptService,
|
||||||
useValue: mock<PasswordRepromptService>(),
|
useValue: mock<PasswordRepromptService>(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: SyncService,
|
||||||
|
useValue: syncServiceMock,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
provide: I18nService,
|
provide: I18nService,
|
||||||
useValue: mock<I18nService>(),
|
useValue: mock<I18nService>(),
|
||||||
@@ -85,4 +92,8 @@ describe("WeakPasswordsReportComponent", () => {
|
|||||||
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
|
||||||
expect(component.ciphers[1].edit).toEqual(true);
|
expect(component.ciphers[1].edit).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call fullSync method of syncService", () => {
|
||||||
|
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
|
|||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
||||||
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 { 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 } from "@bitwarden/components";
|
||||||
@@ -31,8 +32,16 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
modalService: ModalService,
|
modalService: ModalService,
|
||||||
passwordRepromptService: PasswordRepromptService,
|
passwordRepromptService: PasswordRepromptService,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
|
syncService: SyncService,
|
||||||
) {
|
) {
|
||||||
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
|
super(
|
||||||
|
cipherService,
|
||||||
|
modalService,
|
||||||
|
passwordRepromptService,
|
||||||
|
organizationService,
|
||||||
|
i18nService,
|
||||||
|
syncService,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user