2020-07-09 09:08:47 +00:00
|
|
|
<DataLoader @items={{item}} @src={{concat '/' nspace '/' dc '/' type '/' src}} @onchange={{action "setData"}} @once={{true}}>
|
|
|
|
<BlockSlot @name="loaded">
|
|
|
|
|
|
|
|
<DataWriter
|
|
|
|
@sink={{concat '/' nspace '/' (or data.Datacenter dc) '/' type '/'}}
|
|
|
|
@type={{type}}
|
2020-07-20 17:04:43 +00:00
|
|
|
@label={{label}}
|
2020-07-09 09:08:47 +00:00
|
|
|
@ondelete={{action ondelete}}
|
|
|
|
@onchange={{action onsubmit}}
|
|
|
|
as |writer|>
|
|
|
|
|
|
|
|
{{#let (hash
|
|
|
|
data=data
|
|
|
|
change=(action "change")
|
|
|
|
isCreate=create
|
|
|
|
error=writer.error
|
|
|
|
disabled=writer.inflight
|
|
|
|
submit=(action writer.persist data)
|
|
|
|
delete=(action writer.delete data)
|
|
|
|
) as |api|}}
|
|
|
|
|
|
|
|
{{yield api}}
|
2020-07-20 17:04:43 +00:00
|
|
|
{{#if hasError}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<BlockSlot @name="error">
|
|
|
|
<YieldSlot @name="error">
|
|
|
|
{{yield api}}
|
|
|
|
</YieldSlot>
|
|
|
|
</BlockSlot>
|
2020-07-20 17:04:43 +00:00
|
|
|
{{/if}}
|
2020-07-09 09:08:47 +00:00
|
|
|
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
<YieldSlot @name="form">
|
|
|
|
{{yield api}}
|
|
|
|
</YieldSlot>
|
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
{{/let}}
|
|
|
|
|
|
|
|
</DataWriter>
|
|
|
|
|
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|