mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 00:45:43 +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
19 lines
499 B
JavaScript
19 lines
499 B
JavaScript
import Controller from '@ember/controller';
|
|
|
|
export default class VariablesVariableController extends Controller {
|
|
get breadcrumbs() {
|
|
let crumbs = [];
|
|
this.model.path.split('/').reduce((m, n) => {
|
|
crumbs.push({
|
|
label: n,
|
|
args:
|
|
m + n === this.model.path // If the last crumb, link to the var itself
|
|
? [`variables.variable`, m + n]
|
|
: [`variables.path`, m + n],
|
|
});
|
|
return m + n + '/';
|
|
}, []);
|
|
return crumbs;
|
|
}
|
|
}
|