Skip to content

Commit de01776

Browse files
frano-mhunterckx
andauthored
feat: create no workflow selector under a feature flag (#825) (#826)
* feat: create no workflow selector under a feature flag (#825) * feat: configured custom workflow params and page (#825) * feat: add function to get data landing url (#825) (#917) Co-authored-by: hunterckx <[email protected]> * feat: added custom workflow sequencing step (#919) * refactor: building step configuration for each workflow and workflow params (#825) * feat: updated side column rendering values to handle just configured values (#825) * fix: make step render value optional (#825) * feat: add basic read runs any step (#825) * refactor: onconfigure function to take multiple configured inputs (#825) * feat: allocated selected paired or single runs to configured input value (#825) * feat: render sequencing selection in side column summary (#825) * feat: updated launch galaxy with custom landing url request (#825) --------- Co-authored-by: Fran McDade <[email protected]> * fix: use separate types for data landing and workflow landing apis (#825) * fix: use correct url for data landing (#825) * feat: added feature flag to workflow page (#825) * feat: update is custom workflow checks to reference custom workflow constant (#825) * refactor: linting (#825) --------- Co-authored-by: Fran McDade <[email protected]> Co-authored-by: hunterckx <[email protected]>
1 parent a3601b6 commit de01776

File tree

40 files changed

+832
-274
lines changed

40 files changed

+832
-274
lines changed

app/apis/catalog/brc-analytics-catalog/common/entities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MDXRemoteSerializeResult } from "next-mdx-remote";
2-
import { WorkflowUrlParameter } from "../../../../utils/galaxy-api/entities";
32
import {
43
ORGANISM_PLOIDY,
54
OUTBREAK_PRIORITY,
65
OUTBREAK_RESOURCE_TYPE,
76
WORKFLOW_PARAMETER_VARIABLE,
87
WORKFLOW_PLOIDY,
8+
WorkflowUrlSpec,
99
} from "./schema-entities";
1010

1111
export type BRCCatalog =
@@ -133,6 +133,6 @@ export interface WorkflowDataRequirements {
133133
export interface WorkflowParameter {
134134
data_requirements?: WorkflowDataRequirements;
135135
key: string;
136-
url_spec?: WorkflowUrlParameter;
136+
url_spec?: WorkflowUrlSpec;
137137
variable?: WORKFLOW_PARAMETER_VARIABLE;
138138
}

app/apis/catalog/brc-analytics-catalog/common/schema-entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export {
44
OutbreakResourceType as OUTBREAK_RESOURCE_TYPE,
55
WorkflowParameterVariable as WORKFLOW_PARAMETER_VARIABLE,
66
WorkflowPloidy as WORKFLOW_PLOIDY,
7+
type WorkflowUrlSpec,
78
} from "../../../../../catalog/schema/generated/schema";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {
2+
WORKFLOW_PLOIDY,
3+
WORKFLOW_PARAMETER_VARIABLE,
4+
} from "../../../../../../apis/catalog/brc-analytics-catalog/common/schema-entities";
5+
import { Workflow } from "../../../../../../apis/catalog/brc-analytics-catalog/common/entities";
6+
7+
export const CUSTOM_WORKFLOW: Workflow = {
8+
iwcId: "",
9+
parameters: [
10+
{
11+
key: "Reference annotation",
12+
variable: WORKFLOW_PARAMETER_VARIABLE.GENE_MODEL_URL,
13+
},
14+
],
15+
ploidy: WORKFLOW_PLOIDY.ANY,
16+
taxonomyId: null,
17+
trsId: "custom-workflow",
18+
workflowDescription:
19+
"Analyze selected data in the context of this assembly in your own Galaxy workflow.",
20+
workflowName: "Custom / No Workflow",
21+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Button, Stack, Typography } from "@mui/material";
2+
import { Props } from "./types";
3+
import { StyledGrid } from "../Workflow/workflow.styles";
4+
import { BUTTON_PROPS, GRID_PROPS } from "../Workflow/constants";
5+
import { TYPOGRAPHY_PROPS as COMPONENT_TYPOGRAPHY_PROPS } from "../../constants";
6+
import { REL_ATTRIBUTE } from "@databiosphere/findable-ui/lib/components/Links/common/entities";
7+
import Link from "next/link";
8+
import { ROUTES } from "../../../../../../../routes/constants";
9+
import { replaceParameters } from "@databiosphere/findable-ui/lib/utils/replaceParameters";
10+
import { TYPOGRAPHY_PROPS } from "@databiosphere/findable-ui/lib/styles/common/mui/typography";
11+
import { FluidPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/components/FluidPaper/fluidPaper";
12+
import { CUSTOM_WORKFLOW } from "./constants";
13+
14+
export const CustomWorkflow = ({ entityId }: Props): JSX.Element => {
15+
const { trsId, workflowDescription, workflowName } = CUSTOM_WORKFLOW;
16+
return (
17+
<FluidPaper>
18+
<StyledGrid {...GRID_PROPS}>
19+
<Stack spacing={1}>
20+
<Typography variant={TYPOGRAPHY_PROPS.VARIANT.HEADING_XSMALL}>
21+
{workflowName}
22+
</Typography>
23+
<Typography {...COMPONENT_TYPOGRAPHY_PROPS}>
24+
{workflowDescription}
25+
</Typography>
26+
</Stack>
27+
<Button
28+
{...BUTTON_PROPS}
29+
component={Link}
30+
href={replaceParameters(ROUTES.CONFIGURE_WORKFLOW, {
31+
entityId,
32+
trsId,
33+
})}
34+
rel={REL_ATTRIBUTE.NO_OPENER}
35+
>
36+
Select Data
37+
</Button>
38+
</StyledGrid>
39+
</FluidPaper>
40+
);
41+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface Props {
2+
entityId: string;
3+
}

app/components/Entity/components/AnalysisMethodsCatalog/analysisMethodsCatalog.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ import workflows from "../../../../../catalog/output/workflows.json";
22
import { AnalysisMethod } from "../AnalysisMethod/analysisMethod";
33
import { Props } from "./types";
44
import { workflowIsCompatibleWithAssembly } from "./utils";
5-
65
import { useRouter } from "next/router";
76
import { Fragment } from "react";
7+
import { useFeatureFlag } from "@databiosphere/findable-ui/lib/hooks/useFeatureFlag/useFeatureFlag";
8+
import { CustomWorkflow } from "../AnalysisMethod/components/CustomWorkflow/customWorkflow";
89

910
export const AnalysisMethodsCatalog = ({ assembly }: Props): JSX.Element => {
11+
const isFeatureEnabled = useFeatureFlag("custom-workflow");
12+
1013
const {
1114
query: { entityId },
1215
} = useRouter();
1316

1417
return (
1518
<Fragment>
19+
{isFeatureEnabled && <CustomWorkflow entityId={entityId as string} />}
1620
{workflows.map((workflowCategory) => {
1721
const compatibleWorkflows = workflowCategory.workflows.filter(
1822
(workflow) => workflowIsCompatibleWithAssembly(workflow, assembly)

app/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/GTFStep/gtfStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const GTFStep = ({
5050
// Empty string represents "user will provide in Galaxy" similar to how sequencing steps use empty arrays
5151
useEffect(() => {
5252
if (error && active) {
53-
onConfigure(STEP.key, ""); // Use empty string instead of null
53+
onConfigure({ [STEP.key]: "" }); // Use empty string instead of null
5454
}
5555
}, [error, active, onConfigure]);
5656

@@ -91,7 +91,7 @@ export const GTFStep = ({
9191
<FormControlLabel
9292
control={<Radio />}
9393
key={i}
94-
onChange={() => onConfigure(STEP.key, value)}
94+
onChange={() => onConfigure({ [STEP.key]: value })}
9595
label={label}
9696
value={value}
9797
/>

app/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/GTFStep/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const configureGTFStep = (
1818

1919
// Gene model URLs are not available for this workflow.
2020
if (geneModelUrls.length === 0) {
21-
onConfigure(STEP.key, null);
21+
onConfigure({ [STEP.key]: null });
2222
return;
2323
}
2424

@@ -32,7 +32,7 @@ export const configureGTFStep = (
3232
if (!value) return;
3333

3434
// Otherwise, use the gene model to configure the step.
35-
onConfigure(STEP.key, value);
35+
onConfigure({ [STEP.key]: value });
3636
};
3737

3838
/**

app/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/ReferenceAssemblyStep/referenceAssemblyStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ReferenceAssemblyStep = ({
1717
const { accession } = genome;
1818

1919
useEffect(() => {
20-
onConfigure(STEP.key, accession);
20+
onConfigure({ [STEP.key]: accession });
2121
}, [accession, entryLabel, onConfigure]);
2222

2323
return (

app/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/SequencingStep/components/ENASequencingData/components/CollectionSelector/collectionSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BUTTON_PROPS } from "@databiosphere/findable-ui/lib/components/common/B
66
import { useState } from "react";
77
import { Table } from "./components/Table/table";
88
import { RowSelectionState } from "@tanstack/table-core";
9-
import { buildEnaSequencingReads } from "../../utils";
9+
import { getSequencingData } from "../../utils";
1010
import { ColumnFilters } from "./components/ColumnFilters/columnFilters";
1111
import { preSelectColumnFilters } from "./utils";
1212

@@ -50,7 +50,7 @@ export const CollectionSelector = ({
5050
{...BUTTON_PROPS.PRIMARY_CONTAINED}
5151
disabled={selectedCount === 0}
5252
onClick={() => {
53-
onConfigure(stepKey, buildEnaSequencingReads(table));
53+
onConfigure(getSequencingData(table, stepKey));
5454
onClose();
5555
}}
5656
>

0 commit comments

Comments
 (0)