Skip to content

Commit

Permalink
Return null instead of empty string in unique label validator
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Sep 17, 2024
1 parent 02726ab commit 13baa9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Form/FormElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const isOptional = computed(() => !isRequired.value && attrs.value["optional"] !
const formAlert = ref<string>();
const alerts = computed(() => {
return [formAlert.value, props.error, props.warning]
.filter((v) => v !== undefined && v !== null && v !== "")
.filter((v) => v !== undefined && v !== null)
.map((v) => linkify(sanitize(v!, { USE_PROFILES: { html: true } })));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ export function useUniqueLabelError(
workflowStateStore: ReturnType<typeof useWorkflowStepStore>,
label: string | null | undefined
) {
const error = ref("");
const error = ref<string | null>(null);
if (label && workflowStateStore.workflowOutputs[label]) {
error.value = `Duplicate label ${label}. Please fix this before saving the workflow.`;
} else {
error.value = "";
}
return error;
}

0 comments on commit 13baa9e

Please sign in to comment.