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" @update:model-value="onTaskInput"
:schema :schema
:properties :properties
:typeBased="isTaskDefinitionBasedOnType"
/> />
</div> </div>
</template> </template>
@@ -165,7 +166,10 @@
// when tab is opened, load the documentation // when tab is opened, load the documentation
onActivated(() => { onActivated(() => {
if(selectedTaskType.value && parentPath !== "inputs"){ 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; required?: boolean;
schema?: Schema; schema?: Schema;
root?: string; root?: string;
typeBased?: boolean;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
@@ -127,11 +128,10 @@
const filteredProperties = computed<Entry[]>(() => { const filteredProperties = computed<Entry[]>(() => {
const propertiesProc = (props.properties ?? props.schema?.properties); const propertiesProc = (props.properties ?? props.schema?.properties);
const isOutputsContext = props.root?.startsWith("outputs[") || false;
return propertiesProc return propertiesProc
? (Object.entries(propertiesProc) as Entry[]).filter(([key, value]) => { ? (Object.entries(propertiesProc) as Entry[]).filter(([key, value]) => {
// Allow "type" field for outputs context, filter it out for other contexts // 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); return !shouldFilterType && !Array.isArray(value);
}) })
: []; : [];