mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-15 02:57:04 +02:00
pass emptyActions through list view component and render into EmptyState
This commit is contained in:
parent
868eca5c99
commit
1036b29890
2
ui/app/components/empty-action-namespaces.js
Normal file
2
ui/app/components/empty-action-namespaces.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import OuterHTML from './outer-html';
|
||||||
|
export default OuterHTML.extend();
|
@ -6,6 +6,9 @@ export default Component.extend({
|
|||||||
tagName: '',
|
tagName: '',
|
||||||
items: null,
|
items: null,
|
||||||
itemNoun: 'item',
|
itemNoun: 'item',
|
||||||
|
// the dasherized name of a component to render
|
||||||
|
// in the EmptyState component if there are no items in items.length
|
||||||
|
emptyActions: '',
|
||||||
|
|
||||||
emptyTitle: computed('itemNoun', function() {
|
emptyTitle: computed('itemNoun', function() {
|
||||||
let items = pluralize(this.get('itemNoun'));
|
let items = pluralize(this.get('itemNoun'));
|
||||||
|
7
ui/app/templates/components/empty-action-namespaces.hbs
Normal file
7
ui/app/templates/components/empty-action-namespaces.hbs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{{#link-to "vault.cluster.access.namespaces.create"}}
|
||||||
|
Create namespace
|
||||||
|
{{/link-to}}
|
||||||
|
|
||||||
|
<LearnLink @path="/vault/security/namespaces">
|
||||||
|
Learn More
|
||||||
|
</LearnLink>
|
@ -9,9 +9,13 @@
|
|||||||
</p>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if hasBlock}}
|
{{#if hasBlock}}
|
||||||
<div class="empty-state-actions">
|
<div class="empty-state-actions">
|
||||||
{{yield}}
|
{{yield}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else if emptyActions}}
|
||||||
|
<div class="empty-state-actions">
|
||||||
|
{{component emptyActions}}
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<EmptyState
|
<EmptyState
|
||||||
@title={{emptyTitle}}
|
@title={{this.emptyTitle}}
|
||||||
@message={{emptyMessage}}
|
@message={{this.emptyMessage}}
|
||||||
|
@emptyActions={{this.emptyActions}}
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</p.levelRight>
|
</p.levelRight>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<ListView @items={{model}} @itemNoun="namespace" as |list|>
|
<ListView @items={{model}} @itemNoun="namespace" @emptyActions="empty-action-namespaces" as |list|>
|
||||||
<ListItem as |Item|>
|
<ListItem as |Item|>
|
||||||
<Item.content>
|
<Item.content>
|
||||||
{{list.item.id}}
|
{{list.item.id}}
|
||||||
|
Loading…
Reference in New Issue
Block a user