Skip to content

Commit 5d9d111

Browse files
frano-mFran McDade
andauthored
feat: create workflow configuration side column (#431) (#432)
* feat: introduce workflow configuration page (#422) * feat: create workflow configuration side column (#431) * fix: button prop import (#431) --------- Co-authored-by: Fran McDade <[email protected]>
1 parent 577d897 commit 5d9d111

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {
2+
FluidPaper,
3+
GridPaper,
4+
} from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
5+
import { CollapsableSection } from "@databiosphere/findable-ui/lib/components/common/Section/components/CollapsableSection/collapsableSection";
6+
import { KeyValuePairs } from "@databiosphere/findable-ui/lib/components/common/KeyValuePairs/keyValuePairs";
7+
import { Props } from "./types";
8+
import {
9+
buildGenomeDetails,
10+
buildWorkflowDetails,
11+
} from "../../../../../../viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders";
12+
13+
export const SideColumn = ({ genome, workflow }: Props): JSX.Element => {
14+
return (
15+
<FluidPaper>
16+
<GridPaper>
17+
<CollapsableSection title="Configuration">None</CollapsableSection>
18+
<CollapsableSection title="Workflow Details">
19+
<KeyValuePairs {...buildWorkflowDetails(workflow)} />
20+
</CollapsableSection>
21+
<CollapsableSection title="Assembly Details">
22+
<KeyValuePairs {...buildGenomeDetails(genome)} />
23+
</CollapsableSection>
24+
</GridPaper>
25+
</FluidPaper>
26+
);
27+
};
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+
}

app/viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ROUTES } from "../../../../../routes/constants";
88
import {
99
BRCDataCatalogGenome,
1010
BRCDataCatalogOrganism,
11+
Workflow,
1112
} from "../../../../apis/catalog/brc-analytics-catalog/common/entities";
1213
import * as C from "../../../../components";
1314
import {
@@ -562,7 +563,7 @@ export const buildGenomeDetails = (
562563
);
563564
return {
564565
KeyElType: C.KeyElType,
565-
KeyValuesElType: (props) => C.Stack({ gap: 4, ...props }),
566+
KeyValuesElType: (props) => C.Stack({ ...props, gap: 4 }),
566567
ValueElType: C.ValueElType,
567568
keyValuePairs,
568569
};
@@ -685,6 +686,25 @@ function buildOrganismGenomesTableColumns(): ColumnDef<BRCDataCatalogGenome>[] {
685686
];
686687
}
687688

689+
/**
690+
* Build props for the workflow details KeyValuePairs component.
691+
* @param workflow - Workflow.
692+
* @returns Props to be used for the KeyValuePairs component.
693+
*/
694+
export const buildWorkflowDetails = (
695+
workflow: Workflow
696+
): ComponentProps<typeof C.KeyValuePairs> => {
697+
const keyValuePairs = new Map<Key, Value>();
698+
keyValuePairs.set("Workflow", workflow.workflowName);
699+
keyValuePairs.set("Description", workflow.workflowDescription);
700+
return {
701+
KeyElType: C.KeyElType,
702+
KeyValuesElType: (props) => C.Stack({ ...props, gap: 4 }),
703+
ValueElType: C.ValueElType,
704+
keyValuePairs,
705+
};
706+
};
707+
688708
/**
689709
* Get the genome entity breadcrumbs.
690710
* @param genome - Genome entity.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { Detail } from "@databiosphere/findable-ui/lib/components/Detail/detail";
22
import { Props } from "./types";
33
import { Top } from "../../components/Entity/components/ConfigureWorkflowInputs/components/Top/top";
4+
import { SideColumn } from "../../components/Entity/components/ConfigureWorkflowInputs/components/SideColumn/sideColumn";
45

56
export const WorkflowInputsView = (props: Props): JSX.Element => {
67
return (
7-
<Detail mainColumn={null} sideColumn={null} top={<Top {...props} />} />
8+
<Detail
9+
mainColumn={null}
10+
sideColumn={<SideColumn {...props} />}
11+
top={<Top {...props} />}
12+
/>
813
);
914
};

0 commit comments

Comments
 (0)