From 402632c1268a99d0970a10172cb42c5f19d30350 Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Tue, 6 Nov 2018 15:44:17 +0100 Subject: [PATCH] Putting select placeholder in second tab --- .../src/Components/Event/Create/Tabs/Basic.js | 53 +++--------------- .../Components/Event/Create/Tabs/Technical.js | 56 ++++++++++++++++--- client/src/Components/Event/Create/index.js | 14 ++++- 3 files changed, 69 insertions(+), 54 deletions(-) diff --git a/client/src/Components/Event/Create/Tabs/Basic.js b/client/src/Components/Event/Create/Tabs/Basic.js index 8c7797557..b5e6e4353 100644 --- a/client/src/Components/Event/Create/Tabs/Basic.js +++ b/client/src/Components/Event/Create/Tabs/Basic.js @@ -1,14 +1,8 @@ import React from 'react'; import { TextField, - FormControl, - InputLabel, - Input, Button, - MenuItem, FormGroup, - Select, - FormHelperText, Typography, Grid, } from '@material-ui/core'; @@ -92,47 +86,18 @@ class Basic extends React.Component { - - - - Select the formula - - - For new formula, select {'"'}create new{'"'} - - - - Select the Plotter - - - For new plotter, select {'"'}create new{'"'} - + diff --git a/client/src/Components/Event/Create/Tabs/Technical.js b/client/src/Components/Event/Create/Tabs/Technical.js index f091e6bd2..389c237e7 100644 --- a/client/src/Components/Event/Create/Tabs/Technical.js +++ b/client/src/Components/Event/Create/Tabs/Technical.js @@ -1,5 +1,13 @@ import React from 'react'; -import { Typography } from '@material-ui/core'; +import { + Typography, + FormControl, + InputLabel, + Input, + Select, + FormHelperText, + MenuItem, +} from '@material-ui/core'; import { withStyles } from '@material-ui/core/styles'; import styles from '../styles'; @@ -10,15 +18,45 @@ class Technical extends React.Component { const { classes } = this.props; return ( - - Technical + + Select the formula and the plotter you want to use, you can also create your own with the corresponding button. + + + Select the formula + + + For new formula, select {'"'}create new{'"'} + + + + Select the Plotter + + + For new plotter, select {'"'}create new{'"'} + ); } diff --git a/client/src/Components/Event/Create/index.js b/client/src/Components/Event/Create/index.js index 9def0ded7..ee979cb1d 100644 --- a/client/src/Components/Event/Create/index.js +++ b/client/src/Components/Event/Create/index.js @@ -44,6 +44,8 @@ class Create extends React.Component { description: '', startDatetime: DateTime.local().plus({ days: 1 }).startOf('day'), finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day'), + formulaId: '', + plotterId: '', }; } @@ -62,6 +64,8 @@ class Create extends React.Component { startDatetime, finishDatetime, value, + formulaId, + plotterId, } = this.state; const { classes } = this.props; return ( @@ -136,7 +140,15 @@ class Create extends React.Component { edit={(newType, newVal) => this.handleEventChange(newType, newVal)} /> } - {value === 1 && } + {value === 1 && + this.handleEventChange(newType, newVal)} + /> + } {value === 2 && } {value === 3 && }