Merge branch 'master' into 14275-structured-search-basic-view
[arvados.git] / src / models / workflow.ts
index 1cb3d46e8cb09a925adf1cd1b87de5f61f49b2ea..d7d97c4c962401bfc7bd5ff655ebe88fdaf4d92d 100644 (file)
@@ -107,6 +107,9 @@ export type StringArrayCommandInputParameter = GenericArrayCommandInputParameter
 export type FileArrayCommandInputParameter = GenericArrayCommandInputParameter<CWLType.FILE, File>;
 export type DirectoryArrayCommandInputParameter = GenericArrayCommandInputParameter<CWLType.DIRECTORY, Directory>;
 
+export type WorkflowInputsData = {
+    [key: string]: boolean | number | string | File | Directory;
+};
 export const parseWorkflowDefinition = (workflow: WorkflowResource): WorkflowResoruceDefinition => {
     const definition = safeLoad(workflow.definition);
     return definition;
@@ -119,7 +122,7 @@ export const getWorkflowInputs = (workflowDefinition: WorkflowResoruceDefinition
         : undefined;
 };
 export const getInputLabel = (input: CommandInputParameter) => {
-    return `${input.label || input.id}${isRequiredInput(input) ? '*' : ''}`;
+    return `${input.label || input.id}`;
 };
 
 export const isRequiredInput = ({ type }: CommandInputParameter) => {
@@ -132,6 +135,12 @@ export const isRequiredInput = ({ type }: CommandInputParameter) => {
     }
     return true;
 };
+
+export const isPrimitiveOfType = (input: GenericCommandInputParameter<any, any>, type: CWLType) =>
+    input.type instanceof Array
+        ? input.type.indexOf(type) > -1
+        : input.type === type;
+
 export const stringifyInputType = ({ type }: CommandInputParameter) => {
     if (typeof type === 'string') {
         return type;