Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly group tickets on an order, search guests by created reason, remove 'vip' button from ineligble guests #83

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/TicketsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const eventsById = {};

tickets.forEach(ticket => {
const { eventId, eventName, eventDate } = ticket;

Check warning on line 19 in src/components/TicketsList.js

View workflow job for this annotation

GitHub Actions / build

'eventDate' is assigned a value but never used
if(!eventsById[eventId]) {
eventsById[eventId] = {
id: eventId,
Expand All @@ -28,11 +28,11 @@
eventsById[eventId].tickets.push(ticket);
});

return Object.values(eventsById).map(({ id: eventId, name: eventName, dateString, timeString, tickets: eventTickets }) => (

Check warning on line 31 in src/components/TicketsList.js

View workflow job for this annotation

GitHub Actions / build

'dateString' is defined but never used

Check warning on line 31 in src/components/TicketsList.js

View workflow job for this annotation

GitHub Actions / build

'timeString' is defined but never used
<div key={eventId}>
<h5>{eventName}</h5>
<ul className="tickets-list">
{[...tickets].sort(sortTickets).map(({
{[...eventTickets].sort(sortTickets).map(({
id,
admissionTier,
status
Expand Down
2 changes: 1 addition & 1 deletion src/guests/components/GuestsListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const GuestsListItem = ({ guest, updateGuest, event, role }) => (
? checkScope(role, 'write')
? <button onClick={() => confirm('Are you sure you want to downgrade this guest?') && updateGuest(guest.id, {admissionTier: 'general'})}>{'\u2713'} VIP</button>
: <p>&#9989;</p>
: checkScope(role, 'write')
: checkScope(role, 'write') && guest.admissionTier === 'general'
? <button onClick={() => updateGuest(guest.id, {admissionTier: 'vip'})}>Make VIP</button>
: ''
}
Expand Down
1 change: 1 addition & 0 deletions src/guests/components/GuestsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const GuestsTable = () => {
return (
filterRegEx.test(g.firstName + ' ' + g.lastName) ||
filterRegEx.test(g.orderId) ||
filterRegEx.test(g.createdReason ?? '') ||
filterRegEx.test(g.meta.comment ?? '')
);
});
Expand Down
Loading