open-nomad/ui/app/templates/variables/path.hbs
Phil Renaud da4cb6422e Secure Variables: Build a path tree and traverse it at /variables/*path (#13202)
* 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
2022-07-11 13:34:04 -04:00

47 lines
1.6 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{page-title "Secure Variables: " this.model.absolutePath}}
{{#each this.breadcrumbs as |crumb|}}
<Breadcrumb @crumb={{crumb}} />
{{/each}}
<section class="section">
<div class="toolbar">
<div class="toolbar-item is-right-aligned is-mobile-full-width">
<div class="button-bar">
{{!-- TODO: make sure qpNamespace persists to here --}}
{{#if (can "create variable" namespace=this.qpNamespace)}}
<LinkTo
@route="variables.new"
@query={{hash namespace=this.qpNamespace path=(concat this.model.absolutePath "/")}}
class="button is-primary"
>
Create Secure Variable
</LinkTo>
{{else}}
<button
class="button is-primary is-disabled tooltip is-right-aligned"
aria-label="You dont have sufficient permissions"
disabled
type="button"
>
Create Secure Variable
</button>
{{/if}}
</div>
</div>
</div>
{{#if this.model.treeAtPath}}
<VariablePaths
@branch={{this.model.treeAtPath}}
/>
{{else}}
<div class="empty-message">
<h3 data-test-empty-volumes-list-headline class="empty-message-headline">
Path /{{this.model.absolutePath}} contains no variables
</h3>
<p class="empty-message-body">
To get started, <LinkTo @route="variables.new" @query={{hash path=(concat this.model.absolutePath "/")}}>create a new secure variable here</LinkTo>, or <LinkTo @route="variables">go back to the Secure Variables root directory</LinkTo>.
</p>
</div>
{{/if}}
</section>