fix: no code without type

This commit is contained in:
Bart Ledoux
2025-12-19 09:50:38 +01:00
parent 2abea0fcde
commit f71ee16dd2
2 changed files with 7 additions and 3 deletions

View File

@@ -26,6 +26,7 @@
@update:model-value="onTaskInput"
:schema
:properties
:typeBased="isTaskDefinitionBasedOnType"
/>
</div>
</template>
@@ -165,7 +166,10 @@
// when tab is opened, load the documentation
onActivated(() => {
if(selectedTaskType.value && parentPath !== "inputs"){
pluginsStore.updateDocumentation({type: selectedTaskType.value, ...taskModel.value});
pluginsStore.updateDocumentation({
cls: selectedTaskType.value,
...taskModel.value
});
}
});

View File

@@ -78,6 +78,7 @@
required?: boolean;
schema?: Schema;
root?: string;
typeBased?: boolean;
}>();
const emit = defineEmits<{
@@ -127,11 +128,10 @@
const filteredProperties = computed<Entry[]>(() => {
const propertiesProc = (props.properties ?? props.schema?.properties);
const isOutputsContext = props.root?.startsWith("outputs[") || false;
return propertiesProc
? (Object.entries(propertiesProc) as Entry[]).filter(([key, value]) => {
// Allow "type" field for outputs context, filter it out for other contexts
const shouldFilterType = key === "type" && !isOutputsContext;
const shouldFilterType = key === "type" && props.typeBased;
return !shouldFilterType && !Array.isArray(value);
})
: [];