diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 020a1624c7..e060534f35 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -512,6 +512,9 @@ "searchCollection": { "message": "Search collection" }, + "searchType": { + "message": "Search type" + }, "noneFolder": { "message": "No Folder", "description": "This is the folder for uncategorized items" @@ -1015,6 +1018,12 @@ "identities": { "message": "Identities" }, + "logins": { + "message": "Logins" + }, + "secureNotes": { + "message": "Secure Notes" + }, "clear": { "message": "Clear" }, @@ -1073,5 +1082,8 @@ }, "types": { "message": "Types" + }, + "allItems": { + "message": "All Items" } } diff --git a/src/popup2/vault/ciphers.component.html b/src/popup2/vault/ciphers.component.html index bb4c562512..03746ff1aa 100644 --- a/src/popup2/vault/ciphers.component.html +++ b/src/popup2/vault/ciphers.component.html @@ -20,7 +20,8 @@
- Some name here + {{groupingTitle}} + {{searchedCiphers.length}}
{ if (params.type) { + this.searchPlaceholder = this.i18nService.t('searchType'); const t = parseInt(params.type, null); + switch (t) { + case CipherType.Login: + this.groupingTitle = this.i18nService.t('logins'); + break; + case CipherType.Card: + this.groupingTitle = this.i18nService.t('cards'); + break; + case CipherType.Identity: + this.groupingTitle = this.i18nService.t('identities'); + break; + case CipherType.SecureNote: + this.groupingTitle = this.i18nService.t('secureNotes'); + break; + default: + break; + } await super.load((c) => c.type === t); } else if (params.folderId) { - await super.load((c) => c.folderId === params.folderId); + const folderId = params.folderId === 'none' ? null : params.folderId; + this.searchPlaceholder = this.i18nService.t('searchFolder'); + if (folderId != null) { + const folder = await this.folderService.get(folderId); + if (folder != null) { + this.groupingTitle = (await folder.decrypt()).name; + } + } else { + this.groupingTitle = this.i18nService.t('noneFolder'); + } + await super.load((c) => c.folderId === folderId); } else if (params.collectionId) { + this.searchPlaceholder = this.i18nService.t('searchCollection'); + const collection = await this.collectionService.get(params.collectionId); + if (collection != null) { + this.groupingTitle = (await collection.decrypt()).name; + } await super.load((c) => c.collectionIds.indexOf(params.collectionId) > -1); } else { + this.groupingTitle = this.i18nService.t('allItems'); await super.load(); } diff --git a/src/popup2/vault/groupings.component.ts b/src/popup2/vault/groupings.component.ts index 44992c0732..3bfa820787 100644 --- a/src/popup2/vault/groupings.component.ts +++ b/src/popup2/vault/groupings.component.ts @@ -156,7 +156,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit async selectFolder(folder: FolderView) { super.selectFolder(folder); - this.router.navigate(['/ciphers'], { queryParams: { folderId: folder.id } }); + this.router.navigate(['/ciphers'], { queryParams: { folderId: folder.id || 'none' } }); } async selectCollection(collection: CollectionView) {