diff --git a/ui/src/components/flows/FlowRun.vue b/ui/src/components/flows/FlowRun.vue
index 1bafe59ecc..2f3ac02f2d 100644
--- a/ui/src/components/flows/FlowRun.vue
+++ b/ui/src/components/flows/FlowRun.vue
@@ -18,6 +18,7 @@
type="text"
:required="input.required"
:placeholder="`${placeholder} ${input.name}`"
+ :state="state(input)"
/>
+
+
+
+
+
{{ input.description }}
{{ $t('launch execution') }}
-
+
@@ -97,7 +140,22 @@
onSubmit() {
executeTask(this, this.flow, {redirect: this.redirect, id: this.flow.id, namespace: this.flow.namespace})
this.$emit("onExecutionTrigger")
+ },
+
+ state(input) {
+ const required = input.required === undefined ? true : input.required;
+
+ if (!required && input.value === undefined) {
+ return null;
+ }
+
+ if (required && input.value === undefined) {
+ return false;
+ }
+
+ return true;
}
+
}
};
diff --git a/ui/src/styles/layout/bootstrap.scss b/ui/src/styles/layout/bootstrap.scss
index 22ebc36fff..d4ecf2b90f 100644
--- a/ui/src/styles/layout/bootstrap.scss
+++ b/ui/src/styles/layout/bootstrap.scss
@@ -448,6 +448,14 @@ select {
}
}
+form {
+ .form-group {
+ .custom-checkbox {
+ top: 8px;
+ }
+ }
+}
+
.custom-file-label {
font-size: $input-font-size;
color: $input-placeholder-color;
diff --git a/ui/src/utils/submitTask.js b/ui/src/utils/submitTask.js
index 036d30e8a1..c20a84d7fc 100644
--- a/ui/src/utils/submitTask.js
+++ b/ui/src/utils/submitTask.js
@@ -1,9 +1,17 @@
+import Vue from "vue";
+
export const executeTask = (submitor, flow, options) => {
const formData = new FormData();
for (let input of flow.inputs || []) {
if (input.value !== undefined) {
if (input.type === "DATETIME") {
formData.append(input.name, input.value.toISOString());
+ } else if (input.type === "DATE") {
+ formData.append(input.name, Vue.moment(input.value).format("YYYY-MM-DD"));
+ } else if (input.type === "TIME") {
+ formData.append(input.name, Vue.moment(input.value).format("hh:mm:ss"));
+ } else if (input.type === "DURATION") {
+ formData.append(input.name, Vue.moment.duration(Vue.moment(input.value).format("hh:mm:ss")));
} else if (input.type === "FILE") {
formData.append("files", input.value, input.name);
} else {