chore: lint
This commit is contained in:
@@ -136,105 +136,105 @@ export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initia
|
|||||||
{
|
{
|
||||||
(schedule != null) ? (
|
(schedule != null) ? (
|
||||||
<Box mt={2} display="flex" justifyContent="space-between">
|
<Box mt={2} display="flex" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
onClick={deleteRobotSchedule}
|
onClick={deleteRobotSchedule}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
Delete Schedule
|
Delete Schedule
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
||||||
<Typography sx={{ marginRight: '10px' }}>Run once every</Typography>
|
<Typography sx={{ marginRight: '10px' }}>Run once every</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
type="number"
|
type="number"
|
||||||
value={settings.runEvery}
|
value={settings.runEvery}
|
||||||
onChange={(e) => handleChange('runEvery', parseInt(e.target.value))}
|
onChange={(e) => handleChange('runEvery', parseInt(e.target.value))}
|
||||||
sx={textStyle}
|
sx={textStyle}
|
||||||
inputProps={{ min: 1 }}
|
inputProps={{ min: 1 }}
|
||||||
/>
|
/>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
label=""
|
label=""
|
||||||
id="runEveryUnit"
|
id="runEveryUnit"
|
||||||
value={settings.runEveryUnit}
|
value={settings.runEveryUnit}
|
||||||
handleSelect={(e) => handleChange('runEveryUnit', e.target.value)}
|
handleSelect={(e) => handleChange('runEveryUnit', e.target.value)}
|
||||||
sx={dropDownStyle}
|
sx={dropDownStyle}
|
||||||
>
|
>
|
||||||
{units.map((unit) => (
|
{units.map((unit) => (
|
||||||
<MenuItem key={unit} value={unit}>{unit}</MenuItem>
|
<MenuItem key={unit} value={unit}>{unit}</MenuItem>
|
||||||
))}
|
))}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
||||||
<Typography sx={{ marginBottom: '5px', marginRight: '25px' }}>Start from / On</Typography>
|
<Typography sx={{ marginBottom: '5px', marginRight: '25px' }}>Start from / On</Typography>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
label=""
|
label=""
|
||||||
id="startFrom"
|
id="startFrom"
|
||||||
value={settings.startFrom}
|
value={settings.startFrom}
|
||||||
handleSelect={(e) => handleChange('startFrom', e.target.value)}
|
handleSelect={(e) => handleChange('startFrom', e.target.value)}
|
||||||
sx={dropDownStyle}
|
sx={dropDownStyle}
|
||||||
>
|
>
|
||||||
{days.map((day) => (
|
{days.map((day) => (
|
||||||
<MenuItem key={day} value={day}>{day}</MenuItem>
|
<MenuItem key={day} value={day}>{day}</MenuItem>
|
||||||
))}
|
))}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{['MINUTES', 'HOURS'].includes(settings.runEveryUnit) ? (
|
{['MINUTES', 'HOURS'].includes(settings.runEveryUnit) ? (
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
||||||
<Box sx={{ marginRight: '20px' }}>
|
<Box sx={{ marginRight: '20px' }}>
|
||||||
<Typography sx={{ marginBottom: '5px' }}>In Between</Typography>
|
<Typography sx={{ marginBottom: '5px' }}>In Between</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
type="time"
|
type="time"
|
||||||
value={settings.atTimeStart}
|
value={settings.atTimeStart}
|
||||||
onChange={(e) => handleChange('atTimeStart', e.target.value)}
|
onChange={(e) => handleChange('atTimeStart', e.target.value)}
|
||||||
sx={textStyle}
|
sx={textStyle}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
type="time"
|
type="time"
|
||||||
value={settings.atTimeEnd}
|
value={settings.atTimeEnd}
|
||||||
onChange={(e) => handleChange('atTimeEnd', e.target.value)}
|
onChange={(e) => handleChange('atTimeEnd', e.target.value)}
|
||||||
sx={textStyle}
|
sx={textStyle}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
||||||
<Typography sx={{ marginBottom: '5px', marginRight: '10px' }}>At Around</Typography>
|
<Typography sx={{ marginBottom: '5px', marginRight: '10px' }}>At Around</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
type="time"
|
type="time"
|
||||||
value={settings.atTimeStart}
|
value={settings.atTimeStart}
|
||||||
onChange={(e) => handleChange('atTimeStart', e.target.value)}
|
onChange={(e) => handleChange('atTimeStart', e.target.value)}
|
||||||
sx={textStyle}
|
sx={textStyle}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
||||||
<Typography sx={{ marginRight: '10px' }}>Timezone</Typography>
|
<Typography sx={{ marginRight: '10px' }}>Timezone</Typography>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
label=""
|
label=""
|
||||||
id="timezone"
|
id="timezone"
|
||||||
value={settings.timezone}
|
value={settings.timezone}
|
||||||
handleSelect={(e) => handleChange('timezone', e.target.value)}
|
handleSelect={(e) => handleChange('timezone', e.target.value)}
|
||||||
sx={dropDownStyle}
|
sx={dropDownStyle}
|
||||||
>
|
>
|
||||||
{validMomentTimezones.map((tz) => (
|
{validMomentTimezones.map((tz) => (
|
||||||
<MenuItem key={tz} value={tz}>{tz}</MenuItem>
|
<MenuItem key={tz} value={tz}>{tz}</MenuItem>
|
||||||
))}
|
))}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Box>
|
</Box>
|
||||||
<Box mt={2} display="flex" justifyContent="flex-end">
|
<Box mt={2} display="flex" justifyContent="flex-end">
|
||||||
<Button onClick={() => handleStart(settings)} variant="contained" color="primary">
|
<Button onClick={() => handleStart(settings)} variant="contained" color="primary">
|
||||||
Save Schedule
|
Save Schedule
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleClose} color="primary" variant="outlined" style={{ marginLeft: '10px' }}>
|
<Button onClick={handleClose} color="primary" variant="outlined" style={{ marginLeft: '10px' }}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user