1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 05:53:42 +00:00

PM-29501 remove icons and use constant to determine switch to bit-chip-select

This commit is contained in:
voommen-livefront
2026-01-15 08:56:37 -06:00
parent 80306860ef
commit 4cd94461e8
6 changed files with 3 additions and 12 deletions

View File

@@ -46,10 +46,11 @@ export abstract class CipherReportComponent implements OnDestroy {
organizations: Organization[] = [];
organizations$: Observable<Organization[]>;
readonly maxItemsToSwitchToChipSelect = 5;
filterStatus: any = [0];
showFilterToggle: boolean = false;
selectedFilterChip: string = "0";
chipSelectOptions: { label: string; value: string; icon: string }[] = [];
chipSelectOptions: { label: string; value: string }[] = [];
vaultMsg: string = "vault";
currentFilterStatus: number | string = 0;
protected filterOrgStatus$ = new BehaviorSubject<number | string>(0);
@@ -291,7 +292,7 @@ export abstract class CipherReportComponent implements OnDestroy {
}
protected canDisplayToggleGroup(): boolean {
return this.filterStatus.length <= 4;
return this.filterStatus.length <= this.maxItemsToSwitchToChipSelect;
}
async filterOrgToggleChipSelect(filterId: string | null) {
@@ -326,10 +327,6 @@ export abstract class CipherReportComponent implements OnDestroy {
private setupChipSelectOptions(filters: string[]) {
const options = filters.map((filterId: string, index: number) => {
let icon: string = "bwi-business";
icon = index === 0 ? "bwi-folder" : icon;
icon = index === 1 ? "bwi-user" : icon;
const name = this.getName(filterId);
const count = this.getCount(filterId);
const labelSuffix = count != null ? ` (${count})` : "";
@@ -337,7 +334,6 @@ export abstract class CipherReportComponent implements OnDestroy {
return {
label: name + labelSuffix,
value: filterId,
icon,
};
});

View File

@@ -34,7 +34,6 @@
@if (!isAdminConsoleActive && !canDisplayToggleGroup()) {
<bit-chip-select
[placeholderText]="chipSelectOptions[0].label"
[placeholderIcon]="chipSelectOptions[0].icon"
[options]="chipSelectOptions"
[ngModel]="selectedFilterChip"
(ngModelChange)="filterOrgToggleChipSelect($event)"

View File

@@ -38,7 +38,6 @@
@if (!isAdminConsoleActive && !canDisplayToggleGroup()) {
<bit-chip-select
[placeholderText]="chipSelectOptions[0].label"
[placeholderIcon]="chipSelectOptions[0].icon"
[options]="chipSelectOptions"
[ngModel]="selectedFilterChip"
(ngModelChange)="filterOrgToggleChipSelect($event)"

View File

@@ -39,7 +39,6 @@
@if (!isAdminConsoleActive && !canDisplayToggleGroup()) {
<bit-chip-select
[placeholderText]="chipSelectOptions[0].label"
[placeholderIcon]="chipSelectOptions[0].icon"
[options]="chipSelectOptions"
[ngModel]="selectedFilterChip"
(ngModelChange)="filterOrgToggleChipSelect($event)"

View File

@@ -39,7 +39,6 @@
@if (!isAdminConsoleActive && !canDisplayToggleGroup()) {
<bit-chip-select
[placeholderText]="chipSelectOptions[0].label"
[placeholderIcon]="chipSelectOptions[0].icon"
[options]="chipSelectOptions"
[ngModel]="selectedFilterChip"
(ngModelChange)="filterOrgToggleChipSelect($event)"

View File

@@ -39,7 +39,6 @@
@if (!isAdminConsoleActive && !canDisplayToggleGroup()) {
<bit-chip-select
[placeholderText]="chipSelectOptions[0].label"
[placeholderIcon]="chipSelectOptions[0].icon"
[options]="chipSelectOptions"
[ngModel]="selectedFilterChip"
(ngModelChange)="filterOrgToggleChipSelect($event)"