Skip to content

Commit 20e4e12

Browse files
beaginsE_Esmaeili
authored andcommitted
[VAULT-34216] UI: Namespace picker feature branch (hashicorp#30490)
1 parent 29047ff commit 20e4e12

File tree

17 files changed

+821
-459
lines changed

17 files changed

+821
-459
lines changed

changelog/30490.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:feature
2+
**Vault Namespace Picker**: Updating the Vault Namespace Picker to enable search functionality, allow direct navigation to nested namespaces and improve accessibility.
3+
```
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{{!
2+
Copyright (c) HashiCorp, Inc.
3+
SPDX-License-Identifier: BUSL-1.1
4+
}}
5+
6+
<div class="top-padding-4 has-bottom-padding-4 has-side-padding-8" ...attributes>
7+
<Hds::Dropdown @enableCollisionDetection={{true}} as |D|>
8+
9+
<D.ToggleButton @icon="org" @text={{or this.selected.id "-"}} @isFullWidth={{true}} data-test-namespace-toggle />
10+
11+
{{#if this.errorLoadingNamespaces}}
12+
13+
<D.Header>
14+
<MessageError @errorMessage={{this.errorLoadingNamespaces}} />
15+
</D.Header>
16+
17+
{{else}}
18+
19+
<D.Header @hasDivider={{true}}>
20+
<div class="has-padding-8">
21+
<Hds::Form::TextInput::Field
22+
@value={{this.searchInput}}
23+
@type="search"
24+
aria-label="Search namespaces"
25+
placeholder="Search"
26+
{{on "keydown" this.onKeyDown}}
27+
{{on "input" this.onSearchInput}}
28+
{{did-insert this.focusSearchInput}}
29+
/>
30+
</div>
31+
</D.Header>
32+
33+
<D.Header>
34+
{{#if (and this.hasSearchInput (not this.showNoNamespacesMessage))}}
35+
<div class="sub-text has-padding-8">
36+
{{this.searchInputHelpText}}
37+
</div>
38+
{{/if}}
39+
40+
<div class="is-size-8 has-text-black has-text-weight-semibold has-padding-8">
41+
{{this.namespaceLabel}}
42+
<Hds::BadgeCount @text={{or this.namespaceCount 0}} />
43+
</div>
44+
</D.Header>
45+
46+
{{#if this.showNoNamespacesMessage}}
47+
<D.Generic class="sub-text">
48+
{{this.noNamespacesMessage}}
49+
</D.Generic>
50+
{{/if}}
51+
52+
<div class="is-overflow-y-auto is-max-drawer-height" {{did-insert this.setupScrollListener}}>
53+
{{#each this.visibleNamespaceOptions as |option|}}
54+
<D.Checkmark
55+
@selected={{eq option.id this.selected.id}}
56+
{{on "click" (fn this.onChange option)}}
57+
data-test-namespace-link={{option.path}}
58+
>
59+
{{option.label}}
60+
</D.Checkmark>
61+
{{/each}}
62+
</div>
63+
64+
{{/if}}
65+
66+
<D.Footer @hasDivider={{true}} class="is-flex-center">
67+
<Hds::ButtonSet class="is-fullwidth">
68+
{{#if this.canRefreshNamespaces}}
69+
<Hds::Button
70+
@color="secondary"
71+
@text="Refresh list"
72+
@isFullWidth={{(not this.canManageNamespaces)}}
73+
{{on "click" this.refreshList}}
74+
data-test-refresh-namespaces
75+
/>
76+
{{/if}}
77+
{{#if this.canManageNamespaces}}
78+
<Hds::Button
79+
@color="secondary"
80+
@text="Manage"
81+
@isFullWidth={{(not this.canRefreshNamespaces)}}
82+
@icon="settings"
83+
@route="vault.cluster.access.namespaces"
84+
data-test-manage-namespaces
85+
/>
86+
{{/if}}
87+
</Hds::ButtonSet>
88+
89+
</D.Footer>
90+
91+
</Hds::Dropdown>
92+
</div>

ui/app/components/namespace-picker.js

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)