Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
Add 'Move to Waiting List button' (#292)
Browse files Browse the repository at this point in the history
* Add Waiting List action

* rename to Move to Waiting List

* change color of waiting list button
  • Loading branch information
FinnIckler authored Oct 27, 2023
1 parent c8b9d70 commit 95a9a68
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ export default function RegistrationActions({ selected, refresh }) {
const anySelected =
selected.pending.length > 0 ||
selected.accepted.length > 0 ||
selected.cancelled.length > 0
selected.cancelled.length > 0 ||
selected.waiting > 0
const anyApprovable =
selected.pending.length > 0 || selected.cancelled.length > 0
selected.pending.length > 0 ||
selected.cancelled.length > 0 ||
selected.waiting.length > 0
const anyRejectable =
selected.accepted.length > 0 || selected.cancelled.length > 0
const anyDeletable =
selected.pending.length > 0 || selected.accepted.length > 0
selected.accepted.length > 0 ||
selected.cancelled.length > 0 ||
selected.waiting.length > 0
const anyCancellable =
selected.pending.length > 0 ||
selected.accepted.length > 0 ||
selected.waiting.length > 0
const anyWaitlistable =
selected.pending.length > 0 ||
selected.accepted.length > 0 ||
selected.cancelled.length > 0
const { mutate: updateRegistrationMutation } = useMutation({
mutationFn: updateRegistration,
onError: (data) => {
Expand Down Expand Up @@ -60,6 +71,7 @@ export default function RegistrationActions({ selected, refresh }) {
...selected.pending,
...selected.accepted,
...selected.cancelled,
...selected.waiting,
]
.map((user) => user + '@worldcubeassociation.org')
.join(',')}`}
Expand All @@ -75,7 +87,11 @@ export default function RegistrationActions({ selected, refresh }) {
positive
onClick={() =>
changeStatus(
[...selected.pending, ...selected.cancelled],
[
...selected.pending,
...selected.cancelled,
...selected.waiting,
],
'accepted'
)
}
Expand All @@ -87,25 +103,50 @@ export default function RegistrationActions({ selected, refresh }) {
<Button
onClick={() =>
changeStatus(
[...selected.accepted, ...selected.cancelled],
[
...selected.accepted,
...selected.cancelled,
...selected.waiting,
],
'pending'
)
}
>
<UiIcon name="times" /> Reject
<UiIcon name="times" /> Move to Pending
</Button>
)}
{anyWaitlistable && (
<Button
color="yellow"
onClick={() =>
changeStatus(
[
...selected.pending,
...selected.cancelled,
...selected.accepted,
],
'waiting_list'
)
}
>
<UiIcon name="hourglass" /> Move to Waiting List
</Button>
)}
{anyDeletable && (
{anyCancellable && (
<Button
negative
onClick={() =>
changeStatus(
[...selected.pending, ...selected.cancelled],
[
...selected.pending,
...selected.accepted,
...selected.waiting,
],
'cancelled'
)
}
>
<UiIcon name="trash" /> Delete
<UiIcon name="trash" /> Cancel Registration
</Button>
)}
</Button.Group>
Expand Down
3 changes: 2 additions & 1 deletion Frontend/src/watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const context = await esbuild.context({
],
define: {
// Make sure you are running a version of the Monolith on port 3000 if needed
'process.env.WCA_URL': `"http://localhost:3000"`,
// 'process.env.WCA_URL': `"http://localhost:3000"`,
'process.env.WCA_URL': `"https://staging.worldcubeassociation.org"`,
'process.env.API_URL': '"http://localhost:3001/api/v1"',
'process.env.NODE_ENV': '"development"',
},
Expand Down

0 comments on commit 95a9a68

Please sign in to comment.