1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Merge branch 'main' into autofill/pm-5189-fix-issues-present-with-inline-menu-rendering-in-iframes

This commit is contained in:
Cesar Gonzalez
2024-05-03 10:14:28 -05:00
18 changed files with 143 additions and 13 deletions

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -29,6 +30,7 @@ export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportC
private route: ActivatedRoute,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(
cipherService,
@@ -37,6 +39,7 @@ export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportC
modalService,
passwordRepromptService,
i18nService,
syncService,
);
}

View File

@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -26,6 +27,7 @@ export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorRepor
passwordRepromptService: PasswordRepromptService,
organizationService: OrganizationService,
i18nService: I18nService,
syncService: SyncService,
) {
super(
cipherService,
@@ -34,6 +36,7 @@ export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorRepor
logService,
passwordRepromptService,
i18nService,
syncService,
);
}

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -27,8 +28,16 @@ export class ReusedPasswordsReportComponent extends BaseReusedPasswordsReportCom
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, organizationService, modalService, passwordRepromptService, i18nService);
super(
cipherService,
organizationService,
modalService,
passwordRepromptService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { PasswordRepromptService } from "@bitwarden/vault";
@@ -24,8 +25,16 @@ export class UnsecuredWebsitesReportComponent extends BaseUnsecuredWebsitesRepor
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, organizationService, modalService, passwordRepromptService, i18nService);
super(
cipherService,
organizationService,
modalService,
passwordRepromptService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -29,6 +30,7 @@ export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportCompone
organizationService: OrganizationService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(
cipherService,
@@ -37,6 +39,7 @@ export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportCompone
modalService,
passwordRepromptService,
i18nService,
syncService,
);
}

View File

@@ -6,6 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -40,6 +41,7 @@ export class CipherReportComponent implements OnDestroy {
protected passwordRepromptService: PasswordRepromptService,
protected organizationService: OrganizationService,
protected i18nService: I18nService,
private syncService: SyncService,
) {
this.organizations$ = this.organizationService.organizations$;
this.organizations$.pipe(takeUntil(this.destroyed$)).subscribe((orgs) => {
@@ -106,6 +108,7 @@ export class CipherReportComponent implements OnDestroy {
async load() {
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
// if they fix the last item of that filter we will go back to the "All" filter
if (this.currentFilterStatus) {

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { ExposedPasswordsReportComponent } from "./exposed-passwords-report.component";
@@ -19,8 +20,10 @@ describe("ExposedPasswordsReportComponent", () => {
let fixture: ComponentFixture<ExposedPasswordsReportComponent>;
let auditService: MockProxy<AuditService>;
let organizationService: MockProxy<OrganizationService>;
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
syncServiceMock = mock<SyncService>();
auditService = mock<AuditService>();
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
@@ -49,6 +52,10 @@ describe("ExposedPasswordsReportComponent", () => {
provide: PasswordRepromptService,
useValue: mock<PasswordRepromptService>(),
},
{
provide: SyncService,
useValue: syncServiceMock,
},
{
provide: I18nService,
useValue: mock<I18nService>(),
@@ -82,4 +89,8 @@ describe("ExposedPasswordsReportComponent", () => {
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
expect(component.ciphers[1].edit).toEqual(true);
});
it("should call fullSync method of syncService", () => {
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
});
});

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -26,8 +27,16 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
modalService: ModalService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
super(
cipherService,
modalService,
passwordRepromptService,
organizationService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -9,6 +9,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
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 { PasswordRepromptService } from "@bitwarden/vault";
import { InactiveTwoFactorReportComponent } from "./inactive-two-factor-report.component";
@@ -18,10 +19,12 @@ describe("InactiveTwoFactorReportComponent", () => {
let component: InactiveTwoFactorReportComponent;
let fixture: ComponentFixture<InactiveTwoFactorReportComponent>;
let organizationService: MockProxy<OrganizationService>;
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
organizationService = mock<OrganizationService>();
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.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
TestBed.configureTestingModule({
@@ -47,6 +50,10 @@ describe("InactiveTwoFactorReportComponent", () => {
provide: PasswordRepromptService,
useValue: mock<PasswordRepromptService>(),
},
{
provide: SyncService,
useValue: syncServiceMock,
},
{
provide: I18nService,
useValue: mock<I18nService>(),
@@ -87,4 +94,8 @@ describe("InactiveTwoFactorReportComponent", () => {
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
expect(component.ciphers[1].edit).toEqual(true);
});
it("should call fullSync method of syncService", () => {
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
});
});

View File

@@ -6,6 +6,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -28,8 +29,16 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
private logService: LogService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
super(
cipherService,
modalService,
passwordRepromptService,
organizationService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { cipherData } from "./reports-ciphers.mock";
@@ -17,10 +18,12 @@ describe("ReusedPasswordsReportComponent", () => {
let component: ReusedPasswordsReportComponent;
let fixture: ComponentFixture<ReusedPasswordsReportComponent>;
let organizationService: MockProxy<OrganizationService>;
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
organizationService = mock<OrganizationService>();
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.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
TestBed.configureTestingModule({
@@ -42,6 +45,10 @@ describe("ReusedPasswordsReportComponent", () => {
provide: PasswordRepromptService,
useValue: mock<PasswordRepromptService>(),
},
{
provide: SyncService,
useValue: syncServiceMock,
},
{
provide: I18nService,
useValue: mock<I18nService>(),
@@ -73,4 +80,8 @@ describe("ReusedPasswordsReportComponent", () => {
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
expect(component.ciphers[1].edit).toEqual(true);
});
it("should call fullSync method of syncService", () => {
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
});
});

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { PasswordRepromptService } from "@bitwarden/vault";
@@ -24,8 +25,16 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
modalService: ModalService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
super(
cipherService,
modalService,
passwordRepromptService,
organizationService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { cipherData } from "./reports-ciphers.mock";
@@ -17,10 +18,12 @@ describe("UnsecuredWebsitesReportComponent", () => {
let component: UnsecuredWebsitesReportComponent;
let fixture: ComponentFixture<UnsecuredWebsitesReportComponent>;
let organizationService: MockProxy<OrganizationService>;
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
organizationService = mock<OrganizationService>();
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.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
TestBed.configureTestingModule({
@@ -42,6 +45,10 @@ describe("UnsecuredWebsitesReportComponent", () => {
provide: PasswordRepromptService,
useValue: mock<PasswordRepromptService>(),
},
{
provide: SyncService,
useValue: syncServiceMock,
},
{
provide: I18nService,
useValue: mock<I18nService>(),
@@ -73,4 +80,8 @@ describe("UnsecuredWebsitesReportComponent", () => {
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
expect(component.ciphers[1].edit).toEqual(true);
});
it("should call fullSync method of syncService", () => {
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
});
});

View File

@@ -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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.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 { PasswordRepromptService } from "@bitwarden/vault";
@@ -22,8 +23,16 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
modalService: ModalService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
super(
cipherService,
modalService,
passwordRepromptService,
organizationService,
i18nService,
syncService,
);
}
async ngOnInit() {

View File

@@ -9,6 +9,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
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 { cipherData } from "./reports-ciphers.mock";
@@ -19,8 +20,10 @@ describe("WeakPasswordsReportComponent", () => {
let fixture: ComponentFixture<WeakPasswordsReportComponent>;
let passwordStrengthService: MockProxy<PasswordStrengthServiceAbstraction>;
let organizationService: MockProxy<OrganizationService>;
let syncServiceMock: MockProxy<SyncService>;
beforeEach(() => {
syncServiceMock = mock<SyncService>();
passwordStrengthService = mock<PasswordStrengthServiceAbstraction>();
organizationService = mock<OrganizationService>();
organizationService.organizations$ = of([]);
@@ -49,6 +52,10 @@ describe("WeakPasswordsReportComponent", () => {
provide: PasswordRepromptService,
useValue: mock<PasswordRepromptService>(),
},
{
provide: SyncService,
useValue: syncServiceMock,
},
{
provide: I18nService,
useValue: mock<I18nService>(),
@@ -85,4 +92,8 @@ describe("WeakPasswordsReportComponent", () => {
expect(component.ciphers[1].id).toEqual(expectedIdTwo);
expect(component.ciphers[1].edit).toEqual(true);
});
it("should call fullSync method of syncService", () => {
expect(syncServiceMock.fullSync).toHaveBeenCalledWith(false);
});
});

View File

@@ -6,6 +6,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { BadgeVariant } from "@bitwarden/components";
@@ -31,8 +32,16 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
modalService: ModalService,
passwordRepromptService: PasswordRepromptService,
i18nService: I18nService,
syncService: SyncService,
) {
super(cipherService, modalService, passwordRepromptService, organizationService, i18nService);
super(
cipherService,
modalService,
passwordRepromptService,
organizationService,
i18nService,
syncService,
);
}
async ngOnInit() {

10
package-lock.json generated
View File

@@ -172,7 +172,7 @@
"sass-loader": "13.3.3",
"storybook": "7.6.17",
"style-loader": "3.3.4",
"tailwindcss": "3.4.1",
"tailwindcss": "3.4.3",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"tsconfig-paths-webpack-plugin": "4.1.0",
@@ -35401,9 +35401,9 @@
"dev": true
},
"node_modules/tailwindcss": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz",
"integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz",
"integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==",
"dev": true,
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
@@ -35414,7 +35414,7 @@
"fast-glob": "^3.3.0",
"glob-parent": "^6.0.2",
"is-glob": "^4.0.3",
"jiti": "^1.19.1",
"jiti": "^1.21.0",
"lilconfig": "^2.1.0",
"micromatch": "^4.0.5",
"normalize-path": "^3.0.0",

View File

@@ -133,7 +133,7 @@
"sass-loader": "13.3.3",
"storybook": "7.6.17",
"style-loader": "3.3.4",
"tailwindcss": "3.4.1",
"tailwindcss": "3.4.3",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"tsconfig-paths-webpack-plugin": "4.1.0",