Skip to content

Commit

Permalink
feat: automatic student class fill
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaspalma committed Jan 23, 2025
1 parent 2204fa3 commit e351a04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ export type DirectExchangeParticipant = {

export type Student = {
name: string,
mecNumber: number
mecNumber: number,
className: string
}

export type CollabSession = {
Expand Down
15 changes: 15 additions & 0 deletions src/components/exchange/requests/issue/cards/CreateRequestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export const CreateRequestCard = ({
setExchangeSchedule(newExchangeSchedule);
}

console.log("Destination student: ", selectedDestinationStudent);

return <Card key={courseInfo.name} className="shadow-md">
<CardHeader className="flex flex-row justify-between items-center gap-4">
<CardTitle className="text-md">{courseInfo.name}</CardTitle>
Expand All @@ -105,6 +107,7 @@ export const CreateRequestCard = ({
</div>
</CardHeader>
<CardContent className="flex flex-col gap-y-4">
{ ((selectedDestinationStudent && selectedDestinationStudent.className === "") || !hasStudentToExchange) &&
<div className="flex flex-row items-center gap-x-2">
<p>{issuerOriginClassName}</p>
<ArrowRightIcon className="w-5 h-5" />
Expand Down Expand Up @@ -141,6 +144,18 @@ export const CreateRequestCard = ({
</DropdownMenu>
</div>
</div>
}

{
(hasStudentToExchange && selectedDestinationStudent && selectedDestinationStudent.className !== "") && (
<div className="flex flex-row gap-x-2">
<p>{issuerOriginClassName}</p>
<ArrowRightIcon className="w-5 h-5" />
<p>{selectedDestinationStudent.className}</p>
</div>
)
}

<div className="flex flex-col gap-y-4">
<div className={`${hasStudentToExchange ? "" : "hidden"}`}>
<DropdownMenu>
Expand Down
1 change: 1 addition & 0 deletions tts-protobufs
Submodule tts-protobufs added at 12aefb

0 comments on commit e351a04

Please sign in to comment.