2020-09-18 10:14:06 +00:00
|
|
|
<DataLoader @src={{uri nspace dc 'intentions' 'for-service' slug}} as |api|>
|
2020-07-09 09:08:47 +00:00
|
|
|
<BlockSlot @name="error">
|
|
|
|
<ErrorState @error={{api.error}} />
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="loaded">
|
2020-09-01 18:13:11 +00:00
|
|
|
{{#let api.data as |items|}}
|
|
|
|
{{#let (hash
|
|
|
|
accesses=(if access (split access ',') undefined)
|
|
|
|
) as |filters|}}
|
2020-08-11 17:02:51 +00:00
|
|
|
{{#let (or sortBy "Action:asc") as |sort|}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<div id="intentions" class="tab-section">
|
|
|
|
<div role="tabpanel">
|
|
|
|
<Portal @target="app-view-actions">
|
|
|
|
<a data-test-create href={{href-to 'dc.services.show.intentions.create'}} class="type-create">Create</a>
|
|
|
|
</Portal>
|
2020-09-01 18:13:11 +00:00
|
|
|
{{#if (gt items.length 0) }}
|
|
|
|
<ConsulIntentionSearchBar
|
|
|
|
@search={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
|
|
|
|
|
|
|
@sort={{sort}}
|
|
|
|
@onsort={{action (mut sortBy) value="target.selected"}}
|
|
|
|
|
|
|
|
@filter={{filters}}
|
|
|
|
@onfilter={{hash
|
|
|
|
access=(action (mut access) value="target.selectedItems")
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
{{#let (filter (filter-predicate 'intention' filters) items) as |filtered|}}
|
|
|
|
{{#let (sort-by (comparator 'intention' sort) filtered) as |sorted|}}
|
2020-08-11 17:02:51 +00:00
|
|
|
<ChangeableSet @dispatcher={{searchable 'intention' sorted}} @terms={{search}}>
|
2020-09-01 18:13:11 +00:00
|
|
|
<BlockSlot @name="content" as |searched|>
|
2020-10-09 14:47:36 +00:00
|
|
|
|
|
|
|
<Consul::Intention::List
|
2020-09-01 18:13:11 +00:00
|
|
|
@items={{searched}}
|
2020-07-09 09:08:47 +00:00
|
|
|
@ondelete={{refresh-route}}
|
|
|
|
@routeName="dc.services.show.intentions.edit"
|
2020-10-09 14:47:36 +00:00
|
|
|
>
|
|
|
|
<:idle as |list|>
|
|
|
|
{{#if (eq searched.length 1)}}
|
|
|
|
{{#let searched.firstObject as |item|}}
|
|
|
|
{{#if (eq search item.SourceName)}}
|
|
|
|
<list.Check @item={{item}} />
|
|
|
|
{{/if}}
|
|
|
|
{{/let}}
|
|
|
|
{{/if}}
|
|
|
|
<list.Table />
|
|
|
|
</:idle>
|
|
|
|
<:empty as |list|>
|
|
|
|
<EmptyState>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
There are no intentions {{if (gt items.length 0) 'found '}} for this service.
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</:empty>
|
|
|
|
</Consul::Intention::List>
|
|
|
|
|
2020-07-09 09:08:47 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</ChangeableSet>
|
2020-09-01 18:13:11 +00:00
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|
2020-07-09 09:08:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-01 18:13:11 +00:00
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|
2020-07-09 09:08:47 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|