Skip to content

Commit

Permalink
chore(ui): disable saving flow actions if there are errors (#7278)
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosPaunovic authored Feb 10, 2025
1 parent a7a134a commit d486d78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ui/src/components/inputs/EditorButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@click="forwardEvent('save', $event)"
v-if="isAllowedEdit"
:type="buttonType"
:disabled="!haveChange && !isCreating"
:disabled="hasErrors || !haveChange && !isCreating"
class="edit-flow-save-button"
>
{{ $t("save") }}
Expand Down Expand Up @@ -106,6 +106,9 @@
}
},
computed: {
hasErrors(){
return this.errors && this.errors.length > 0;
},
buttonType() {
if (this.errors) {
return "danger";
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/inputs/EditorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
};
const save = async (e) => {
if (!haveChange.value && !props.isCreating) {
if (flowErrors.value?.length || !haveChange.value && !props.isCreating) {
return;
}
if (e) {
Expand Down

0 comments on commit d486d78

Please sign in to comment.