Skip to content

Commit

Permalink
#437 fixed remaining validation errors on script change
Browse files Browse the repository at this point in the history
  • Loading branch information
bugy committed May 7, 2021
1 parent 154a862 commit 5ff01b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions web-src/src/main-app/components/scripts/script-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div v-if="hasErrors" v-show="!hideExecutionControls" class="validation-panel">
<h6 class="header">Validation failed. Errors list:</h6>
<ul class="validation-errors-list">
<li v-for="error in errors">{{ error }}</li>
<li v-for="error in shownErrors">{{ error }}</li>
</ul>
</div>
<div v-if="downloadableFiles && (downloadableFiles.length > 0) && !scheduleMode" v-show="!hideExecutionControls"
Expand Down Expand Up @@ -72,7 +72,7 @@ export default {
return {
id: null,
everStarted: false,
errors: [],
shownErrors: [],
nextLogIndex: 0,
lastInlineImages: {},
scheduleMode: false,
Expand Down Expand Up @@ -112,7 +112,7 @@ export default {
...mapState('scripts', ['selectedScript']),
hasErrors: function () {
return !isNull(this.errors) && (this.errors.length > 0);
return !isNull(this.shownErrors) && (this.shownErrors.length > 0);
},
formattedDescription: function () {
Expand Down Expand Up @@ -263,12 +263,12 @@ export default {
},
validatePreExecution: function () {
this.errors = [];
this.shownErrors = [];
const errors = this.parameterErrors;
if (!isEmptyObject(errors)) {
forEachKeyValue(errors, (paramName, error) => {
this.errors.push(paramName + ': ' + error);
this.shownErrors.push(paramName + ': ' + error);
});
return false;
}
Expand Down Expand Up @@ -402,6 +402,8 @@ export default {
scriptConfig: {
immediate: true,
handler() {
this.shownErrors = []
this.$nextTick(() => {
// 200 is a rough height for headers,buttons, description, etc.
const otherElemsHeight = 200;
Expand Down

0 comments on commit 5ff01b0

Please sign in to comment.