|
55 | 55 | {{#if this.showContent}} |
56 | 56 | {{! Show namespace list }} |
57 | 57 | {{#if this.hasNamespaces}} |
58 | | - <Toolbar class="top-margin-16"> |
| 58 | + <Toolbar class="top-margin-16 has-bottom-margin-s"> |
59 | 59 | <ToolbarFilters> |
60 | 60 | <FilterInputExplicit |
61 | 61 | @query={{@model.pageFilter}} |
|
81 | 81 | </ToolbarActions> |
82 | 82 | </Toolbar> |
83 | 83 |
|
84 | | - <ListView |
85 | | - @items={{@model.namespaces}} |
86 | | - @itemNoun="namespace" |
87 | | - @paginationRouteName="vault.cluster.access.namespaces" |
88 | | - @onPageChange={{this.handlePageChange}} |
89 | | - as |list| |
90 | | - > |
91 | | - {{#if @model.namespaces.length}} |
92 | | - <ListItem as |Item|> |
93 | | - <Item.content> |
94 | | - {{list.item.id}} |
95 | | - </Item.content> |
96 | | - <Item.menu> |
97 | | - <Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|> |
98 | | - <dd.ToggleIcon |
99 | | - @icon="more-horizontal" |
100 | | - @text="More options" |
101 | | - @hasChevron={{false}} |
102 | | - data-test-popup-menu-trigger |
103 | | - /> |
104 | | - {{#let (concat this.namespace.path (if this.namespace.path "/") list.item.id) as |targetNamespace|}} |
105 | | - {{#if (includes targetNamespace this.namespace.accessibleNamespaces)}} |
106 | | - <dd.Interactive |
107 | | - {{on "click" (fn this.switchNamespace targetNamespace)}} |
108 | | - data-test-popup-menu="switch" |
109 | | - >Switch to namespace</dd.Interactive> |
110 | | - {{/if}} |
111 | | - {{/let}} |
112 | | - <dd.Interactive |
113 | | - @color="critical" |
114 | | - {{on "click" (fn (mut this.nsToDelete) list.item)}} |
115 | | - data-test-popup-menu="delete" |
116 | | - >Delete</dd.Interactive> |
117 | | - </Hds::Dropdown> |
118 | | - {{#if (eq this.nsToDelete list.item)}} |
119 | | - <ConfirmModal |
120 | | - @color="critical" |
121 | | - @onClose={{fn (mut this.nsToDelete) null}} |
122 | | - @onConfirm={{fn this.deleteNamespace list.item}} |
123 | | - @confirmTitle="Delete this namespace?" |
124 | | - @confirmMessage="Any engines or mounts in this namespace will also be removed." |
125 | | - /> |
126 | | - {{/if}} |
127 | | - </Item.menu> |
128 | | - </ListItem> |
129 | | - {{else}} |
130 | | - <list.empty class="top-padding-32 is-marginless" data-test-list-view-empty-state as |A|> |
131 | | - <A.Header @title={{list.emptyTitle}} @titleTag="h2" data-test-empty-state-title /> |
132 | | - <A.Body @text={{list.emptyMessage}} data-test-empty-state-message /> |
133 | | - <A.Footer data-test-empty-state-actions as |F|> |
134 | | - <F.LinkStandalone |
135 | | - @icon="learn-link" |
136 | | - @text="Secure multi-tenancy with namespaces tutorial" |
137 | | - @href={{doc-link "/vault/tutorials/enterprise/namespaces"}} |
| 84 | + {{#if @model.namespaces.length}} |
| 85 | + <ListTable @columns={{this.tableColumns}} @data={{this.namespaceIds}}> |
| 86 | + <:popupMenu as |rowData|> |
| 87 | + <Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|> |
| 88 | + <dd.ToggleIcon |
| 89 | + @icon="more-horizontal" |
| 90 | + @text="More options" |
| 91 | + @hasChevron={{false}} |
| 92 | + data-test-popup-menu-trigger |
138 | 93 | /> |
139 | | - </A.Footer> |
140 | | - </list.empty> |
141 | | - {{/if}} |
142 | | - </ListView> |
| 94 | + {{#let (concat this.namespace.path (if this.namespace.path "/") rowData.id) as |targetNamespace|}} |
| 95 | + {{#if (includes targetNamespace this.namespace.accessibleNamespaces)}} |
| 96 | + <dd.Interactive |
| 97 | + {{on "click" (fn this.switchNamespace targetNamespace)}} |
| 98 | + data-test-popup-menu="switch" |
| 99 | + >Switch to namespace</dd.Interactive> |
| 100 | + {{/if}} |
| 101 | + {{/let}} |
| 102 | + <dd.Interactive |
| 103 | + @color="critical" |
| 104 | + {{on "click" (fn (mut this.nsToDelete) rowData.id)}} |
| 105 | + data-test-popup-menu="delete" |
| 106 | + >Delete</dd.Interactive> |
| 107 | + </Hds::Dropdown> |
| 108 | + {{#if (eq this.nsToDelete rowData.id)}} |
| 109 | + <ConfirmModal |
| 110 | + @color="critical" |
| 111 | + @onClose={{fn (mut this.nsToDelete) null}} |
| 112 | + @onConfirm={{fn this.deleteNamespace rowData.id}} |
| 113 | + @confirmTitle="Delete this namespace?" |
| 114 | + @confirmMessage="Any engines or mounts in this namespace will also be removed." |
| 115 | + /> |
| 116 | + {{/if}} |
| 117 | + </:popupMenu> |
| 118 | + </ListTable> |
| 119 | + {{else}} |
| 120 | + <Hds::ApplicationState class="top-padding-32 is-marginless" as |A|> |
| 121 | + <A.Header @title="No Namespaces found" @titleTag="h2" data-test-empty-state-title /> |
| 122 | + </Hds::ApplicationState> |
| 123 | + {{/if}} |
143 | 124 | {{else}} |
144 | 125 | {{! Show empty state }} |
145 | 126 | {{#if this.showSetupAlert}} |
|
0 commit comments