RunProcessInputsForm [WIP]
[arvados-workbench2.git] / src / models / workflow.ts
index 95cc926fbd09dfa19eff94abb897d2f8bcb6b053..1cb3d46e8cb09a925adf1cd1b87de5f61f49b2ea 100644 (file)
@@ -118,7 +118,20 @@ export const getWorkflowInputs = (workflowDefinition: WorkflowResoruceDefinition
         ? mainWorkflow.inputs
         : undefined;
 };
+export const getInputLabel = (input: CommandInputParameter) => {
+    return `${input.label || input.id}${isRequiredInput(input) ? '*' : ''}`;
+};
 
+export const isRequiredInput = ({ type }: CommandInputParameter) => {
+    if (type instanceof Array) {
+        for (const t of type) {
+            if (t === CWLType.NULL) {
+                return false;
+            }
+        }
+    }
+    return true;
+};
 export const stringifyInputType = ({ type }: CommandInputParameter) => {
     if (typeof type === 'string') {
         return type;