mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
group filtering
This commit is contained in:
@@ -15,7 +15,11 @@ import { Location } from '@angular/common';
|
||||
|
||||
import { CiphersComponent } from './ciphers.component';
|
||||
|
||||
import { CipherType } from 'jslib/enums/cipherType';
|
||||
|
||||
import { CipherView } from 'jslib/models/view/cipherView';
|
||||
import { CollectionView } from 'jslib/models/view/collectionView';
|
||||
import { FolderView } from 'jslib/models/view/folderView';
|
||||
|
||||
@Component({
|
||||
selector: 'app-vault',
|
||||
@@ -100,6 +104,26 @@ export class VaultComponent implements OnInit {
|
||||
this.go({ action: this.action, cipherId: this.cipherId });
|
||||
}
|
||||
|
||||
async clearGroupingFilters() {
|
||||
await this.ciphersComponent.load();
|
||||
}
|
||||
|
||||
async filterFavorites() {
|
||||
await this.ciphersComponent.load((c) => c.favorite);
|
||||
}
|
||||
|
||||
async filterCipherType(type: CipherType) {
|
||||
await this.ciphersComponent.load((c) => c.type === type);
|
||||
}
|
||||
|
||||
async filterFolder(folder: FolderView) {
|
||||
await this.ciphersComponent.load((c) => c.folderId === folder.id);
|
||||
}
|
||||
|
||||
async filterCollection(collection: CollectionView) {
|
||||
await this.ciphersComponent.load((c) => c.collectionIds.indexOf(collection.id) > -1);
|
||||
}
|
||||
|
||||
private go(queryParams: any) {
|
||||
const url = this.router.createUrlTree(['vault'], { queryParams: queryParams }).toString();
|
||||
this.location.go(url);
|
||||
|
||||
Reference in New Issue
Block a user