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