1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

PM-5274 Migrate Collection Service State (#7732)

* update collection service to use new state provider framework, remove stateservice from collection service, update collections state provider with migrate file and unit test
This commit is contained in:
Jason Ng
2024-02-14 17:03:03 -05:00
committed by GitHub
parent d8b74b78da
commit 3edf098aaf
23 changed files with 426 additions and 170 deletions

View File

@@ -1,3 +1,5 @@
import { Jsonify } from "type-fest";
import { Organization } from "../../../admin-console/models/domain/organization";
import { View } from "../../../models/view/view";
import { Collection } from "../domain/collection";
@@ -56,4 +58,8 @@ export class CollectionView implements View, ITreeNodeObject {
? org?.canDeleteAnyCollection || (!org?.limitCollectionCreationDeletion && this.manage)
: org?.canDeleteAnyCollection || org?.canDeleteAssignedCollections;
}
static fromJSON(obj: Jsonify<CollectionView>) {
return Object.assign(new CollectionView(new Collection()), obj);
}
}