mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
[UI] updated New Ticket Modal
This commit is contained in:
parent
63de24ef61
commit
e073c59b2c
3 changed files with 74 additions and 84 deletions
|
|
@ -47,7 +47,7 @@ export const Modal: FC<IProps> = ({
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={show} onClose={handleClose}>
|
<Dialog open={show} onClose={handleClose} maxWidth="md" fullWidth>
|
||||||
<DialogTitle disableTypography className={classes.root}>
|
<DialogTitle disableTypography className={classes.root}>
|
||||||
<Typography variant="h6">{name}</Typography>
|
<Typography variant="h6">{name}</Typography>
|
||||||
{handleClose ? (
|
{handleClose ? (
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,7 @@ import { Ticket } from "../../types/Ticket";
|
||||||
import { Project } from "../../types/Project";
|
import { Project } from "../../types/Project";
|
||||||
import { post } from "../../utils/http";
|
import { post } from "../../utils/http";
|
||||||
import { Constants } from "../../utils/Constants";
|
import { Constants } from "../../utils/Constants";
|
||||||
import {
|
import { TextField, MenuItem } from "@material-ui/core";
|
||||||
DialogTitle,
|
|
||||||
DialogContent,
|
|
||||||
DialogContentText,
|
|
||||||
TextField,
|
|
||||||
DialogActions,
|
|
||||||
Button,
|
|
||||||
Typography,
|
|
||||||
IconButton,
|
|
||||||
Theme,
|
|
||||||
createStyles,
|
|
||||||
makeStyles,
|
|
||||||
} from "@material-ui/core";
|
|
||||||
import MuiDialogTitle from "@material-ui/core/DialogTitle";
|
|
||||||
import MuiDialogContent from "@material-ui/core/DialogContent";
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
|
@ -64,44 +50,75 @@ export const NewTicketModal: FC<IProps> = ({
|
||||||
action="New Ticket"
|
action="New Ticket"
|
||||||
handleAction={handleSubmit}
|
handleAction={handleSubmit}
|
||||||
>
|
>
|
||||||
<div className="row valign-wrapper indigo">
|
{/* <form onSubmit={handleSubmit}> */}
|
||||||
{/* <div className="col s10">
|
<div className="row">
|
||||||
<h4 className="white-text">New Ticket</h4>
|
<TextField
|
||||||
</div> */}
|
variant="outlined"
|
||||||
|
margin="normal"
|
||||||
|
required
|
||||||
|
fullWidth
|
||||||
|
id="title"
|
||||||
|
value={title}
|
||||||
|
label="Title"
|
||||||
|
name="text"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
setTitle(e.target.value)
|
||||||
|
}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="col s2">
|
<TextField
|
||||||
<i
|
variant="outlined"
|
||||||
className="right material-icons indigo lighten-3 circle"
|
margin="normal"
|
||||||
onClick={handleClose}
|
required
|
||||||
>
|
fullWidth
|
||||||
close
|
id="description"
|
||||||
</i>
|
value={description}
|
||||||
</div>
|
label="Description"
|
||||||
|
name="text"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
||||||
|
setDescription(e.target.value)
|
||||||
|
}
|
||||||
|
multiline
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
id="date"
|
||||||
|
label="Due Date"
|
||||||
|
type="date"
|
||||||
|
// defaultValue={new Date().toISOString()}
|
||||||
|
// className={classes.textField}
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
|
variant="outlined"
|
||||||
|
required
|
||||||
|
value={endingDate}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
setEndingDate(e.target.value)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
id="project"
|
||||||
|
select
|
||||||
|
label="Project"
|
||||||
|
value={projectId}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setProjectId(e.target.value);
|
||||||
|
}}
|
||||||
|
// helperText="Please select your currency"
|
||||||
|
variant="outlined"
|
||||||
|
>
|
||||||
|
{allProjects.map((p) => (
|
||||||
|
<MenuItem key={p.id} value={p.id}>
|
||||||
|
{p.title}
|
||||||
|
</MenuItem>
|
||||||
|
))}
|
||||||
|
</TextField>
|
||||||
</div>
|
</div>
|
||||||
|
{/* </form> */}
|
||||||
<form onSubmit={handleSubmit}>
|
|
||||||
<div className="row">
|
|
||||||
<NewTicketForm
|
|
||||||
title={title}
|
|
||||||
setTitle={setTitle}
|
|
||||||
description={description}
|
|
||||||
setDescription={setDescription}
|
|
||||||
endingDate={endingDate}
|
|
||||||
setEndingDate={setEndingDate}
|
|
||||||
allProjects={allProjects}
|
|
||||||
projectId={projectId}
|
|
||||||
setProjectId={setProjectId}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="modal-footer grey lighten-3">
|
|
||||||
<input
|
|
||||||
type="submit"
|
|
||||||
className="modal-close waves-effect waves-green btn indigo"
|
|
||||||
value="Create Task"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
import { TextField, MenuItem } from "@material-ui/core";
|
||||||
import { Project } from "../types/Project";
|
import { Project } from "../types/Project";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
|
@ -22,45 +23,17 @@ export const NewTicketForm: FC<IProps> = ({
|
||||||
setEndingDate,
|
setEndingDate,
|
||||||
allProjects,
|
allProjects,
|
||||||
projectId,
|
projectId,
|
||||||
setProjectId
|
setProjectId,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="row">
|
{/* <div className="row">
|
||||||
<div className="input-field">
|
|
||||||
<i className="material-icons prefix">note_add</i>
|
|
||||||
<input
|
|
||||||
id="title"
|
|
||||||
type="text"
|
|
||||||
className="validate"
|
|
||||||
value={title}
|
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
||||||
setTitle(e.target.value)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<label htmlFor="title">Title</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="input-field">
|
|
||||||
<i className="material-icons prefix">mode_edit</i>
|
|
||||||
<textarea
|
|
||||||
id="description"
|
|
||||||
className="materialize-textarea validate"
|
|
||||||
value={description}
|
|
||||||
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
|
||||||
setDescription(e.target.value)
|
|
||||||
}
|
|
||||||
></textarea>
|
|
||||||
<label htmlFor="description">Description</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="input-field">
|
<div className="input-field">
|
||||||
<i className="material-icons prefix">date_range</i>
|
<i className="material-icons prefix">date_range</i>
|
||||||
<input
|
<input
|
||||||
id="Due Date"
|
id="Due Date"
|
||||||
type="text"
|
type="text"
|
||||||
className="datepicker"
|
className="datepicker"
|
||||||
value={endingDate}
|
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setEndingDate(e.target.value)
|
setEndingDate(e.target.value)
|
||||||
}
|
}
|
||||||
|
|
@ -81,14 +54,14 @@ export const NewTicketForm: FC<IProps> = ({
|
||||||
<option value={0} disabled>
|
<option value={0} disabled>
|
||||||
Project
|
Project
|
||||||
</option>
|
</option>
|
||||||
{allProjects.map(p => (
|
{allProjects.map((p) => (
|
||||||
<option key={p.id} value={p.id}>
|
<option key={p.id} value={p.id}>
|
||||||
{p.title}
|
{p.title}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue