Skip to content

Commit

Permalink
Tie up form validation to tab errors
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <[email protected]>
  • Loading branch information
torchiaf committed Sep 4, 2023
1 parent 976abbf commit 1c8f4b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dashboard/pkg/epinio/edit/applications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export default Vue.extend<Data, EpinioCompRecord, EpinioCompRecord, EpinioCompRe
showSourceTab() {
return this.mode === _EDIT;
},
validationPassed() {
return !Object.values(this.tabErrors).find((error) => error);
}
},
methods: {
Expand Down Expand Up @@ -197,6 +200,7 @@ export default Vue.extend<Data, EpinioCompRecord, EpinioCompRecord, EpinioCompRe
this.tabErrors[tab] = !value;
}
// UpdateSource wizard will save settings as well, needs to disable the button in case of errors
this.steps[0].ready = value;
}
},
Expand All @@ -212,7 +216,7 @@ export default Vue.extend<Data, EpinioCompRecord, EpinioCompRecord, EpinioCompRe
:mode="mode"
:resource="value"
:errors="errors"
:validation-passed="steps[0].ready"
:validation-passed="validationPassed"
@error="e=>errors = e"
@finish="save"
>
Expand Down

0 comments on commit 1c8f4b9

Please sign in to comment.