mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 03:36:39 +00:00
update ticketlist
This commit is contained in:
parent
597c8066ae
commit
9e0a2f0d47
1 changed files with 44 additions and 32 deletions
|
|
@ -8,6 +8,7 @@ import { put } from "../utils/http";
|
||||||
import { Constants } from "../utils/Constants";
|
import { Constants } from "../utils/Constants";
|
||||||
import { NewTicketModal } from "./NewTicketModal";
|
import { NewTicketModal } from "./NewTicketModal";
|
||||||
import { Project } from "../types/Project";
|
import { Project } from "../types/Project";
|
||||||
|
import { Grid, Typography } from "@material-ui/core";
|
||||||
|
|
||||||
type TicketListProps = {
|
type TicketListProps = {
|
||||||
tickets: Ticket[];
|
tickets: Ticket[];
|
||||||
|
|
@ -49,38 +50,49 @@ export const TicketList: FC<TicketListProps> = ({
|
||||||
show={showNew}
|
show={showNew}
|
||||||
allProjects={allProjects}
|
allProjects={allProjects}
|
||||||
/>
|
/>
|
||||||
<h3>Tickets</h3>
|
|
||||||
{addButton && (
|
<Grid container>
|
||||||
<FloatingButton color="primary" size="small" onClick={onClick} />
|
<Grid item xs>
|
||||||
)}
|
<Typography variant="h4" component="h4">
|
||||||
<FilterBar
|
Tickets
|
||||||
filterText={filterText}
|
</Typography>
|
||||||
handleChange={handleChange}
|
</Grid>
|
||||||
clearFilterText={clearFilterText}
|
<Grid item xs>
|
||||||
/>
|
{addButton && (
|
||||||
</div>
|
<FloatingButton color="primary" size="small" onClick={onClick} />
|
||||||
<div className="col s12 grey lighten-1">
|
)}
|
||||||
<ul>
|
</Grid>
|
||||||
{filteredTickets.length === 0 ? (
|
<Grid item xs={4}>
|
||||||
<HorizontalCard />
|
<FilterBar
|
||||||
) : (
|
filterText={filterText}
|
||||||
filteredTickets.map((t: Ticket) => (
|
handleChange={handleChange}
|
||||||
<HorizontalCard
|
clearFilterText={clearFilterText}
|
||||||
key={t.id}
|
/>
|
||||||
title={t.title}
|
</Grid>
|
||||||
remainingDays={t.endingDate}
|
<Grid item xs={12}>
|
||||||
link={`/tickets/${t.id}`}
|
<div className="col s12 grey lighten-1">
|
||||||
validateTicket={async (e: MouseEvent) => {
|
{filteredTickets.length === 0 ? (
|
||||||
e.preventDefault();
|
<HorizontalCard />
|
||||||
await put<HttpResponse<Ticket>>(
|
) : (
|
||||||
`${Constants.ticketsURI}/${t.id}/closed`,
|
filteredTickets.map((t: Ticket) => (
|
||||||
{}
|
<HorizontalCard
|
||||||
);
|
key={t.id}
|
||||||
}}
|
title={t.title}
|
||||||
/>
|
remainingDays={t.endingDate}
|
||||||
))
|
link={`/tickets/${t.id}`}
|
||||||
)}
|
validateTicket={async (e: MouseEvent) => {
|
||||||
</ul>
|
e.preventDefault();
|
||||||
|
await put<HttpResponse<Ticket>>(
|
||||||
|
`${Constants.ticketsURI}/${t.id}/closed`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue