mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
fix: no code without type
This commit is contained in:
@@ -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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|||||||
Reference in New Issue
Block a user