1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02:00

load nested collections

This commit is contained in:
Kyle Spearrin 2018-10-25 12:18:36 -04:00
parent 59f0549072
commit b0eea9d7ce

View File

@ -16,8 +16,9 @@ import { FolderService } from '../../abstractions/folder.service';
export class GroupingsComponent { export class GroupingsComponent {
@Input() showFolders = true; @Input() showFolders = true;
@Input() loadNestedFolder = false; @Input() loadNestedFolders = false;
@Input() showCollections = true; @Input() showCollections = true;
@Input() loadNestedCollections = false;
@Input() showFavorites = true; @Input() showFavorites = true;
@Output() onAllClicked = new EventEmitter(); @Output() onAllClicked = new EventEmitter();
@ -31,6 +32,7 @@ export class GroupingsComponent {
folders: FolderView[]; folders: FolderView[];
nestedFolders: Array<TreeNode<FolderView>>; nestedFolders: Array<TreeNode<FolderView>>;
collections: CollectionView[]; collections: CollectionView[];
nestedCollections: Array<TreeNode<CollectionView>>;
loaded: boolean = false; loaded: boolean = false;
cipherType = CipherType; cipherType = CipherType;
selectedAll: boolean = false; selectedAll: boolean = false;
@ -61,6 +63,9 @@ export class GroupingsComponent {
} else { } else {
this.collections = collections; this.collections = collections;
} }
if (this.loadNestedCollections) {
this.nestedCollections = await this.collectionService.getAllNested(this.collections);
}
} }
async loadFolders() { async loadFolders() {
@ -68,7 +73,7 @@ export class GroupingsComponent {
return; return;
} }
this.folders = await this.folderService.getAllDecrypted(); this.folders = await this.folderService.getAllDecrypted();
if (this.loadNestedFolder) { if (this.loadNestedFolders) {
this.nestedFolders = await this.folderService.getAllNested(); this.nestedFolders = await this.folderService.getAllNested();
} }
} }