Skip to content
Snippets Groups Projects
Commit f2b7f226 authored by Tore.Brede's avatar Tore.Brede
Browse files

Fixing problems after merge with master

parent c58a1740
No related branches found
No related tags found
1 merge request!119Adding section on sponsorpage
Pipeline #98158 passed
This commit is part of merge request !119. Comments created here will be created in the context of that merge request.
......@@ -6,6 +6,8 @@ export type Guest = {
mobile: string
fnr: string
active: boolean
registered: boolean
verified: boolean
roles: Role[]
}
......@@ -17,6 +19,8 @@ export interface FetchedGuest {
mobile: string
fnr: string
active: boolean
registered: boolean
verified: boolean
roles: FetchedRole[]
}
......@@ -40,6 +44,4 @@ export type FetchedRole = {
start_date: string
end_date: string
max_days: number
registered: boolean
verified: boolean
}
......@@ -115,9 +115,19 @@ const WaitingForGuestRegistration = ({ persons }: GuestProps) => {
</TableRow>
</TableHead>
<TableBody>
{guests.map((person) => (
<PersonLine person={person} />
))}
{guests.length > 0 ? (
guests.map((person) =>
person.roles ? (
person.roles.map((role) => (
<PersonLine role={role} person={person} />
))
) : (
<></>
)
)
) : (
<></>
)}
<TableRow>
<TableCell>
......@@ -172,7 +182,11 @@ const ActiveGuests = ({ persons }: GuestProps) => {
guests.map((person) =>
person.roles ? (
person.roles.map((role) => (
<PersonLine role={role} person={person} showStatusColumn/>
<PersonLine
role={role}
person={person}
showStatusColumn
/>
))
) : (
<></>
......
......@@ -67,6 +67,8 @@ export default function GuestInfo() {
fnr: '',
mobile: '',
active: false,
registered: false,
verified: false,
roles: [],
})
const [roles, setRoles] = useState<Role[]>([])
......@@ -84,6 +86,8 @@ export default function GuestInfo() {
mobile: rjson.mobile,
fnr: rjson.fnr,
active: rjson.active,
registered: rjson.registered,
verified: rjson.verified,
roles: rjson.roles,
})
setRoles(rjson.roles.map((role: FetchedRole) => parseRole(role)))
......
......@@ -106,8 +106,8 @@ class GuestInfoView(APIView):
"mobile": person.private_mobile and person.private_mobile.value,
"fnr": person.fnr and "".join((person.fnr.value[:-5], "*****")),
"active": person.is_registered and person.is_verified,
"registered": i.person.is_registered,
"verified": i.person.is_verified,
"registered": person.is_registered,
"verified": person.is_verified,
"roles": [
{
"id": role.id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment