open-nomad/ui/app/templates/variables/path.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.5 KiB
Handlebars
Raw Normal View History

{{page-title "Secure Variables: " this.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">
ui: add namespace filter to `variables.index` (#13618) * ui: add namespace filter feature ui: add namespace filtering to variables.index test: namespace filter refact: fix action in template ui: move data fetching and query param logic to ui: controller query parameter logic ui: prevent from forwarding query param ui: create variables controller refact: use dependency injection for controlling parent qp chore: clean-up reset in route chore: clean-up reset in route * ui: add namespace filter to secure var form (#13629) ui: update variable factory to accept namespaces refact: update api to accept disabled ui: add namespace setting logic to form refact: remove debugger refact: get correct selectors for ui: move data loading to namespace-filter component chore: prettify template ui: update factory to handle namespace setting refact: remove inline styling for grid class * ui: fix placement of filter in `SecureVariablesForm` (#13762) * refact: conditionally render css class * chore: remove unused CSS property * refact: edit path-input class to prevent textarea override * refact: inject missing store service (#13763) * chore: patch fixes for when no default namespace is available (#13782) * test: add tests for namespace filtering conditions (#13816) * test: add tests for namespace filtering and namespaces appearing in form * patch namespace related issue to saving and querying (#13825) * refact: use namespace id, not entity * refact: update adapter to edit request to include qp * ui: early exit if no snapshot * refact: test passes wrong interface to method * chore: add missing url update URL builder * refact: model in doesn't have absolutePath * Align error message * chore: update tests (#13905) * chore: patch brittle tests with better selectors * chore: update assertion count Co-authored-by: Phil Renaud <phil@riotindustries.com>
2022-07-22 20:05:35 +00:00
{{#if this.namespaceOptions}}
<SingleSelectDropdown
data-test-variable-namespace-filter
@label="Namespace"
@options={{this.namespaceOptions}}
@selection={{this.namespaceSelection}}
@onSelect={{this.setNamespace}}
/>
{{/if}}
<div class="button-bar">
{{#if (can "write variable" path=(concat this.absolutePath "/") namespace=this.namespaceSelection)}}
<LinkTo
@route="variables.new"
@query={{hash path=(concat this.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.isForbidden}}
<ForbiddenMessage />
{{else}}
{{#if this.model.treeAtPath}}
<VariablePaths
@branch={{this.model.treeAtPath}}
/>
{{else}}
<div class="empty-message">
{{#if (eq this.namespaceSelection "*")}}
<h3 data-test-empty-variables-list-headline class="empty-message-headline">
Path /{{this.absolutePath}} contains no variables
</h3>
<p class="empty-message-body">
To get started, <LinkTo @route="variables.new" @query={{hash path=(concat this.absolutePath "/")}}>create a new secure variable here</LinkTo>, or <LinkTo @route="variables">go back to the Secure Variables root directory</LinkTo>.
</p>
{{else}}
<h3 data-test-no-matching-variables-list-headline class="empty-message-headline">
No Matches
</h3>
<p class="empty-message-body">
No paths or variables match the namespace
<strong>
{{this.namespaceSelection}}
</strong>
</p>
{{/if}}
</div>
{{/if}}
{{/if}}
</section>