Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"jsdoc/check-alignment": "error",
"jsdoc/check-param-names": "error",
"react-hooks/exhaustive-deps": "error",
"sonarjs/redundant-type-aliases": "warn"
"sonarjs/redundant-type-aliases": "warn",
"sonarjs/todo-tag": "warn"
Copy link
Collaborator Author

@hunterckx hunterckx Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put in a TODO comment on the placeholder switch case, so I had to add this so that ESLint would allow me to make a commit

(To be clear this is how we've handled this ESLint rule in other apps)

},
"overrides": [
{
Expand Down
10 changes: 7 additions & 3 deletions app/utils/galaxy-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ function paramVariableToRequestValue(
variable: WORKFLOW_PARAMETER_VARIABLE,
geneModelUrl: string | null,
referenceGenome: string
): WorkflowLandingsBodyRequestState[string] | undefined {
): WorkflowLandingsBodyRequestState[string] | null {
// Because this `switch` has no default case, and the function doesn't allow `undefined` as a return type,
// we ensure through TypeScript that all possible variables are handled.
switch (variable) {
case WORKFLOW_PARAMETER_VARIABLE.ASSEMBLY_ID:
return referenceGenome;
Expand All @@ -92,7 +94,9 @@ function paramVariableToRequestValue(
src: "url",
url: geneModelUrl,
}
: undefined;
: null;
case WORKFLOW_PARAMETER_VARIABLE.SANGER_READ_RUN:
return null; // TODO pass in necessary information and generate an actual value for this
}
}

Expand Down Expand Up @@ -120,7 +124,7 @@ function getWorkflowLandingsRequestState(
geneModelUrl,
referenceGenome
);
if (value !== undefined) result[key] = value;
if (value !== null) result[key] = value;
}
}
return result;
Expand Down
1 change: 1 addition & 0 deletions catalog/build/py/generated_schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class WorkflowParameterVariable(str, Enum):
ASSEMBLY_ID = "ASSEMBLY_ID"
ASSEMBLY_FASTA_URL = "ASSEMBLY_FASTA_URL"
GENE_MODEL_URL = "GENE_MODEL_URL"
SANGER_READ_RUN = "SANGER_READ_RUN"


class WorkflowPloidy(str, Enum):
Expand Down
1 change: 1 addition & 0 deletions catalog/schema/enums/workflow_parameter_variable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ enums:
ASSEMBLY_ID:
ASSEMBLY_FASTA_URL:
GENE_MODEL_URL:
SANGER_READ_RUN:
1 change: 1 addition & 0 deletions catalog/schema/generated/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum WorkflowParameterVariable {
ASSEMBLY_ID = "ASSEMBLY_ID",
ASSEMBLY_FASTA_URL = "ASSEMBLY_FASTA_URL",
GENE_MODEL_URL = "GENE_MODEL_URL",
SANGER_READ_RUN = "SANGER_READ_RUN",
};
/**
* Possible ploidies supported by workflows.
Expand Down
3 changes: 2 additions & 1 deletion catalog/schema/generated/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
"enum": [
"ASSEMBLY_ID",
"ASSEMBLY_FASTA_URL",
"GENE_MODEL_URL"
"GENE_MODEL_URL",
"SANGER_READ_RUN"
],
"title": "WorkflowParameterVariable",
"type": "string"
Expand Down