mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
getAllNested for collections too. added treenodeobject interface
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
export class TreeNode<T> {
|
||||
export class TreeNode<T extends ITreeNodeObject> {
|
||||
node: T;
|
||||
children: Array<TreeNode<T>> = [];
|
||||
|
||||
constructor(node: T) {
|
||||
constructor(node: T, name: string) {
|
||||
this.node = node;
|
||||
this.node.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ITreeNodeObject {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { View } from './view';
|
||||
|
||||
import { Collection } from '../domain/collection';
|
||||
import { ITreeNodeObject } from '../domain/treeNode';
|
||||
|
||||
export class CollectionView implements View {
|
||||
export class CollectionView implements View, ITreeNodeObject {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { View } from './view';
|
||||
|
||||
import { Folder } from '../domain/folder';
|
||||
import { ITreeNodeObject } from '../domain/treeNode';
|
||||
|
||||
export class FolderView implements View {
|
||||
export class FolderView implements View, ITreeNodeObject {
|
||||
id: string = null;
|
||||
name: string;
|
||||
revisionDate: Date;
|
||||
|
||||
Reference in New Issue
Block a user