diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16e72bb..5edde29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,9 @@ on: branches: - main pull_request: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: build-static-assets: runs-on: ubuntu-latest diff --git a/.github/workflows/license_finder.yml b/.github/workflows/license_finder.yml index debe18d..19cadd4 100644 --- a/.github/workflows/license_finder.yml +++ b/.github/workflows/license_finder.yml @@ -4,6 +4,9 @@ on: branches: - main pull_request: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: build-static-assets: runs-on: ubuntu-latest diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 48a846f..bdf273e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -4,6 +4,9 @@ on: branches: [ main, master ] pull_request: branches: [ main, master ] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: test: timeout-minutes: 60 diff --git a/app/lib/definitions.ts b/app/lib/definitions.ts index 165d137..17063fe 100644 --- a/app/lib/definitions.ts +++ b/app/lib/definitions.ts @@ -21,7 +21,7 @@ export type Guest = { name: string; email: string; group_name: string; - status: 'Considered' | 'Invited' | 'Confirmed' | 'Declined'; + status: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative'; } export type Group = { diff --git a/app/ui/guests/table.tsx b/app/ui/guests/table.tsx index 5eb896e..aedd51c 100644 --- a/app/ui/guests/table.tsx +++ b/app/ui/guests/table.tsx @@ -26,12 +26,16 @@ export default function guestsTable() { }); }; + const handleInviteGuest = (e: React.MouseEvent) => handleGuestChange(e, 'invited'); + const handleConfirmGuest = (e: React.MouseEvent) => handleGuestChange(e, 'confirmed'); + const handleDeclineGuest = (e: React.MouseEvent) => handleGuestChange(e, 'declined'); + const handleTentativeGuest = (e: React.MouseEvent) => handleGuestChange(e, 'tentative'); - const handleInviteGuest = (e: React.MouseEvent) => { + const handleGuestChange = (e: React.MouseEvent, status:string) => { fetch("/api/guests/bulk_update.json", { method: 'POST', - body: JSON.stringify({ properties: { status: "invited" }, guest_ids: [e.currentTarget.getAttribute('data-guest-id')] }), + body: JSON.stringify({ properties: { status: status }, guest_ids: [e.currentTarget.getAttribute('data-guest-id')] }), headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': getCsrfToken(), @@ -42,6 +46,7 @@ export default function guestsTable() { } guests.length === 0 && loadGuests(); + const ctaClassName = "text-white py-1 px-2 mx-1 rounded"; return (
@@ -90,6 +95,7 @@ export default function guestsTable() { 'bg-blue-400': guest.status === 'Invited', 'bg-green-600': guest.status === 'Confirmed', 'bg-red-400': guest.status === 'Declined', + 'bg-yellow-400': guest.status === 'Tentative', } )}> @@ -97,9 +103,16 @@ export default function guestsTable() { - {guest.status === 'Considered' && ()} + {(guest.status === 'Invited' || guest.status === 'Tentative') && ( + <> + + {guest.status != 'Tentative' && } + + + )} ))}