Add ability to add default values to workflow parameters (#865)

This commit is contained in:
Kerem Yilmaz
2024-09-20 04:53:51 -07:00
committed by GitHub
parent df463e042b
commit e9184bc399
10 changed files with 295 additions and 59 deletions

View File

@@ -45,10 +45,6 @@ function WorkflowRunParameters() {
? location.state.data
: workflowParameters?.reduce(
(acc, curr) => {
if (curr.workflow_parameter_type === "file_url") {
acc[curr.key] = null;
return acc;
}
if (curr.workflow_parameter_type === "json") {
if (typeof curr.default_value === "string") {
acc[curr.key] = curr.default_value;
@@ -59,6 +55,13 @@ function WorkflowRunParameters() {
return acc;
}
}
if (
curr.default_value &&
curr.workflow_parameter_type === "boolean"
) {
acc[curr.key] = Boolean(curr.default_value);
return acc;
}
if (curr.default_value) {
acc[curr.key] = curr.default_value;
return acc;