in src/components/application/launch/utilities/fetch-workflow-description.js [5:39]
function processSuggestedInputs(workflowName, inputs, prevInputs) {
if (!inputs) {
return null;
}
const newWdlInputs = inputs.map((input) => {
const isArray = input.typeDisplayName.startsWith('Array');
const key = `${workflowName}.${input.name}`;
const type = isArray ? WdlInputTypes.array : WdlInputTypes.string;
let value;
const [existed] = prevInputs.filter(w => w.key === key);
if (existed && existed.value) {
value = existed.value;
}
if (!value && input.default) {
value = JSON.parse(input.default);
} else if (!value) {
value = isArray ? [''] : '';
}
return {
key,
type,
value,
optional: input.optional,
isGenerated: true,
};
});
if (newWdlInputs.length === 0) {
return null;
}
newWdlInputs.push(...prevInputs.filter(
w => !w.isGenerated
&& newWdlInputs.filter(nw => nw.key === w.key).length === 0,
));
return newWdlInputs;
}