2020-07-09 09:08:47 +00:00
|
|
|
<DataLoader @src={{concat '/' nspace '/' dc '/intentions/for-service/' slug}} as |api|>
|
|
|
|
<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-07-09 09:08:47 +00:00
|
|
|
<ConsulIntentionList
|
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"
|
|
|
|
>
|
|
|
|
<EmptyState>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
2020-09-01 18:13:11 +00:00
|
|
|
There are no intentions {{if (gt items.length 0) 'found '}} for this service.
|
2020-07-09 09:08:47 +00:00
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</ConsulIntentionList>
|
|
|
|
</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>
|