pass emptyActions through list view component and render into EmptyState
This commit is contained in:
parent
d72c7db57e
commit
9e280fb198
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: '',
|
||||
items: null,
|
||||
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() {
|
||||
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>
|
||||
{{/if}}
|
||||
{{#if hasBlock}}
|
||||
<div class="empty-state-actions">
|
||||
{{yield}}
|
||||
</div>
|
||||
<div class="empty-state-actions">
|
||||
{{yield}}
|
||||
</div>
|
||||
{{else if emptyActions}}
|
||||
<div class="empty-state-actions">
|
||||
{{component emptyActions}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
</div>
|
||||
{{else}}
|
||||
<EmptyState
|
||||
@title={{emptyTitle}}
|
||||
@message={{emptyMessage}}
|
||||
@title={{this.emptyTitle}}
|
||||
@message={{this.emptyMessage}}
|
||||
@emptyActions={{this.emptyActions}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{/link-to}}
|
||||
</p.levelRight>
|
||||
</PageHeader>
|
||||
<ListView @items={{model}} @itemNoun="namespace" as |list|>
|
||||
<ListView @items={{model}} @itemNoun="namespace" @emptyActions="empty-action-namespaces" as |list|>
|
||||
<ListItem as |Item|>
|
||||
<Item.content>
|
||||
{{list.item.id}}
|
||||
|
|
Loading…
Reference in a new issue