mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
adds validation to kubernetes config form (#19097)
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
|
||||
<hr class="has-background-gray-200 has-top-margin-l" />
|
||||
|
||||
<div class="has-top-margin-s has-bottom-margin-s">
|
||||
<div class="has-top-margin-s has-bottom-margin-s is-flex">
|
||||
<button
|
||||
data-test-config-save
|
||||
class="button is-primary"
|
||||
@@ -92,6 +92,9 @@
|
||||
>
|
||||
Back
|
||||
</button>
|
||||
{{#if this.alert}}
|
||||
<AlertInline @type="danger" @paddingTop={{true}} @message={{this.alert}} @mimicRefresh={{true}} data-test-alert />
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if this.showConfirm}}
|
||||
|
||||
@@ -18,6 +18,7 @@ export default class ConfigurePageComponent extends Component {
|
||||
|
||||
@tracked inferredState;
|
||||
@tracked modelValidations;
|
||||
@tracked alert;
|
||||
@tracked error;
|
||||
@tracked showConfirm;
|
||||
|
||||
@@ -64,6 +65,14 @@ export default class ConfigurePageComponent extends Component {
|
||||
return;
|
||||
}
|
||||
this.showConfirm = false;
|
||||
|
||||
const { isValid, state, invalidFormMessage } = yield this.args.model.validate();
|
||||
if (!isValid) {
|
||||
this.modelValidations = state;
|
||||
this.alert = invalidFormMessage;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
yield this.args.model.save();
|
||||
this.leave('configuration');
|
||||
|
||||
Reference in New Issue
Block a user