mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-24951] - update "My Items" icon to bwi-user (#16674)
* update "My Items" icon to bwi-user * fix tests * revert changse to reports. fix assign collections. * revert remaining changes to reports
This commit is contained in:
@@ -14,7 +14,11 @@ import {
|
||||
take,
|
||||
} from "rxjs";
|
||||
|
||||
import { CollectionService, CollectionView } from "@bitwarden/admin-console/common";
|
||||
import {
|
||||
CollectionService,
|
||||
CollectionTypes,
|
||||
CollectionView,
|
||||
} from "@bitwarden/admin-console/common";
|
||||
import { ViewCacheService } from "@bitwarden/angular/platform/view-cache";
|
||||
import { DynamicTreeNode } from "@bitwarden/angular/vault/vault-filter/models/dynamic-tree-node.model";
|
||||
import { sortDefaultCollections } from "@bitwarden/angular/vault/vault-filter/services/vault-filter.service";
|
||||
@@ -473,7 +477,14 @@ export class VaultPopupListFiltersService {
|
||||
});
|
||||
}),
|
||||
map((tree) =>
|
||||
tree.nestedList.map((c) => this.convertToChipSelectOption(c, "bwi-collection-shared")),
|
||||
tree.nestedList.map((c) =>
|
||||
this.convertToChipSelectOption(
|
||||
c,
|
||||
c.node.type === CollectionTypes.DefaultUserCollection
|
||||
? "bwi-user"
|
||||
: "bwi-collection-shared",
|
||||
),
|
||||
),
|
||||
),
|
||||
shareReplay({ bufferSize: 1, refCount: true }),
|
||||
);
|
||||
|
||||
@@ -55,7 +55,10 @@
|
||||
>
|
||||
<i
|
||||
*ngIf="c.children.length === 0"
|
||||
class="bwi bwi-fw bwi-collection-shared"
|
||||
[class]="
|
||||
'bwi bwi-fw ' +
|
||||
(c.node.type === DefaultCollectionType ? 'bwi-user' : 'bwi-collection-shared')
|
||||
"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
{{ c.node.name }}
|
||||
|
||||
@@ -13,7 +13,12 @@
|
||||
</td>
|
||||
<td bitCell [ngClass]="RowHeightClass" class="tw-min-w-fit">
|
||||
<div aria-hidden="true">
|
||||
<i class="bwi bwi-fw bwi-lg bwi-collection-shared"></i>
|
||||
<i
|
||||
[class]="
|
||||
'bwi bwi-fw bwi-lg ' +
|
||||
(collection.type === DefaultCollectionType ? 'bwi-user' : 'bwi-collection-shared')
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
</td>
|
||||
<td bitCell [ngClass]="RowHeightClass">
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// @ts-strict-ignore
|
||||
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
||||
|
||||
import { CollectionAdminView, Unassigned, CollectionView } from "@bitwarden/admin-console/common";
|
||||
import {
|
||||
CollectionAdminView,
|
||||
Unassigned,
|
||||
CollectionView,
|
||||
CollectionTypes,
|
||||
} from "@bitwarden/admin-console/common";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { CipherViewLike } from "@bitwarden/common/vault/utils/cipher-view-like-utils";
|
||||
@@ -26,6 +31,7 @@ export class VaultCollectionRowComponent<C extends CipherViewLike> {
|
||||
protected RowHeightClass = RowHeightClass;
|
||||
protected Unassigned = "unassigned";
|
||||
protected CollectionPermission = CollectionPermission;
|
||||
protected DefaultCollectionType = CollectionTypes.DefaultUserCollection;
|
||||
|
||||
@Input() disabled: boolean;
|
||||
@Input() collection: CollectionView;
|
||||
|
||||
@@ -12,7 +12,11 @@ import {
|
||||
switchMap,
|
||||
} from "rxjs";
|
||||
|
||||
import { CollectionService, CollectionView } from "@bitwarden/admin-console/common";
|
||||
import {
|
||||
CollectionService,
|
||||
CollectionTypes,
|
||||
CollectionView,
|
||||
} from "@bitwarden/admin-console/common";
|
||||
import { sortDefaultCollections } from "@bitwarden/angular/vault/vault-filter/services/vault-filter.service";
|
||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
@@ -257,7 +261,8 @@ export class VaultFilterService implements VaultFilterServiceAbstraction {
|
||||
const collectionCopy = cloneCollection(
|
||||
new CollectionView({ ...c, name: c.name }),
|
||||
) as CollectionFilter;
|
||||
collectionCopy.icon = "bwi-collection-shared";
|
||||
collectionCopy.icon =
|
||||
c.type === CollectionTypes.DefaultUserCollection ? "bwi-user" : "bwi-collection-shared";
|
||||
const parts = c.name ? c.name.replace(/^\/+|\/+$/g, "").split(NestingDelimiter) : [];
|
||||
ServiceUtils.nestedTraverse(nodes, 0, parts, collectionCopy, undefined, NestingDelimiter);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
Unassigned,
|
||||
CollectionView,
|
||||
CollectionAdminService,
|
||||
CollectionTypes,
|
||||
} from "@bitwarden/admin-console/common";
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
@@ -152,9 +153,12 @@ export class VaultHeaderComponent {
|
||||
}
|
||||
|
||||
protected get icon() {
|
||||
return this.filter?.collectionId && this.filter.collectionId !== All
|
||||
? "bwi-collection-shared"
|
||||
: "";
|
||||
if (!this.filter?.collectionId || this.filter.collectionId === All) {
|
||||
return "";
|
||||
}
|
||||
return this.collection?.node.type === CollectionTypes.DefaultUserCollection
|
||||
? "bwi-user"
|
||||
: "bwi-collection-shared";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user