ui: Ensure datacenter is sent to the API when loading in a policy panel (#7910)

* ui: Policies don't have datacenter properties, use the URL dc instead.

* ui: Ensure policy saving proxy object is destroyed
This commit is contained in:
John Cowen 2020-05-19 14:51:39 +01:00 committed by hashicorp-ci
parent c96b31e562
commit 6627709a03
2 changed files with 6 additions and 2 deletions

View File

@ -76,9 +76,13 @@ export default Component.extend(SlotsMixin, WithListeners, {
items, items,
e.data, e.data,
]); ]);
item.willDestroy();
success(); success();
}, },
error: e => this.error(e), error: e => {
item.willDestroy();
this.error(e);
},
}); });
}, },
remove: function(item, items) { remove: function(item, items) {

View File

@ -59,7 +59,7 @@
<BlockSlot @name="details"> <BlockSlot @name="details">
{{#if (eq item.template '')}} {{#if (eq item.template '')}}
<DataSource <DataSource
@src={{concat '/' item.Namespace '/' item.Datacenter '/policy/' item.ID}} @src={{concat '/' item.Namespace '/' dc '/policy/' item.ID}}
@onchange={{action (mut loadedItem) value="data"}} @onchange={{action (mut loadedItem) value="data"}}
@loading="lazy" @loading="lazy"
/> />