mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
* Recursive trie-building with variable paths * tree structure applied to new path routes and a new util class * Breadcrumbs for SV paths and prompt when nothing exists at a path * Lint and test cleanup * Pre-review cleanup * lintfix * Abstracted pathtree each-ins into a new component class * Path tree component styles * Types added and PR feedback addressed * Path tree to variable paths * Slightly simpler path QP mods * More pr feedback handling * Trim moved into a function on variable model * Traversal and compaction tests for PathTree * Trim Path tests * Variable-paths component tests * Lint fixup for tests
32 lines
695 B
JavaScript
32 lines
695 B
JavaScript
// @ts-check
|
|
import Component from '@glimmer/component';
|
|
import { action } from '@ember/object';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class VariablePathsComponent extends Component {
|
|
@service router;
|
|
|
|
/**
|
|
* @returns {Array<Object.<string, Object>>}
|
|
*/
|
|
get folders() {
|
|
return Object.entries(this.args.branch.children).map(([name, data]) => {
|
|
return { name, data };
|
|
});
|
|
}
|
|
|
|
get files() {
|
|
return this.args.branch.files;
|
|
}
|
|
|
|
@action
|
|
async handleFolderClick(path) {
|
|
this.router.transitionTo('variables.path', path);
|
|
}
|
|
|
|
@action
|
|
async handleFileClick(path) {
|
|
this.router.transitionTo('variables.variable', path);
|
|
}
|
|
}
|