Add license and automatic copyright notice #66

Merged
bustikiller merged 12 commits from license into main 2024-10-27 21:23:25 +00:00
5 changed files with 26 additions and 4 deletions
Showing only changes of commit f66f1eb0ca - Show all commits

View File

@ -4,6 +4,9 @@ on:
branches: branches:
- main - main
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build-static-assets: build-static-assets:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -4,6 +4,9 @@ on:
branches: branches:
- main - main
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build-static-assets: build-static-assets:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -4,6 +4,9 @@ on:
branches: [ main, master ] branches: [ main, master ]
pull_request: pull_request:
branches: [ main, master ] branches: [ main, master ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
timeout-minutes: 60 timeout-minutes: 60

View File

@ -21,7 +21,7 @@ export type Guest = {
name: string; name: string;
email: string; email: string;
group_name: string; group_name: string;
status: 'Considered' | 'Invited' | 'Confirmed' | 'Declined'; status: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
} }
export type Group = { export type Group = {

View File

@ -26,12 +26,16 @@ export default function guestsTable() {
}); });
}; };
const handleInviteGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'invited');
const handleConfirmGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'confirmed');
const handleDeclineGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'declined');
const handleTentativeGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'tentative');
const handleInviteGuest = (e: React.MouseEvent<HTMLElement>) => { const handleGuestChange = (e: React.MouseEvent<HTMLElement>, status:string) => {
fetch("/api/guests/bulk_update.json", fetch("/api/guests/bulk_update.json",
{ {
method: 'POST', 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: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(), 'X-CSRF-TOKEN': getCsrfToken(),
@ -42,6 +46,7 @@ export default function guestsTable() {
} }
guests.length === 0 && loadGuests(); guests.length === 0 && loadGuests();
const ctaClassName = "text-white py-1 px-2 mx-1 rounded";
return ( return (
<div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg"> <div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg">
@ -90,6 +95,7 @@ export default function guestsTable() {
'bg-blue-400': guest.status === 'Invited', 'bg-blue-400': guest.status === 'Invited',
'bg-green-600': guest.status === 'Confirmed', 'bg-green-600': guest.status === 'Confirmed',
'bg-red-400': guest.status === 'Declined', 'bg-red-400': guest.status === 'Declined',
'bg-yellow-400': guest.status === 'Tentative',
} }
)}> )}>
</span> </span>
@ -97,9 +103,16 @@ export default function guestsTable() {
</span> </span>
</td> </td>
<td> <td>
{guest.status === 'Considered' && (<button data-guest-id={guest.id} onClick={handleInviteGuest} className="bg-blue-300 hover:bg-blue-500 text-white py-1 px-2 rounded"> {guest.status === 'Considered' && (<button data-guest-id={guest.id} onClick={handleInviteGuest} className={`${ctaClassName} bg-blue-400 hover:bg-blue-600`}>
Invite Invite
</button>)} </button>)}
{(guest.status === 'Invited' || guest.status === 'Tentative') && (
<>
<button data-guest-id={guest.id} onClick={handleConfirmGuest} className={`${ctaClassName} bg-green-500 hover:bg-green-600`}>Confirm</button>
{guest.status != 'Tentative' && <button data-guest-id={guest.id} onClick={handleDeclineGuest} className={`${ctaClassName} bg-yellow-500 hover:bg-yellow-700`}>Tentative</button>}
<button data-guest-id={guest.id} onClick={handleDeclineGuest} className={`${ctaClassName} bg-red-500 hover:bg-red-600`}>Decline</button>
</>
)}
</td> </td>
</tr> </tr>
))} ))}