2023-04-10 15:36:59 +00:00
{{ !
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
2022-08-29 18:45:49 +00:00
{{ page-title "Variables: " this .absolutePath }}
2022-06-07 01:42:23 +00:00
{{ # 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">
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 }}
2022-06-07 01:42:23 +00:00
<div class="button-bar">
2022-08-15 15:56:09 +00:00
{{ # 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"
>
2022-08-29 18:45:49 +00:00
Create Variable
2022-08-15 15:56:09 +00:00
</LinkTo>
{{ else }}
<button
class="button is-primary is-disabled tooltip is-right-aligned"
aria-label="You don’ t have sufficient permissions"
disabled
type="button"
>
2022-08-29 18:45:49 +00:00
Create Variable
2022-08-15 15:56:09 +00:00
</button>
{{ / if }}
2022-06-07 01:42:23 +00:00
</div>
</div>
</div>
2022-08-15 15:56:09 +00:00
{{ # if this .isForbidden }}
<ForbiddenMessage />
2022-08-08 16:44:38 +00:00
{{ else }}
2022-08-15 15:56:09 +00:00
{{ # 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">
2022-08-29 18:45:49 +00:00
To get started, <LinkTo @route="variables.new" @query= {{ hash path = ( concat this .absolutePath "/" ) }} >create a new variable here</LinkTo>, or <LinkTo @route="variables">go back to the Variables root directory</LinkTo>.
2022-08-15 15:56:09 +00:00
</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 }}
2022-08-08 16:44:38 +00:00
{{ / if }}
2022-06-07 01:42:23 +00:00
</section>