1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[PM-23378] clear selection after event on (#15465)

* clear selection after event on individual part

* added changes in org

* added clearSelection in refresh()

---------

Co-authored-by: Jason Ng <jng@bitwarden.com>
This commit is contained in:
Ketan Mehta
2025-08-06 19:15:38 +05:30
committed by GitHub
parent 29e16fc5e0
commit 8980016d2d
5 changed files with 14 additions and 1 deletions

View File

@@ -84,6 +84,7 @@
{{ trashCleanupWarning }} {{ trashCleanupWarning }}
</bit-callout> </bit-callout>
<app-vault-items <app-vault-items
#vaultItems
[ciphers]="ciphers" [ciphers]="ciphers"
[collections]="collections" [collections]="collections"
[allCollections]="allCollections" [allCollections]="allCollections"

View File

@@ -1,6 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line // FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore // @ts-strict-ignore
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from "@angular/core"; import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from "@angular/core";
import { ActivatedRoute, Params, Router } from "@angular/router"; import { ActivatedRoute, Params, Router } from "@angular/router";
import { import {
BehaviorSubject, BehaviorSubject,
@@ -81,6 +81,7 @@ import {
} from "@bitwarden/vault"; } from "@bitwarden/vault";
import { OrganizationResellerRenewalWarningComponent } from "@bitwarden/web-vault/app/billing/warnings/components/organization-reseller-renewal-warning.component"; import { OrganizationResellerRenewalWarningComponent } from "@bitwarden/web-vault/app/billing/warnings/components/organization-reseller-renewal-warning.component";
import { OrganizationWarningsService } from "@bitwarden/web-vault/app/billing/warnings/services/organization-warnings.service"; import { OrganizationWarningsService } from "@bitwarden/web-vault/app/billing/warnings/services/organization-warnings.service";
import { VaultItemsComponent } from "@bitwarden/web-vault/app/vault/components/vault-items/vault-items.component";
import { BillingNotificationService } from "../../../billing/services/billing-notification.service"; import { BillingNotificationService } from "../../../billing/services/billing-notification.service";
import { import {
@@ -204,6 +205,8 @@ export class VaultComponent implements OnInit, OnDestroy {
protected addAccessStatus$ = new BehaviorSubject<AddAccessStatusType>(0); protected addAccessStatus$ = new BehaviorSubject<AddAccessStatusType>(0);
private vaultItemDialogRef?: DialogRef<VaultItemDialogResult> | undefined; private vaultItemDialogRef?: DialogRef<VaultItemDialogResult> | undefined;
@ViewChild("vaultItems", { static: false }) vaultItemsComponent: VaultItemsComponent<CipherView>;
private readonly unpaidSubscriptionDialog$ = this.accountService.activeAccount$.pipe( private readonly unpaidSubscriptionDialog$ = this.accountService.activeAccount$.pipe(
map((account) => account?.id), map((account) => account?.id),
switchMap((id) => switchMap((id) =>
@@ -1430,6 +1433,7 @@ export class VaultComponent implements OnInit, OnDestroy {
private refresh() { private refresh() {
this.refresh$.next(); this.refresh$.next();
this.vaultItemsComponent?.clearSelection();
} }
private go(queryParams: any = null) { private go(queryParams: any = null) {

View File

@@ -166,6 +166,10 @@ export class VaultItemsComponent<C extends CipherViewLike> {
); );
} }
clearSelection() {
this.selection.clear();
}
get showExtraColumn() { get showExtraColumn() {
return this.showCollections || this.showGroups || this.showOwner; return this.showCollections || this.showGroups || this.showOwner;
} }

View File

@@ -37,6 +37,7 @@
{{ trashCleanupWarning }} {{ trashCleanupWarning }}
</bit-callout> </bit-callout>
<app-vault-items <app-vault-items
#vaultItems
[ciphers]="ciphers" [ciphers]="ciphers"
[collections]="collections" [collections]="collections"
[allCollections]="allCollections" [allCollections]="allCollections"

View File

@@ -108,6 +108,7 @@ import {
} from "../components/vault-item-dialog/vault-item-dialog.component"; } from "../components/vault-item-dialog/vault-item-dialog.component";
import { VaultItem } from "../components/vault-items/vault-item"; import { VaultItem } from "../components/vault-items/vault-item";
import { VaultItemEvent } from "../components/vault-items/vault-item-event"; import { VaultItemEvent } from "../components/vault-items/vault-item-event";
import { VaultItemsComponent } from "../components/vault-items/vault-items.component";
import { VaultItemsModule } from "../components/vault-items/vault-items.module"; import { VaultItemsModule } from "../components/vault-items/vault-items.module";
import { import {
@@ -156,6 +157,7 @@ const SearchTextDebounceInterval = 200;
}) })
export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestroy { export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestroy {
@ViewChild("vaultFilter", { static: true }) filterComponent: VaultFilterComponent; @ViewChild("vaultFilter", { static: true }) filterComponent: VaultFilterComponent;
@ViewChild("vaultItems", { static: false }) vaultItemsComponent: VaultItemsComponent<C>;
trashCleanupWarning: string = null; trashCleanupWarning: string = null;
kdfIterations: number; kdfIterations: number;
@@ -1281,6 +1283,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
private refresh() { private refresh() {
this.refresh$.next(); this.refresh$.next();
this.vaultItemsComponent?.clearSelection();
} }
private async go(queryParams: any = null) { private async go(queryParams: any = null) {