mirror of
https://github.com/bitwarden/browser
synced 2026-02-06 19:53:59 +00:00
Tweak Unassigned typing
This commit is contained in:
@@ -373,7 +373,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
map(([organizationId, allCollections]) => {
|
||||
const noneCollection = new CollectionAdminView();
|
||||
noneCollection.name = this.i18nService.t("unassigned");
|
||||
noneCollection.id = Unassigned;
|
||||
noneCollection.id = Unassigned as CollectionId;
|
||||
noneCollection.organizationId = organizationId;
|
||||
return allCollections.concat(noneCollection);
|
||||
}),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Unassigned } from "@bitwarden/admin-console/common";
|
||||
import { CollectionId } from "@bitwarden/common/types/guid";
|
||||
import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node";
|
||||
|
||||
@@ -54,7 +54,8 @@ export class RoutedVaultFilterBridge implements VaultFilter {
|
||||
set selectedOrganizationNode(value: TreeNode<OrganizationFilter>) {
|
||||
this.bridgeService.navigate({
|
||||
...this.routedFilter,
|
||||
organizationId: value?.node.id === "MyVault" ? Unassigned : value?.node.id,
|
||||
organizationId:
|
||||
value?.node.id === "MyVault" ? (Unassigned as OrganizationId) : value?.node.id,
|
||||
folderId: undefined,
|
||||
collectionId: undefined,
|
||||
});
|
||||
@@ -102,7 +103,7 @@ export class RoutedVaultFilterBridge implements VaultFilter {
|
||||
let collectionId: CollectionId | undefined;
|
||||
|
||||
if (value != null && value.node.id === null) {
|
||||
collectionId = Unassigned;
|
||||
collectionId = Unassigned as CollectionId;
|
||||
} else if (
|
||||
value?.node.id === "AllCollections" &&
|
||||
this.routedFilter.organizationIdParamType === "path"
|
||||
|
||||
@@ -6,9 +6,8 @@ import { CollectionAccessDetailsResponse } from "./collection.response";
|
||||
import { CollectionView } from "./collection.view";
|
||||
|
||||
// TODO: this is used to represent the pseudo "Unassigned" collection as well as
|
||||
// the user's personal vault (pseudo organization). This should be separated out into different values.
|
||||
// The intersection type allows this to be glossed over for now.
|
||||
export const Unassigned = "unassigned" as CollectionId & OrganizationId;
|
||||
// the user's personal vault (as a pseudo organization). This should be separated out into different values.
|
||||
export const Unassigned = "unassigned" as CollectionId | OrganizationId;
|
||||
|
||||
export class CollectionAdminView extends CollectionView {
|
||||
groups: CollectionAccessSelectionView[] = [];
|
||||
|
||||
Reference in New Issue
Block a user