Commit 097a80c7 authored by Tomáš Pecka's avatar Tomáš Pecka

webui: String input now shows link to ALT docs

Some people might find the string input confusing. So we added a link to
ALT's documentation of `string::Parse` language.

The link is revealed only when string input is selected in the form.

Closes #45
parent 0a75bb1f
Pipeline #96001 failed with stages
in 7 minutes and 13 seconds
......@@ -14,9 +14,12 @@ import {
Select,
MenuItem,
InputLabel,
FormControl
FormControl,
Link,
Grid,
} from '@material-ui/core'
import CloseIcon from '@material-ui/icons/Close'
import HelpIcon from '@material-ui/icons/Help';
import { ReduxState } from '../../../reducers'
import { algorithmUIActions } from '../../../reducers/algorithmUI'
import { algorithmDataActions } from '../../../reducers/algorithmData'
......@@ -44,7 +47,6 @@ const useStyles = makeStyles({
height: '100%'
},
typeSelectFormControl: {
width: '15%',
marginBottom: '20px'
},
dialogContent: {
......@@ -202,18 +204,31 @@ const InputDialog = () => {
</DialogTitle>
<Divider />
<DialogContent className={classes.dialogContent}>
<FormControl className={classes.typeSelectFormControl}>
<InputLabel id="typeSelectLabel">Type</InputLabel>
<Select
labelId="typeSelectLabel"
value={type}
onChange={handleTypeChange}
>
<MenuItem value="string">String</MenuItem>
<MenuItem value="number">Number</MenuItem>
<MenuItem value="boolean">Bool</MenuItem>
</Select>
</FormControl>
<Grid container justify="center" spacing={2}>
<Grid item xs={6}>
<FormControl className={classes.typeSelectFormControl}>
<InputLabel id="typeSelectLabel">Type</InputLabel>
<Select
labelId="typeSelectLabel"
value={type}
onChange={handleTypeChange}
>
<MenuItem value="string">String</MenuItem>
<MenuItem value="number">Number</MenuItem>
<MenuItem value="boolean">Bool</MenuItem>
</Select>
</FormControl>
</Grid>
<Grid item xs={6}>
{type === "string" && (
<Link component="button" variant="body2" target="_blank" href="https://alt.fit.cvut.cz/docs/parse/" onClick={()=> window.open("https://alt.fit.cvut.cz/docs/parse/", "_blank")}>
<IconButton disabled={true}><HelpIcon /></IconButton>
String format documentation
</Link>
)}
</Grid>
</Grid>
{type === 'string' && (
<TextField
className={classes.textField}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment