diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index d20a914249..2ba44c1e4a 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -34,12 +34,12 @@ import { SyncComponent } from "./settings/sync.component"; import { TabsComponent } from "./tabs.component"; import { AddEditComponent } from "./vault/add-edit.component"; import { AttachmentsComponent } from "./vault/attachments.component"; -import { CiphersComponent } from "./vault/ciphers.component"; import { CollectionsComponent } from "./vault/collections.component"; import { CurrentTabComponent } from "./vault/current-tab.component"; import { PasswordHistoryComponent } from "./vault/password-history.component"; import { ShareComponent } from "./vault/share.component"; import { VaultFilterComponent } from "./vault/vault-filter.component"; +import { VaultItemsComponent } from "./vault/vault-items.component"; import { ViewComponent } from "./vault/view.component"; const routes: Routes = [ @@ -120,7 +120,7 @@ const routes: Routes = [ }, { path: "ciphers", - component: CiphersComponent, + component: VaultItemsComponent, canActivate: [AuthGuard], data: { state: "ciphers" }, }, diff --git a/apps/browser/src/popup/app.component.ts b/apps/browser/src/popup/app.component.ts index f1a69a6d6f..ec094cbe94 100644 --- a/apps/browser/src/popup/app.component.ts +++ b/apps/browser/src/popup/app.component.ts @@ -276,7 +276,7 @@ export class AppComponent implements OnInit, OnDestroy { await Promise.all([ this.stateService.setBrowserGroupingComponentState(null), - this.stateService.setBrowserCipherComponentState(null), + this.stateService.setBrowserVaultItemsComponentState(null), this.stateService.setBrowserSendComponentState(null), this.stateService.setBrowserSendTypeComponentState(null), ]); diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index 473ffb33a9..3f73b5881e 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -108,12 +108,12 @@ import { TabsComponent } from "./tabs.component"; import { AddEditCustomFieldsComponent } from "./vault/add-edit-custom-fields.component"; import { AddEditComponent } from "./vault/add-edit.component"; import { AttachmentsComponent } from "./vault/attachments.component"; -import { CiphersComponent } from "./vault/ciphers.component"; import { CollectionsComponent } from "./vault/collections.component"; import { CurrentTabComponent } from "./vault/current-tab.component"; import { PasswordHistoryComponent } from "./vault/password-history.component"; import { ShareComponent } from "./vault/share.component"; import { VaultFilterComponent } from "./vault/vault-filter.component"; +import { VaultItemsComponent } from "./vault/vault-items.component"; import { VaultSelectComponent } from "./vault/vault-select.component"; import { ViewCustomFieldsComponent } from "./vault/view-custom-fields.component"; import { ViewComponent } from "./vault/view.component"; @@ -200,7 +200,7 @@ registerLocaleData(localeZhTw, "zh-TW"); AppComponent, AttachmentsComponent, CipherRowComponent, - CiphersComponent, + VaultItemsComponent, CollectionsComponent, CurrentTabComponent, EnvironmentComponent, diff --git a/apps/browser/src/popup/vault/vault-filter.component.ts b/apps/browser/src/popup/vault/vault-filter.component.ts index 6ae6f9b88d..f8a6f14081 100644 --- a/apps/browser/src/popup/vault/vault-filter.component.ts +++ b/apps/browser/src/popup/vault/vault-filter.component.ts @@ -94,7 +94,7 @@ export class VaultFilterComponent implements OnInit, OnDestroy { this.showLeftHeader = !( this.popupUtils.inSidebar(window) && this.platformUtilsService.isFirefox() ); - await this.browserStateService.setBrowserCipherComponentState(null); + await this.browserStateService.setBrowserVaultItemsComponentState(null); this.broadcasterService.subscribe(ComponentId, (message: any) => { this.ngZone.run(async () => { diff --git a/apps/browser/src/popup/vault/ciphers.component.html b/apps/browser/src/popup/vault/vault-items.component.html similarity index 100% rename from apps/browser/src/popup/vault/ciphers.component.html rename to apps/browser/src/popup/vault/vault-items.component.html diff --git a/apps/browser/src/popup/vault/ciphers.component.ts b/apps/browser/src/popup/vault/vault-items.component.ts similarity index 94% rename from apps/browser/src/popup/vault/ciphers.component.ts rename to apps/browser/src/popup/vault/vault-items.component.ts index 2366a55d5b..232a29ea41 100644 --- a/apps/browser/src/popup/vault/ciphers.component.ts +++ b/apps/browser/src/popup/vault/vault-items.component.ts @@ -3,7 +3,7 @@ import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from "@angula import { ActivatedRoute, Router } from "@angular/router"; import { first } from "rxjs/operators"; -import { CiphersComponent as BaseCiphersComponent } from "@bitwarden/angular/components/ciphers.component"; +import { VaultItemsComponent as BaseVaultItemsComponent } from "@bitwarden/angular/components/vault-items.component"; import { VaultFilter } from "@bitwarden/angular/vault/vault-filter/models/vault-filter.model"; import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.service"; import { CipherService } from "@bitwarden/common/abstractions/cipher.service"; @@ -25,13 +25,13 @@ import { StateService } from "../../services/abstractions/state.service"; import { VaultFilterService } from "../../services/vaultFilter.service"; import { PopupUtilsService } from "../services/popup-utils.service"; -const ComponentId = "CiphersComponent"; +const ComponentId = "VaultItemsComponent"; @Component({ - selector: "app-vault-ciphers", - templateUrl: "ciphers.component.html", + selector: "app-vault-items", + templateUrl: "vault-items.component.html", }) -export class CiphersComponent extends BaseCiphersComponent implements OnInit, OnDestroy { +export class VaultItemsComponent extends BaseVaultItemsComponent implements OnInit, OnDestroy { groupingTitle: string; state: BrowserComponentState; folderId: string = null; @@ -82,7 +82,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe this.route.queryParams.pipe(first()).subscribe(async (params) => { if (this.applySavedState) { - this.state = await this.stateService.getBrowserCipherComponentState(); + this.state = await this.stateService.getBrowserVaultItemsComponentState(); if (this.state?.searchText) { this.searchText = this.state.searchText; } @@ -161,7 +161,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On 0 ); } - await this.stateService.setBrowserCipherComponentState(null); + await this.stateService.setBrowserVaultItemsComponentState(null); }); this.broadcasterService.subscribe(ComponentId, (message: any) => { @@ -291,6 +291,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On scrollY: this.popupUtils.getContentScrollY(window, this.scrollingContainer), searchText: this.searchText, }; - await this.stateService.setBrowserCipherComponentState(this.state); + await this.stateService.setBrowserVaultItemsComponentState(this.state); } } diff --git a/apps/browser/src/services/abstractions/state.service.ts b/apps/browser/src/services/abstractions/state.service.ts index 294bc814e6..53a1b88364 100644 --- a/apps/browser/src/services/abstractions/state.service.ts +++ b/apps/browser/src/services/abstractions/state.service.ts @@ -18,8 +18,8 @@ export abstract class StateService extends BaseStateServiceAbstraction value: BrowserGroupingsComponentState, options?: StorageOptions ) => Promise; - getBrowserCipherComponentState: (options?: StorageOptions) => Promise; - setBrowserCipherComponentState: ( + getBrowserVaultItemsComponentState: (options?: StorageOptions) => Promise; + setBrowserVaultItemsComponentState: ( value: BrowserComponentState, options?: StorageOptions ) => Promise; diff --git a/apps/browser/src/services/state.service.spec.ts b/apps/browser/src/services/state.service.spec.ts index e6bde9af5b..5bc4e6ad99 100644 --- a/apps/browser/src/services/state.service.spec.ts +++ b/apps/browser/src/services/state.service.spec.ts @@ -107,14 +107,14 @@ describe("Browser State Service", () => { }); }); - describe("getBrowserCipherComponentState", () => { + describe("getBrowserVaultItemsComponentState", () => { it("should return a BrowserComponentState", async () => { const componentState = new BrowserComponentState(); componentState.scrollY = 0; componentState.searchText = "test"; state.accounts[userId].ciphers = componentState; - const actual = await sut.getBrowserCipherComponentState(); + const actual = await sut.getBrowserVaultItemsComponentState(); expect(actual).toStrictEqual(componentState); }); }); diff --git a/apps/browser/src/services/state.service.ts b/apps/browser/src/services/state.service.ts index 1a627935ee..3f4161f5a6 100644 --- a/apps/browser/src/services/state.service.ts +++ b/apps/browser/src/services/state.service.ts @@ -68,13 +68,15 @@ export class StateService } @withPrototype(BrowserComponentState) - async getBrowserCipherComponentState(options?: StorageOptions): Promise { + async getBrowserVaultItemsComponentState( + options?: StorageOptions + ): Promise { return ( await this.getAccount(this.reconcileOptions(options, await this.defaultInMemoryOptions())) )?.ciphers; } - async setBrowserCipherComponentState( + async setBrowserVaultItemsComponentState( value: BrowserComponentState, options?: StorageOptions ): Promise { diff --git a/apps/desktop/src/app/app.module.ts b/apps/desktop/src/app/app.module.ts index c1575e4039..29d865e826 100644 --- a/apps/desktop/src/app/app.module.ts +++ b/apps/desktop/src/app/app.module.ts @@ -90,7 +90,6 @@ import { SharedModule } from "./shared/shared.module"; import { AddEditCustomFieldsComponent } from "./vault/add-edit-custom-fields.component"; import { AddEditComponent } from "./vault/add-edit.component"; import { AttachmentsComponent } from "./vault/attachments.component"; -import { CiphersComponent } from "./vault/ciphers.component"; import { CollectionsComponent } from "./vault/collections.component"; import { ExportComponent } from "./vault/export.component"; import { FolderAddEditComponent } from "./vault/folder-add-edit.component"; @@ -99,6 +98,7 @@ import { PasswordGeneratorHistoryComponent } from "./vault/password-generator-hi import { PasswordHistoryComponent } from "./vault/password-history.component"; import { ShareComponent } from "./vault/share.component"; import { VaultFilterModule } from "./vault/vault-filter/vault-filter.module"; +import { VaultItemsComponent } from "./vault/vault-items.component"; import { VaultComponent } from "./vault/vault.component"; import { ViewCustomFieldsComponent } from "./vault/view-custom-fields.component"; import { ViewComponent } from "./vault/view.component"; @@ -168,7 +168,7 @@ registerLocaleData(localeZhTw, "zh-TW"); AddEditCustomFieldsComponent, AppComponent, AttachmentsComponent, - CiphersComponent, + VaultItemsComponent, CollectionsComponent, DeleteAccountComponent, EnvironmentComponent, diff --git a/apps/desktop/src/app/vault/ciphers.component.html b/apps/desktop/src/app/vault/vault-items.component.html similarity index 100% rename from apps/desktop/src/app/vault/ciphers.component.html rename to apps/desktop/src/app/vault/vault-items.component.html diff --git a/apps/desktop/src/app/vault/ciphers.component.ts b/apps/desktop/src/app/vault/vault-items.component.ts similarity index 73% rename from apps/desktop/src/app/vault/ciphers.component.ts rename to apps/desktop/src/app/vault/vault-items.component.ts index 4e0c6016ca..1bd039d699 100644 --- a/apps/desktop/src/app/vault/ciphers.component.ts +++ b/apps/desktop/src/app/vault/vault-items.component.ts @@ -1,17 +1,17 @@ import { Component } from "@angular/core"; -import { CiphersComponent as BaseCiphersComponent } from "@bitwarden/angular/components/ciphers.component"; +import { VaultItemsComponent as BaseVaultItemsComponent } from "@bitwarden/angular/components/vault-items.component"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; import { CipherView } from "@bitwarden/common/models/view/cipher.view"; import { SearchBarService } from "../layout/search/search-bar.service"; @Component({ - selector: "app-vault-ciphers", - templateUrl: "ciphers.component.html", + selector: "app-vault-items", + templateUrl: "vault-items.component.html", }) // eslint-disable-next-line rxjs-angular/prefer-takeuntil -export class CiphersComponent extends BaseCiphersComponent { +export class VaultItemsComponent extends BaseVaultItemsComponent { constructor(searchService: SearchService, searchBarService: SearchBarService) { super(searchService); diff --git a/apps/desktop/src/app/vault/vault.component.html b/apps/desktop/src/app/vault/vault.component.html index bf6773e468..9c8d9ecfdd 100644 --- a/apps/desktop/src/app/vault/vault.component.html +++ b/apps/desktop/src/app/vault/vault.component.html @@ -1,5 +1,5 @@
- - + { this.modal = null; if (madeAttachmentChanges) { - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); } madeAttachmentChanges = false; }); @@ -490,7 +490,7 @@ export class VaultComponent implements OnInit, OnDestroy { childComponent.onSharedCipher.subscribe(async () => { this.modal.close(); this.viewCipher(cipher); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe this.modal.onClosed.subscribe(async () => { @@ -549,7 +549,7 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t(this.calculateSearchBarLocalizationString(vaultFilter)) ); this.activeFilter = vaultFilter; - await this.ciphersComponent.reload( + await this.vaultItemsComponent.reload( this.activeFilter.buildFilter(), vaultFilter.status === "trash" ); diff --git a/apps/web/src/app/organizations/vault/ciphers.component.ts b/apps/web/src/app/organizations/vault/vault-items.component.ts similarity index 93% rename from apps/web/src/app/organizations/vault/ciphers.component.ts rename to apps/web/src/app/organizations/vault/vault-items.component.ts index 558c09d5e3..670217a724 100644 --- a/apps/web/src/app/organizations/vault/ciphers.component.ts +++ b/apps/web/src/app/organizations/vault/vault-items.component.ts @@ -15,13 +15,13 @@ import { TotpService } from "@bitwarden/common/abstractions/totp.service"; import { Organization } from "@bitwarden/common/models/domain/organization"; import { CipherView } from "@bitwarden/common/models/view/cipher.view"; -import { CiphersComponent as BaseCiphersComponent } from "../../vault/ciphers.component"; +import { VaultItemsComponent as BaseVaultItemsComponent } from "../../vault/vault-items.component"; @Component({ - selector: "app-org-vault-ciphers", - templateUrl: "../../vault/ciphers.component.html", + selector: "app-org-vault-items", + templateUrl: "../../vault/vault-items.component.html", }) -export class CiphersComponent extends BaseCiphersComponent { +export class VaultItemsComponent extends BaseVaultItemsComponent { @Output() onEventsClicked = new EventEmitter(); organization: Organization; diff --git a/apps/web/src/app/organizations/vault/vault.component.html b/apps/web/src/app/organizations/vault/vault.component.html index a8837011e0..dcc20913b9 100644 --- a/apps/web/src/app/organizations/vault/vault.component.html +++ b/apps/web/src/app/organizations/vault/vault.component.html @@ -18,7 +18,7 @@
diff --git a/apps/web/src/app/organizations/vault/vault.component.ts b/apps/web/src/app/organizations/vault/vault.component.ts index 8b6478fa35..c175e42d78 100644 --- a/apps/web/src/app/organizations/vault/vault.component.ts +++ b/apps/web/src/app/organizations/vault/vault.component.ts @@ -29,9 +29,9 @@ import { EntityEventsComponent } from "../manage/entity-events.component"; import { AddEditComponent } from "./add-edit.component"; import { AttachmentsComponent } from "./attachments.component"; -import { CiphersComponent } from "./ciphers.component"; import { CollectionsComponent } from "./collections.component"; import { VaultFilterComponent } from "./vault-filter/vault-filter.component"; +import { VaultItemsComponent } from "./vault-items.component"; const BroadcasterSubscriptionId = "OrgVaultComponent"; @@ -42,7 +42,7 @@ const BroadcasterSubscriptionId = "OrgVaultComponent"; export class VaultComponent implements OnInit, OnDestroy { @ViewChild("vaultFilter", { static: true }) vaultFilterComponent: VaultFilterComponent; - @ViewChild(CiphersComponent, { static: true }) ciphersComponent: CiphersComponent; + @ViewChild(VaultItemsComponent, { static: true }) vaultItemsComponent: VaultItemsComponent; @ViewChild("attachments", { read: ViewContainerRef, static: true }) attachmentsModalRef: ViewContainerRef; @ViewChild("cipherAddEdit", { read: ViewContainerRef, static: true }) @@ -90,11 +90,11 @@ export class VaultComponent implements OnInit, OnDestroy { this.route.parent.params.subscribe(async (params: any) => { this.organization = await this.organizationService.get(params.organizationId); this.vaultFilterComponent.organization = this.organization; - this.ciphersComponent.organization = this.organization; + this.vaultItemsComponent.organization = this.organization; /* eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe, rxjs/no-nested-subscribe */ this.route.queryParams.pipe(first()).subscribe(async (qParams) => { - this.ciphersComponent.searchText = this.vaultFilterComponent.searchText = qParams.search; + this.vaultItemsComponent.searchText = this.vaultFilterComponent.searchText = qParams.search; if (!this.organization.canViewAllCollections) { await this.syncService.fullSync(false); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { @@ -104,7 +104,7 @@ export class VaultComponent implements OnInit, OnDestroy { if (message.successfully) { await Promise.all([ this.vaultFilterComponent.reloadCollectionsAndFolders(), - this.ciphersComponent.refresh(), + this.vaultItemsComponent.refresh(), ]); this.changeDetectorRef.detectChanges(); } @@ -119,10 +119,12 @@ export class VaultComponent implements OnInit, OnDestroy { } this.firstLoaded = true; - await this.ciphersComponent.reload(); + await this.vaultItemsComponent.reload(); if (qParams.viewEvents != null) { - const cipher = this.ciphersComponent.ciphers.filter((c) => c.id === qParams.viewEvents); + const cipher = this.vaultItemsComponent.ciphers.filter( + (c) => c.id === qParams.viewEvents + ); if (cipher.length > 0) { this.viewEvents(cipher[0]); } @@ -164,16 +166,16 @@ export class VaultComponent implements OnInit, OnDestroy { } async applyVaultFilter(vaultFilter: VaultFilter) { - this.ciphersComponent.showAddNew = vaultFilter.status !== "trash"; + this.vaultItemsComponent.showAddNew = vaultFilter.status !== "trash"; this.activeFilter = vaultFilter; // Hack to avoid calling cipherService.getAllFromApiForOrganization every time the vault filter changes. - // Call CiphersComponent.applyFilter directly instead of going through CiphersComponent.reload, which + // Call VaultItemsComponent.applyFilter directly instead of going through VaultItemsComponent.reload, which // reloads all the ciphers unnecessarily. Will be fixed properly by EC-14. - this.ciphersComponent.loaded = false; - this.ciphersComponent.deleted = vaultFilter.status === "trash" || false; - await this.ciphersComponent.applyFilter(this.activeFilter.buildFilter()); - this.ciphersComponent.loaded = true; + this.vaultItemsComponent.loaded = false; + this.vaultItemsComponent.deleted = vaultFilter.status === "trash" || false; + await this.vaultItemsComponent.applyFilter(this.activeFilter.buildFilter()); + this.vaultItemsComponent.loaded = true; // End hack this.vaultFilterComponent.searchPlaceholder = @@ -182,8 +184,8 @@ export class VaultComponent implements OnInit, OnDestroy { } filterSearchText(searchText: string) { - this.ciphersComponent.searchText = searchText; - this.ciphersComponent.search(200); + this.vaultItemsComponent.searchText = searchText; + this.vaultItemsComponent.search(200); } async editCipherAttachments(cipher: CipherView) { @@ -210,7 +212,7 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe modal.onClosed.subscribe(async () => { if (madeAttachmentChanges) { - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); } madeAttachmentChanges = false; }); @@ -232,7 +234,7 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onSavedCollections.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); @@ -274,17 +276,17 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onSavedCipher.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onDeletedCipher.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onRestoredCipher.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); diff --git a/apps/web/src/app/organizations/vault/vault.module.ts b/apps/web/src/app/organizations/vault/vault.module.ts index 91a9973e20..af32f6588d 100644 --- a/apps/web/src/app/organizations/vault/vault.module.ts +++ b/apps/web/src/app/organizations/vault/vault.module.ts @@ -2,14 +2,14 @@ import { NgModule } from "@angular/core"; import { VaultSharedModule } from "../../vault/shared/vault-shared.module"; -import { CiphersComponent } from "./ciphers.component"; import { VaultFilterModule } from "./vault-filter/vault-filter.module"; +import { VaultItemsComponent } from "./vault-items.component"; import { VaultRoutingModule } from "./vault-routing.module"; import { VaultComponent } from "./vault.component"; @NgModule({ imports: [VaultSharedModule, VaultRoutingModule, VaultFilterModule], - declarations: [VaultComponent, CiphersComponent], + declarations: [VaultComponent, VaultItemsComponent], exports: [VaultComponent], }) export class VaultModule {} diff --git a/apps/web/src/app/vault/bulk-actions.component.ts b/apps/web/src/app/vault/bulk-actions.component.ts index 7f81ef0a5a..98ca1f5255 100644 --- a/apps/web/src/app/vault/bulk-actions.component.ts +++ b/apps/web/src/app/vault/bulk-actions.component.ts @@ -11,7 +11,7 @@ import { BulkDeleteComponent } from "./bulk-delete.component"; import { BulkMoveComponent } from "./bulk-move.component"; import { BulkRestoreComponent } from "./bulk-restore.component"; import { BulkShareComponent } from "./bulk-share.component"; -import { CiphersComponent } from "./ciphers.component"; +import { VaultItemsComponent } from "./vault-items.component"; @Component({ selector: "app-vault-bulk-actions", @@ -19,7 +19,7 @@ import { CiphersComponent } from "./ciphers.component"; }) // eslint-disable-next-line rxjs-angular/prefer-takeuntil export class BulkActionsComponent { - @Input() ciphersComponent: CiphersComponent; + @Input() vaultItemsComponent: VaultItemsComponent; @Input() deleted: boolean; @Input() organization: Organization; @@ -44,7 +44,7 @@ export class BulkActionsComponent { return; } - const selectedIds = this.ciphersComponent.getSelectedIds(); + const selectedIds = this.vaultItemsComponent.getSelectedIds(); if (selectedIds.length === 0) { this.platformUtilsService.showToast( "error", @@ -64,7 +64,7 @@ export class BulkActionsComponent { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onDeleted.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); @@ -75,7 +75,7 @@ export class BulkActionsComponent { return; } - const selectedIds = this.ciphersComponent.getSelectedIds(); + const selectedIds = this.vaultItemsComponent.getSelectedIds(); if (selectedIds.length === 0) { this.platformUtilsService.showToast( "error", @@ -93,7 +93,7 @@ export class BulkActionsComponent { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onRestored.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); @@ -104,7 +104,7 @@ export class BulkActionsComponent { return; } - const selectedCiphers = this.ciphersComponent.getSelected(); + const selectedCiphers = this.vaultItemsComponent.getSelected(); if (selectedCiphers.length === 0) { this.platformUtilsService.showToast( "error", @@ -122,7 +122,7 @@ export class BulkActionsComponent { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onShared.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); @@ -133,7 +133,7 @@ export class BulkActionsComponent { return; } - const selectedIds = this.ciphersComponent.getSelectedIds(); + const selectedIds = this.vaultItemsComponent.getSelectedIds(); if (selectedIds.length === 0) { this.platformUtilsService.showToast( "error", @@ -151,18 +151,18 @@ export class BulkActionsComponent { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe comp.onMoved.subscribe(async () => { modal.close(); - await this.ciphersComponent.refresh(); + await this.vaultItemsComponent.refresh(); }); } ); } selectAll(select: boolean) { - this.ciphersComponent.selectAll(select); + this.vaultItemsComponent.selectAll(select); } private async promptPassword() { - const selectedCiphers = this.ciphersComponent.getSelected(); + const selectedCiphers = this.vaultItemsComponent.getSelected(); const notProtected = !selectedCiphers.find( (cipher) => cipher.reprompt !== CipherRepromptType.None ); diff --git a/apps/web/src/app/vault/ciphers.component.html b/apps/web/src/app/vault/vault-items.component.html similarity index 100% rename from apps/web/src/app/vault/ciphers.component.html rename to apps/web/src/app/vault/vault-items.component.html diff --git a/apps/web/src/app/vault/ciphers.component.ts b/apps/web/src/app/vault/vault-items.component.ts similarity index 97% rename from apps/web/src/app/vault/ciphers.component.ts rename to apps/web/src/app/vault/vault-items.component.ts index 8fa4f61f71..4de11e2ead 100644 --- a/apps/web/src/app/vault/ciphers.component.ts +++ b/apps/web/src/app/vault/vault-items.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnDestroy, Output } from "@angular/core"; -import { CiphersComponent as BaseCiphersComponent } from "@bitwarden/angular/components/ciphers.component"; +import { VaultItemsComponent as BaseVaultItemsComponent } from "@bitwarden/angular/components/vault-items.component"; import { CipherService } from "@bitwarden/common/abstractions/cipher.service"; import { EventService } from "@bitwarden/common/abstractions/event.service"; import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; @@ -22,10 +22,10 @@ import { Icons } from "@bitwarden/components"; const MaxCheckedCount = 500; @Component({ - selector: "app-vault-ciphers", - templateUrl: "ciphers.component.html", + selector: "app-vault-items", + templateUrl: "vault-items.component.html", }) -export class CiphersComponent extends BaseCiphersComponent implements OnDestroy { +export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDestroy { @Input() showAddNew = true; @Output() onAttachmentsClicked = new EventEmitter(); @Output() onShareClicked = new EventEmitter(); diff --git a/apps/web/src/app/vault/vault.component.html b/apps/web/src/app/vault/vault.component.html index 1ea77b34b1..fb4afb8386 100644 --- a/apps/web/src/app/vault/vault.component.html +++ b/apps/web/src/app/vault/vault.component.html @@ -20,7 +20,7 @@