Skip to content

Commit

Permalink
🔨: add step error on FormTool and fix errors on empty configForm
Browse files Browse the repository at this point in the history
  • Loading branch information
itisAliRH committed Jun 10, 2024
1 parent bc65803 commit 96c3c5c
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions client/src/components/Workflow/Editor/Forms/FormTool.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
<template>
<ToolCard
v-if="hasData"
:id="configForm.id"
:version="configForm.version"
:title="configForm.name"
:description="configForm.description"
:id="configForm?.id || ''"
:version="configForm?.version"
:title="configForm?.name || step.name"
:description="configForm?.description"
:options="configForm"
:message-text="messageText"
:message-variant="messageVariant"
:step-error="step.errors"
@onChangeVersion="onChangeVersion"
@onUpdateFavorites="onUpdateFavorites">
<template v-slot:body>
<FormElement
v-if="hasData"
id="__label"
:value="label"
title="Label"
help="Add a step label."
:error="uniqueErrorLabel"
@input="onLabel" />
<FormElement
v-if="hasData"
id="__annotation"
:value="annotation"
title="Step Annotation"
:area="true"
help="Add an annotation or notes to this step. Annotations are available when a workflow is viewed."
@input="onAnnotation" />
<FormConditional :step="step" @onUpdateStep="(id, step) => $emit('onUpdateStep', id, step)" />
<div class="mt-2 mb-4">
<FormConditional
v-if="hasData"
:step="step"
@onUpdateStep="(id, step) => $emit('onUpdateStep', id, step)" />
<div v-if="inputs.length" class="mt-2 mb-4">
<Heading h2 separator bold size="sm"> Tool Parameters </Heading>
<FormDisplay
:id="id"
Expand All @@ -38,7 +43,7 @@
:workflow-building-mode="true"
@onChange="onChange" />
</div>
<div class="mt-2 mb-4">
<div v-if="stepOutputs.length" class="mt-2 mb-4">
<Heading h2 separator bold size="sm"> Additional Options </Heading>
<FormSection
:id="stepId"
Expand Down Expand Up @@ -141,7 +146,12 @@ export default {
return !!this.configForm?.id;
},
inputs() {
const inputs = this.configForm.inputs;
const inputs = this.configForm?.inputs;
if (!inputs) {
return [];
}
Utils.deepEach(inputs, (input) => {
if (input.type) {
if (["data", "data_collection"].indexOf(input.type) != -1) {
Expand Down Expand Up @@ -169,7 +179,7 @@ export default {
return inputs;
},
errors() {
return this.configForm.errors;
return this.configForm?.errors || { ...this.step.errors };
},
},
methods: {
Expand Down

0 comments on commit 96c3c5c

Please sign in to comment.