Skip to content
Snippets Groups Projects
Commit 4133c83b authored by Loic Huder's avatar Loic Huder
Browse files

Remove wrapper around WorkflowDropdown

parent 1a61cea3
No related branches found
No related tags found
No related merge requests found
Pipeline #136953 passed
......@@ -73,20 +73,19 @@ export default function AddSubworkflowDialog(props: Props) {
/>
<Dialog maxWidth="xl" open={open} onClose={handleClose}>
<DialogTitle>Add Subgraph</DialogTitle>
<DialogTitle>Add subworkflow</DialogTitle>
<DialogContent>
<List component="div" role="list">
<ListItem divider role="listitem">
<ListItemText primary="From Server" />
<div style={{ width: '20rem', marginLeft: '0.5rem' }}>
<SuspenseBoundary>
<WorkflowDropdown
onChange={(workflowDetails) => {
addSubgraph(workflowDetails.id);
}}
/>
</SuspenseBoundary>
</div>
<SuspenseBoundary>
<WorkflowDropdown
onChange={(workflowDetails) => {
addSubgraph(workflowDetails.id);
}}
style={{ width: '20rem', marginLeft: '2rem' }}
/>
</SuspenseBoundary>
</ListItem>
<ListItem
button
......
import { useState } from 'react';
import FormControl from '@material-ui/core/FormControl';
import useStore from '../store/useStore';
import useSnackbarStore from '../store/useSnackbarStore';
import type { WorkflowDescription } from '../types';
......@@ -46,20 +45,16 @@ export default function GetWorkflowFromServerDropdown() {
agreeCallback={() => getFromServer(workflowId)}
disagreeCallback={() => setOpenAgreeDialog(false)}
/>
<FormControl
variant="standard"
<WorkflowDropdown
onChange={(workflowDetails) => {
setInputValue(workflowDetails);
}}
style={{
minWidth: '220px',
backgroundColor: '#7685dd',
borderRadius: '4px',
}}
>
<WorkflowDropdown
onChange={(workflowDetails) => {
setInputValue(workflowDetails);
}}
/>
</FormControl>
/>
</>
);
}
import type { WorkflowDescription } from 'types';
import useSnackbarStore from 'store/useSnackbarStore';
import type { CSSProperties } from 'react';
import { useEffect, useState } from 'react';
import { Autocomplete } from '@material-ui/lab';
import { CircularProgress, TextField } from '@material-ui/core';
......@@ -11,6 +12,7 @@ import { useWorkflowsDLE } from '../api/workflows';
interface Props {
onChange: (input: WorkflowDescription) => void;
category?: string;
style?: CSSProperties;
}
function sortByCategory(
......@@ -30,7 +32,7 @@ function sortByCategory(
// DOC: A dropdown that can be an input as well
function WorkflowDropdown(props: Props) {
const { onChange, category } = props;
const { onChange, category, style } = props;
const [inputValue, setInputValue] = useState('');
const [open, setOpen] = useState(false);
......@@ -52,6 +54,7 @@ function WorkflowDropdown(props: Props) {
return (
<Autocomplete
style={style}
open={open}
onOpen={() => setOpen(true)}
onClose={() => setOpen(false)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment