Skip to content

Commit

Permalink
Fixing the development profile data model (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
niclasheun authored Oct 1, 2024
1 parent 8ab40cd commit 2631627
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 62 deletions.
5 changes: 0 additions & 5 deletions client/src/interface/introCourse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ export interface IntroCourseParticipation {
id: string
tutorId?: string
student: Student
appleId?: string
macBookDeviceId?: string
iphoneDeviceId?: string
ipadDeviceId?: string
appleWatchDeviceId?: string
seat?: string
chairDevice?: string
absences: IntroCourseAbsence[]
Expand Down
113 changes: 56 additions & 57 deletions client/src/management/IntroCourse/components/SeatPlanManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ export const SeatPlanManager = ({ keycloak }: SeatPlanManagerProps): JSX.Element
tutorName: `${tutor?.firstName ?? '-'} ${tutor?.lastName ?? '-'}`,
seat: participation.seat,
needsChairDevice: participation.chairDevice ?? '-',
appleId: participation.appleId,
iPhoneDeviceId: participation.iphoneDeviceId,
iPadDeviceId: participation.ipadDeviceId,
macBookDeviceId: participation.macBookDeviceId,
appleWatchDeviceId: participation.appleWatchDeviceId,
appleId: participation.student.developmentProfile?.appleId,
iPhoneDeviceId: participation.student.developmentProfile?.iPhoneDeviceId,
iPadDeviceId: participation.student.developmentProfile?.iPadDeviceId,
macBookDeviceId: participation.student.developmentProfile?.macBookDeviceId,
appleWatchDeviceId: participation.student.developmentProfile?.appleWatchDeviceId,
}
})}
filename='seat_plan.csv'
Expand Down Expand Up @@ -443,58 +443,57 @@ export const SeatPlanManager = ({ keycloak }: SeatPlanManagerProps): JSX.Element
accessor: 'devices',
title: 'Devices',
textAlign: 'center',
render: ({
appleId,
iphoneDeviceId,
ipadDeviceId,
appleWatchDeviceId,
macBookDeviceId,
}) => (
<>
<Stack>
{!!appleId && (
<Group>
<IconBrandApple color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{appleId}
</Text>
</Group>
)}
{!!macBookDeviceId && (
<Group>
<IconDeviceLaptop color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{macBookDeviceId}
</Text>
</Group>
)}
{!!iphoneDeviceId && (
<Group>
<IconDeviceMobile color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{iphoneDeviceId}
</Text>
</Group>
)}
{!!ipadDeviceId && (
<Group>
<IconDeviceTablet color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{ipadDeviceId}
</Text>
</Group>
)}
{!!appleWatchDeviceId && (
<Group>
<IconDeviceWatch color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{appleWatchDeviceId}
</Text>
</Group>
)}
</Stack>
</>
),
render: ({ student }) => {
const { appleId, iPhoneDeviceId, iPadDeviceId, appleWatchDeviceId, macBookDeviceId } =
student.developmentProfile ?? {}

return (
<>
<Stack>
{!!appleId && (
<Group>
<IconBrandApple color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{appleId}
</Text>
</Group>
)}
{!!macBookDeviceId && (
<Group>
<IconDeviceLaptop color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{macBookDeviceId}
</Text>
</Group>
)}
{!!iPhoneDeviceId && (
<Group>
<IconDeviceMobile color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{iPhoneDeviceId}
</Text>
</Group>
)}
{!!iPadDeviceId && (
<Group>
<IconDeviceTablet color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{iPadDeviceId}
</Text>
</Group>
)}
{!!appleWatchDeviceId && (
<Group>
<IconDeviceWatch color='#2B70BE' />
<Text c='dimmed' fw='500' fz='sm'>
{appleWatchDeviceId}
</Text>
</Group>
)}
</Stack>
</>
)
},
},
{
accessor: 'seat',
Expand Down

0 comments on commit 2631627

Please sign in to comment.