-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Namespace capabilities view to Director
- Show namespace capabilities - Show interaction between namespace and server capabilities
- Loading branch information
1 parent
eb02c40
commit 093cf49
Showing
12 changed files
with
286 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
import { StringTree } from '@/index'; | ||
|
||
export * from './DirectorCard'; | ||
export * from './DirectorCardList'; | ||
|
||
export const directoryListToTree = (directoryList: string[]): StringTree => { | ||
let tree = {}; | ||
directoryList.forEach((directory) => { | ||
const path = directory | ||
.split('/') | ||
.filter((x) => x != '') | ||
.map((x) => '/' + x); | ||
tree = directoryListToTreeHelper(path, tree); | ||
}); | ||
|
||
return tree; | ||
}; | ||
|
||
export const directoryListToTreeHelper = ( | ||
path: string[], | ||
tree: StringTree | ||
): true | StringTree => { | ||
if (path.length == 0) { | ||
return true; | ||
} | ||
|
||
if (!tree[path[0]] || tree[path[0]] === true) { | ||
tree[path[0]] = {}; | ||
} | ||
|
||
tree[path[0]] = directoryListToTreeHelper(path.slice(1), tree[path[0]]); | ||
|
||
return tree; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.