Skip to content

Commit 95ea653

Browse files
committed
fix(ui): better inputs validation for backfill
close #7008
1 parent f1e2eea commit 95ea653

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

Diff for: ui/src/components/flows/FlowTriggers.vue

+19-18
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
<el-button
191191
type="primary"
192192
@click="postBackfill()"
193-
:disabled="checkBackfill()"
193+
:disabled="checkBackfill"
194194
>
195195
{{ $t("execute backfill") }}
196196
</el-button>
@@ -293,22 +293,6 @@
293293
},
294294
cleanBackfill() {
295295
return {...this.backfill, labels: this.backfill.labels.filter(label => label.key && label.value)}
296-
}
297-
},
298-
methods: {
299-
userCan(action) {
300-
return this.user.isAllowed(permission.EXECUTION, action ? action : action.READ, this.flow.namespace);
301-
},
302-
loadData() {
303-
if(!this.triggersWithType.length) return;
304-
305-
this.$store
306-
.dispatch("trigger/find", {namespace: this.flow.namespace, flowId: this.flow.id, size: this.triggersWithType.length})
307-
.then(triggers => this.triggers = triggers.results);
308-
},
309-
setBackfillModal(trigger, bool) {
310-
this.isBackfillOpen = bool
311-
this.selectedTrigger = trigger
312296
},
313297
checkBackfill() {
314298
if (!this.backfill.start) {
@@ -319,11 +303,12 @@
319303
}
320304
if (this.flow.inputs) {
321305
const requiredInputs = this.flow.inputs.map(input => input.required !== false ? input.id : null).filter(i => i !== null)
306+
322307
if (requiredInputs.length > 0) {
323308
if (!this.backfill.inputs) {
324309
return true
325310
}
326-
const fillInputs = Object.keys(this.backfill.inputs).filter(i => this.backfill.inputs[i])
311+
const fillInputs = Object.keys(this.backfill.inputs).filter(i => this.backfill.inputs[i] !== null && this.backfill.inputs[i] !== undefined);
327312
if (requiredInputs.sort().join(",") !== fillInputs.sort().join(",")) {
328313
return true
329314
}
@@ -338,6 +323,22 @@
338323
}
339324
return false
340325
},
326+
},
327+
methods: {
328+
userCan(action) {
329+
return this.user.isAllowed(permission.EXECUTION, action ? action : action.READ, this.flow.namespace);
330+
},
331+
loadData() {
332+
if(!this.triggersWithType.length) return;
333+
334+
this.$store
335+
.dispatch("trigger/find", {namespace: this.flow.namespace, flowId: this.flow.id, size: this.triggersWithType.length})
336+
.then(triggers => this.triggers = triggers.results);
337+
},
338+
setBackfillModal(trigger, bool) {
339+
this.isBackfillOpen = bool
340+
this.selectedTrigger = trigger
341+
},
341342
postBackfill() {
342343
this.$store.dispatch("trigger/update", {
343344
...this.selectedTrigger,

0 commit comments

Comments
 (0)