mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[PM-22717] Expose DefaultUserCollectionEmail to clients (#15643)
* enforce restrictions based on collection type, set default collection type * fix ts strict errors * fix default collection enforcement in vault header * enforce default collection restrictions in vault collection row * enforce default collection restrictions in AC vault header * enforce default collection restriction for select all * fix ts strict error * switch to signal, fix feature flag * fix story * clean up * remove feature flag, move check for defaultCollecion to CollecitonView * fix test * remove unused configService * fix test: coerce null to undefined for collection Id * clean up leaky abstraction for default collection * fix ts-strict error * fix parens * add new property to models, update logic, refactor for ts-strict * fix type * rename defaultCollection getter * clean up * clean up * clean up, add comment, fix submit * add comment * add feature flag * check model for name * cleanup readonly logic, remove featureflag logic * wip * refactor CollectionRequest into Create and Update models * fix readonly logic * cleanup * set defaultUserCollectionEmail in decryption from Collection * split save into update/create methods * fix readonly logic * fix collections post and put requests * add defaultUserCollection email to model when submitting collection dialog
This commit is contained in:
@@ -33,23 +33,24 @@ const createMockCollection = (
|
||||
readOnly = false,
|
||||
canEdit = true,
|
||||
): CollectionView => {
|
||||
return {
|
||||
id: id as CollectionId,
|
||||
const cv = new CollectionView({
|
||||
name,
|
||||
organizationId: organizationId as OrganizationId,
|
||||
externalId: "",
|
||||
readOnly,
|
||||
hidePasswords: false,
|
||||
manage: true,
|
||||
assigned: true,
|
||||
type: CollectionTypes.DefaultUserCollection,
|
||||
isDefaultCollection: true,
|
||||
canEditItems: jest.fn().mockReturnValue(canEdit),
|
||||
canEdit: jest.fn(),
|
||||
canDelete: jest.fn(),
|
||||
canViewCollectionInfo: jest.fn(),
|
||||
encrypt: jest.fn(),
|
||||
};
|
||||
id: id as CollectionId,
|
||||
});
|
||||
cv.readOnly = readOnly;
|
||||
cv.manage = true;
|
||||
cv.type = CollectionTypes.DefaultUserCollection;
|
||||
cv.externalId = "";
|
||||
cv.hidePasswords = false;
|
||||
cv.assigned = true;
|
||||
cv.canEditName = jest.fn().mockReturnValue(true);
|
||||
cv.canEditItems = jest.fn().mockReturnValue(canEdit);
|
||||
cv.canEdit = jest.fn();
|
||||
cv.canDelete = jest.fn();
|
||||
cv.canViewCollectionInfo = jest.fn();
|
||||
|
||||
return cv;
|
||||
};
|
||||
|
||||
describe("ItemDetailsSectionComponent", () => {
|
||||
|
||||
Reference in New Issue
Block a user