Skip to content

Commit a5f4d11

Browse files
authored
Merge branch 'main' into feature/backend-infrastructure
2 parents e631bb1 + 8f64df9 commit a5f4d11

File tree

155 files changed

+4224
-1184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+4224
-1184
lines changed

.linkmllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
extends: recommended
22
rules:
33
standard_naming:
4-
permissible_values_upper_case: true
4+
level: disabled

@types/theme.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@ import { PaletteColorOptions } from "@mui/material/styles";
44
* Palette definitions.
55
*/
66
declare module "@mui/material/styles" {
7+
interface BrandColors {
8+
accent: string;
9+
burntSienna: string;
10+
darkSienna: string;
11+
rawSienna: string;
12+
surface: string;
13+
}
14+
715
interface Palette {
16+
brand: BrandColors;
817
caution: PaletteColor;
918
}
1019

1120
interface PaletteOptions {
21+
brand?: Partial<BrandColors>;
1222
caution?: PaletteColorOptions;
1323
}
1424
}

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

Lines changed: 10 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 =
@@ -123,8 +123,16 @@ export interface Workflow {
123123
workflowName: string;
124124
}
125125

126+
export interface WorkflowDataRequirements {
127+
description?: string;
128+
library_layout?: string;
129+
library_source?: string[];
130+
library_strategy?: string[];
131+
}
132+
126133
export interface WorkflowParameter {
134+
data_requirements?: WorkflowDataRequirements;
127135
key: string;
128-
url_spec?: WorkflowUrlParameter;
136+
url_spec?: WorkflowUrlSpec;
129137
variable?: WORKFLOW_PARAMETER_VARIABLE;
130138
}

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
/**

0 commit comments

Comments
 (0)