UI/control groups kv (#11143)
* forced reload causing issues removed and tested * better logging for handling controlGroup error * cleanup * add changelog * address pr comments
This commit is contained in:
parent
a9232bf399
commit
b52620e039
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: Fix error message caused by control group
|
||||||
|
```
|
|
@ -9,6 +9,7 @@ import WithNavToNearestAncestor from 'vault/mixins/with-nav-to-nearest-ancestor'
|
||||||
import keys from 'vault/lib/keycodes';
|
import keys from 'vault/lib/keycodes';
|
||||||
import KVObject from 'vault/lib/kv-object';
|
import KVObject from 'vault/lib/kv-object';
|
||||||
import { maybeQueryRecord } from 'vault/macros/maybe-query-record';
|
import { maybeQueryRecord } from 'vault/macros/maybe-query-record';
|
||||||
|
import ControlGroupError from 'vault/lib/control-group-error';
|
||||||
|
|
||||||
const LIST_ROUTE = 'vault.cluster.secrets.backend.list';
|
const LIST_ROUTE = 'vault.cluster.secrets.backend.list';
|
||||||
const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root';
|
const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root';
|
||||||
|
@ -16,6 +17,7 @@ const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';
|
||||||
|
|
||||||
export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
||||||
wizard: service(),
|
wizard: service(),
|
||||||
|
controlGroup: service(),
|
||||||
router: service(),
|
router: service(),
|
||||||
store: service(),
|
store: service(),
|
||||||
flashMessages: service(),
|
flashMessages: service(),
|
||||||
|
@ -197,7 +199,9 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
||||||
secretData.set(secretData.pathAttr, key);
|
secretData.set(secretData.pathAttr, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
return secretData.save().then(() => {
|
return secretData
|
||||||
|
.save()
|
||||||
|
.then(() => {
|
||||||
if (!secretData.isError) {
|
if (!secretData.isError) {
|
||||||
if (isV2) {
|
if (isV2) {
|
||||||
secret.set('id', key);
|
secret.set('id', key);
|
||||||
|
@ -216,6 +220,13 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
||||||
this.saveComplete(successCallback, key);
|
this.saveComplete(successCallback, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error instanceof ControlGroupError) {
|
||||||
|
let errorMessage = this.controlGroup.logFromError(error);
|
||||||
|
this.set('error', errorMessage.content);
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveComplete(callback, key) {
|
saveComplete(callback, key) {
|
||||||
|
|
Loading…
Reference in New Issue