diff --git a/src/app/organizations/groupings.component.ts b/src/app/organizations/groupings.component.ts index 7d43ded425..067156de23 100644 --- a/src/app/organizations/groupings.component.ts +++ b/src/app/organizations/groupings.component.ts @@ -8,7 +8,7 @@ import { import { ApiService } from 'jslib/abstractions/api.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; import { FolderService } from 'jslib/abstractions/folder.service'; -import { UserService } from 'jslib/abstractions/user.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; import { GroupingsComponent as BaseGroupingsComponent } from 'jslib/angular/components/groupings.component'; @@ -29,7 +29,7 @@ export class GroupingsComponent extends BaseGroupingsComponent { searchPlaceholder: string = null; constructor(collectionService: CollectionService, folderService: FolderService, - private apiService: ApiService, private userService: UserService) { + private apiService: ApiService, private i18nService: I18nService) { super(collectionService, folderService); } @@ -57,5 +57,12 @@ export class GroupingsComponent extends BaseGroupingsComponent { } else { await super.loadCollections(this.organization.id); } + + const unassignedCollection = new CollectionView(); + unassignedCollection.name = this.i18nService.t('unassigned'); + unassignedCollection.id = 'unassigned'; + unassignedCollection.organizationId = this.organization.id; + unassignedCollection.readOnly = true; + this.collections.push(unassignedCollection); } } diff --git a/src/app/organizations/vault.component.ts b/src/app/organizations/vault.component.ts index 9d4279a5c3..62bd0a78e5 100644 --- a/src/app/organizations/vault.component.ts +++ b/src/app/organizations/vault.component.ts @@ -92,7 +92,13 @@ export class VaultComponent implements OnInit { async filterCollection(collectionId: string, load = false) { this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection'); - const filter = (c: CipherView) => c.collectionIds.indexOf(collectionId) > -1; + const filter = (c: CipherView) => { + if (collectionId === 'unassigned') { + return c.collectionIds == null || c.collectionIds.length === 0; + } else { + return c.collectionIds.indexOf(collectionId) > -1; + } + }; if (load) { await this.ciphersComponent.load(filter); } else { diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 1b775ac263..846cab9e94 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -150,6 +150,9 @@ "remove": { "message": "Remove" }, + "unassigned": { + "message": "Unassigned" + }, "noneFolder": { "message": "No Folder", "description": "This is the folder for uncategorized items"