Skip to content
Snippets Groups Projects
Verified Commit f45ab60f authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Send default hidden parameters when starting a workflow execution

#63
parent 1ba9ffcb
No related branches found
No related tags found
1 merge request!57Resolve "Support Workflow Modes"
......@@ -17,22 +17,13 @@ type ParameterGroup = {
};
const navParameterGroups = computed<ParameterGroup[]>(() =>
Object.keys(parameterGroups.value)
.map((group) => {
return {
group: group,
title: parameterGroups.value[group]["title"],
icon: parameterGroups.value[group]["fa_icon"],
};
})
.filter(
// filter all groups that have only hidden parameters
(group) =>
Object.keys(parameterGroups.value[group.group]["properties"]).filter(
(key) =>
!parameterGroups.value[group.group]["properties"][key]["hidden"],
).length > 0,
),
Object.keys(parameterGroups.value).map((group) => {
return {
group: group,
title: parameterGroups.value[group]["title"],
icon: parameterGroups.value[group]["fa_icon"],
};
}),
);
const parameterGroups = computed<Record<string, never>>(
......
......@@ -78,22 +78,13 @@ const parameterGroups = computed<Record<string, never>>(
// Create a list with the names of all parameter groups
const navParameterGroups = computed<ParameterGroup[]>(() =>
Object.keys(parameterGroups.value)
.map((group) => {
return {
group: group,
title: parameterGroups.value[group]["title"],
icon: parameterGroups.value[group]["fa_icon"],
};
})
.filter(
// filter all groups that have only hidden parameters
(group) =>
Object.keys(parameterGroups.value[group.group]["properties"]).filter(
(key) =>
!parameterGroups.value[group.group]["properties"][key]["hidden"],
).length > 0,
),
Object.keys(parameterGroups.value).map((group) => {
return {
group: group,
title: parameterGroups.value[group]["title"],
icon: parameterGroups.value[group]["fa_icon"],
};
}),
);
// Watchers
......@@ -115,14 +106,13 @@ function updateSchema(schema: Record<string, any>) {
const b = Object.keys(schema["definitions"]).map((groupName) => [
groupName,
Object.fromEntries(
Object.entries(schema["definitions"][groupName]["properties"])
// @ts-ignore
.filter(([_, parameter]) => !parameter["hidden"])
.map(([parameterName, parameter]) => [
Object.entries(schema["definitions"][groupName]["properties"]).map(
([parameterName, parameter]) => [
parameterName,
// @ts-ignore
parameter["default"],
]),
],
),
),
]);
formState.formInput = Object.fromEntries(b);
......
......@@ -32,7 +32,7 @@ const defaultValue = computed<string | undefined>(
const enumValues = computed<string[] | undefined>(
() => props.parameter["enum"]?.map((val: string) => val.toString()),
);
const hidden = computed<boolean>(() => props.parameter["hidden"] ?? false);
// const hidden = computed<boolean>(() => props.parameter["hidden"] ?? false);
const parameterPattern = computed<string | undefined>(
() => props.parameter["pattern"],
);
......@@ -48,7 +48,6 @@ const showRightColum = computed<boolean>(
<template>
<div
class="row border-top border-bottom border-secondary align-items-start py-2"
v-if="!hidden"
>
<div class="fs-6 col-3">
<font-awesome-icon :icon="icon" v-if="icon" class="me-2" />
......
......@@ -20,19 +20,22 @@ const props = defineProps({
const title = computed<string>(() => props.parameterGroup["title"]);
const icon = computed<string>(() => props.parameterGroup["fa_icon"]);
const description = computed<string>(() => props.parameterGroup["description"]);
/*
const groupHidden = computed<boolean>(() =>
Object.keys(parameters.value).reduce(
(acc: boolean, val: string) => acc && parameters.value[val]["hidden"],
true,
),
);
*/
const parameters = computed<Record<string, never>>(
() => props.parameterGroup["properties"],
);
</script>
<template>
<div class="mb-5" v-if="!groupHidden">
<div class="mb-5">
<div class="row">
<h2 :id="props.parameterGroupName">
<font-awesome-icon :icon="icon" class="me-3" v-if="icon" />{{ title }}
......
......@@ -71,7 +71,7 @@ watch(
</script>
<template>
<div class="card mb-3" v-if="!groupHidden">
<div class="card mb-3" :hidden="groupHidden">
<h2 class="card-header" :id="props.parameterGroupName">
<font-awesome-icon :icon="icon" class="me-2" v-if="icon" />
{{ title }}
......@@ -82,7 +82,7 @@ watch(
v-for="(parameter, parameterName) in parameters"
:key="parameterName"
>
<template v-if="!parameter['hidden']">
<div :hidden="parameter['hidden']">
<div class="input-group">
<span class="input-group-text" :id="parameterName + '-help'">
<font-awesome-icon
......@@ -170,7 +170,7 @@ watch(
</p>
</div>
</div>
</template>
</div>
</template>
</div>
</div>
......
......@@ -73,6 +73,7 @@ function startWorkflow(
parameters: parameters,
notes: notes,
report_output_bucket: report_output_bucket,
mode: props.workflowModeId,
})
.then(() => {
router.push({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment