Skip to content

Commit

Permalink
fix: form access and summary page confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
hampfh committed Aug 5, 2024
1 parent 1bb2c7c commit e5c3041
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 1 addition & 3 deletions apps/dashboard/src/forms/form_access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export const FORM_ACCESS: FormAccessDeclaration = {
"complete_registration:::unsigned_ir:::*": CardStatus.Shown
},
ir_additional_info: {
"before_initial_registration:::*:::*": CardStatus.HiddenLocked,
"*:::unsigned_ir:::*": CardStatus.HiddenLocked,
"*:::*:::!rejected": CardStatus.Shown
"initial_registration:::!unsigned_ir:::*": CardStatus.Shown
},
exhibitor_catalog: {
"initial_registration:::!unsigned_ir:::*": CardStatus.Shown,
Expand Down
23 changes: 22 additions & 1 deletion apps/dashboard/src/forms/fr_accounting/summary.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function SummaryFormPage() {
const [confirmTerms, setConfirmTerms] = useState<boolean>(false)
const [confirmBinding, setConfirmBinding] = useState(false)
const [confirmEligibility, setConfirmEligibility] = useState(false)
const [allowLateConfirmation, setAllowLateConfirmation] = useState(false)

const { data } = useDashboard()
const { data: orders, isLoading: isLoadingOrders } = useOrders()
Expand All @@ -39,7 +40,11 @@ export function SummaryFormPage() {

const unfilledFields: Array<unknown> = []

const readyToSign = confirmTerms && confirmBinding && confirmEligibility
const readyToSign =
confirmTerms &&
confirmBinding &&
confirmEligibility &&
allowLateConfirmation

async function submitRegistration() {
const response = await fetch(`${HOST}/api/dashboard/submit`, {
Expand Down Expand Up @@ -138,6 +143,22 @@ export function SummaryFormPage() {
Tekniska Högskolans Studentkår, org. nr. 802005-9153
</Label>
</div>
<div className="mt-2 flex items-center space-x-4">
<Checkbox
id="allow_late_confirmation"
checked={allowLateConfirmation}
onCheckedChange={x =>
x != "indeterminate" && setAllowLateConfirmation(x)
}
/>
<Label
htmlFor="allow_late_confirmation"
className="text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
I understand that the event may be full and that THS
Armada will confirm my spot as soon as possible.
</Label>
</div>

<div className="flex items-center gap-x-5">
<Checkbox
Expand Down

0 comments on commit e5c3041

Please sign in to comment.