Skip to content

Commit 96930a2

Browse files
authored
feat: create workflow configuration main column with two placeholder steps (#433) (#434)
1 parent 5d9d111 commit 96930a2

File tree

12 files changed

+145
-1
lines changed

12 files changed

+145
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { StepContent } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/components/StepContent/stepContent";
2+
import { StepLabel } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/components/StepLabel/stepLabel";
3+
import { Icon } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon";
4+
import { LOREM_IPSUM } from "@databiosphere/findable-ui/lib/storybook/loremIpsum";
5+
import { StepProps } from "../types";
6+
import { Step } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/step";
7+
8+
export const GTFStep = ({
9+
active,
10+
completed,
11+
description,
12+
index,
13+
label,
14+
}: StepProps): JSX.Element => {
15+
return (
16+
<Step active={active} completed={completed} index={index}>
17+
<StepLabel>
18+
{label}
19+
<Icon slotProps={{ tooltip: { title: description } }} />
20+
</StepLabel>
21+
<StepContent>{LOREM_IPSUM.LONG}</StepContent>
22+
</Step>
23+
);
24+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { StepConfig } from "../types";
2+
import { GTFStep } from "./gtfStep";
3+
4+
export const STEP: StepConfig = {
5+
Step: GTFStep,
6+
description: "Select the GTF files for the workflow",
7+
key: "gtf-files",
8+
label: "GTF Files",
9+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Step } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/step";
2+
import { StepContent } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/components/StepContent/stepContent";
3+
import { StepLabel } from "@databiosphere/findable-ui/lib/components/Stepper/components/Step/components/StepLabel/stepLabel";
4+
import { StepProps } from "../types";
5+
6+
export const ReferenceAssemblyStep = ({
7+
active,
8+
completed,
9+
index,
10+
label,
11+
}: StepProps): JSX.Element => {
12+
return (
13+
<Step active={active} completed={completed} index={index}>
14+
<StepLabel>{label}</StepLabel>
15+
<StepContent>None</StepContent>
16+
</Step>
17+
);
18+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { StepConfig } from "../types";
2+
import { ReferenceAssemblyStep } from "./referenceAssemblyStep";
3+
4+
export const STEP: StepConfig = {
5+
Step: ReferenceAssemblyStep,
6+
disabled: true,
7+
key: "reference-assembly",
8+
label: "Reference Assembly",
9+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { ComponentType, ReactNode } from "react";
2+
import { StepProps as MStepProps } from "@mui/material";
3+
4+
export interface StepConfig {
5+
description?: ReactNode;
6+
disabled?: boolean;
7+
key: string;
8+
label: string;
9+
Step: ComponentType<StepProps>;
10+
}
11+
12+
export interface StepProps
13+
extends Omit<StepConfig, "Step" | "key">,
14+
Pick<MStepProps, "active" | "completed" | "index" | "last"> {
15+
configKey: string;
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { StepperProps } from "@mui/material";
2+
import { STEPPER_PROPS as MUI_STEPPER_PROPS } from "@databiosphere/findable-ui/lib/styles/common/mui/stepper";
3+
import { StepConfig } from "./components/Step/types";
4+
import { STEP as REFERENCE_ASSEMBLY_STEP } from "./components/Step/ReferenceAssemblyStep/step";
5+
import { STEP as GTF_STEP } from "./components/Step/GTFStep/step";
6+
7+
export const STEPPER_PROPS: StepperProps = {
8+
connector: null,
9+
orientation: MUI_STEPPER_PROPS.ORIENTATION.VERTICAL,
10+
};
11+
12+
export const STEPS: StepConfig[] = [REFERENCE_ASSEMBLY_STEP, GTF_STEP];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import styled from "@emotion/styled";
2+
import { Stepper } from "@mui/material";
3+
4+
export const StyledStepper = styled(Stepper)`
5+
gap: 16px;
6+
`;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { STEPPER_PROPS, STEPS } from "./constants";
2+
import { StyledStepper } from "./stepper.styles";
3+
import { Props } from "./types";
4+
5+
export const Stepper = (props: Props): JSX.Element => {
6+
const activeStep = 1;
7+
return (
8+
<StyledStepper activeStep={activeStep} {...STEPPER_PROPS}>
9+
{STEPS.map(({ key, Step, ...stepProps }, i) => {
10+
const active = activeStep === i;
11+
const completed = activeStep > i;
12+
return (
13+
<Step
14+
key={key}
15+
active={active}
16+
completed={completed}
17+
configKey={key}
18+
{...stepProps}
19+
{...props}
20+
/>
21+
);
22+
})}
23+
</StyledStepper>
24+
);
25+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {
2+
BRCDataCatalogGenome,
3+
Workflow,
4+
} from "../../../../../../../../apis/catalog/brc-analytics-catalog/common/entities";
5+
6+
export interface Props {
7+
genome: BRCDataCatalogGenome;
8+
workflow: Workflow;
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Props } from "./types";
2+
import { Stepper } from "./components/Stepper/stepper";
3+
4+
export const Main = ({ genome, workflow }: Props): JSX.Element => {
5+
return <Stepper genome={genome} workflow={workflow} />;
6+
};

0 commit comments

Comments
 (0)