-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit Person Requests page in WRT panel (#10451)
* Edit Person Requests page in WRT panel * Review changes --------- Co-authored-by: Daniel M James <[email protected]>
- Loading branch information
1 parent
a7354e8
commit eb7f694
Showing
7 changed files
with
107 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
app/webpacker/components/Panel/pages/EditPersonRequestsPage/index.jsx
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,22 @@ | ||
import React from 'react'; | ||
import { Header } from 'semantic-ui-react'; | ||
import _ from 'lodash'; | ||
import TicketsList from '../../../TicketsList'; | ||
import { ticketTypes, ticketStatuses } from '../../../../lib/wca-data.js.erb'; | ||
|
||
export default function EditPersonRequestsPage() { | ||
return ( | ||
<> | ||
{[ticketStatuses.edit_person.open, ticketStatuses.edit_person.closed].map((status) => ( | ||
<> | ||
<Header>{`${_.upperFirst(status)} Tickets`}</Header> | ||
<TicketsList | ||
type={ticketTypes.edit_person} | ||
status={status} | ||
sort="createdAt:desc" | ||
/> | ||
</> | ||
))} | ||
</> | ||
); | ||
} |
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,29 @@ | ||
import React from 'react'; | ||
import { List } from 'semantic-ui-react'; | ||
import useLoadedData from '../../lib/hooks/useLoadedData'; | ||
import { viewUrls } from '../../lib/requests/routes.js.erb'; | ||
import Loading from '../Requests/Loading'; | ||
import Errored from '../Requests/Errored'; | ||
|
||
export default function TicketsList({ type, status, sort }) { | ||
const { data: tickets, loading, error } = useLoadedData( | ||
viewUrls.tickets.list(type, status, sort), | ||
); | ||
|
||
if (loading) return <Loading />; | ||
if (error) return <Errored />; | ||
|
||
return ( | ||
<List divided relaxed> | ||
{tickets.map((ticket) => ( | ||
<List.Item> | ||
<List.Content> | ||
<List.Header as="a" href={viewUrls.tickets.show(ticket.id)}> | ||
{`Ticket #${ticket.id}`} | ||
</List.Header> | ||
</List.Content> | ||
</List.Item> | ||
))} | ||
</List> | ||
); | ||
} |
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