-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI changes related to file and job deletion based on start and end dates
Changes related to file and job deletion based on start and end dates
- Loading branch information
Showing
18 changed files
with
219 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import PropTypes from 'prop-types'; | ||
|
||
import { Grid } from '@material-ui/core'; | ||
import Button from '@material-ui/core/Button'; | ||
import CircularProgress from '@material-ui/core/CircularProgress'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
import TextField from '@material-ui/core/TextField'; | ||
|
||
const ConfirmDeleteManyDialog = ({ | ||
onClose, | ||
onDelete, | ||
dialogTitle, | ||
dialogText, | ||
}) => { | ||
const [deletionStarted, setDeletionStarted] = useState(false); | ||
const defaultDate = new Date().toISOString().slice(0, 10); | ||
const [startDate, setStartDate] = useState(defaultDate); | ||
const [endDate, setEndDate] = useState(defaultDate); | ||
const handelDeleteClick = () => { | ||
setDeletionStarted(true); | ||
onDelete(onClose, startDate, endDate); | ||
}; | ||
const onSetStartDate = (event) => { | ||
setStartDate(new Date(event.target.value).toISOString().slice(0, 10)); | ||
}; | ||
|
||
const onSetEndDate = (event) => { | ||
setEndDate(new Date(event.target.value).toISOString().slice(0, 10)); | ||
}; | ||
|
||
return ( | ||
<Dialog open> | ||
<DialogTitle>{dialogTitle}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText>{dialogText}</DialogContentText> | ||
<Grid container spacing={2}> | ||
<Grid item xs={6}> | ||
<TextField | ||
id="date" | ||
label="From" | ||
type="date" | ||
margin="dense" | ||
defaultValue={startDate} | ||
value={startDate} | ||
onChange={onSetStartDate} | ||
InputLabelProps={{ | ||
shrink: true, | ||
}} | ||
/> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<TextField | ||
id="date" | ||
label="To" | ||
type="date" | ||
margin="dense" | ||
defaultValue={endDate} | ||
value={endDate} | ||
onChange={onSetEndDate} | ||
InputLabelProps={{ | ||
shrink: true, | ||
}} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={onClose} color="primary"> | ||
CANCEL | ||
</Button> | ||
<Button | ||
disabled={deletionStarted} | ||
onClick={handelDeleteClick} | ||
color="primary" | ||
> | ||
DELETE | ||
</Button> | ||
{deletionStarted ? <CircularProgress size="25px" /> : null} | ||
</DialogActions> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
ConfirmDeleteManyDialog.propTypes = { | ||
onClose: PropTypes.func.isRequired, | ||
onDelete: PropTypes.func.isRequired, | ||
dialogTitle: PropTypes.string.isRequired, | ||
dialogText: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default ConfirmDeleteManyDialog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.