-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VKT(Frontend & Backend): Examiner contact request listing
- Loading branch information
Showing
13 changed files
with
158 additions
and
15 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
backend/vkt/src/main/java/fi/oph/vkt/api/dto/examiner/ExaminerContactRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package fi.oph.vkt.api.dto.examiner; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import java.util.List; | ||
import lombok.Builder; | ||
import lombok.NonNull; | ||
|
||
@Builder | ||
public record ExaminerContactRequestDTO( | ||
@NonNull Long id, | ||
@NonNull String lastName, | ||
@NonNull String firstName | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...d/packages/vkt/src/components/examinerExamEvent/listing/ExaminerContactRequestListing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import ChevronRightIcon from '@mui/icons-material/ChevronRight'; | ||
import { TableCell, TableHead, TableRow } from '@mui/material'; | ||
import { CustomButtonLink, CustomTable, Text } from 'shared/components'; | ||
import { Color, Variant } from 'shared/enums'; | ||
|
||
import { useAppSelector } from 'configs/redux'; | ||
import { AppRoutes } from 'enums/app'; | ||
import { ContactRequest } from 'interfaces/examinerDetails'; | ||
import { examinerDetailsSelector } from 'redux/selectors/examinerDetails'; | ||
|
||
const ExaminerExamEventListingHeader = () => { | ||
return ( | ||
<TableHead className="heading-text"> | ||
<TableRow> | ||
<TableCell>Etunimi</TableCell> | ||
<TableCell>Sukunimi</TableCell> | ||
<TableCell>Toiminnot</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
); | ||
}; | ||
|
||
const ExaminerContactRequestListingRow = ({ | ||
contactRequest, | ||
}: { | ||
contactRequest: ContactRequest; | ||
}) => { | ||
return ( | ||
<TableRow> | ||
<TableCell> | ||
<Text>{contactRequest.firstName}</Text> | ||
</TableCell> | ||
<TableCell> | ||
<Text>{contactRequest.lastName}</Text> | ||
</TableCell> | ||
<TableCell> | ||
<CustomButtonLink | ||
sx={{ padding: 0 }} | ||
variant={Variant.Text} | ||
color={Color.Secondary} | ||
endIcon={<ChevronRightIcon />} | ||
to={AppRoutes.ClerkEnrollmentContactRequestPage.replace( | ||
/:enrollmentContactRequestId/, | ||
contactRequest.id.toString(), | ||
)} | ||
> | ||
Katso tiedot | ||
</CustomButtonLink> | ||
</TableCell> | ||
</TableRow> | ||
); | ||
}; | ||
|
||
const getRowDetails = (contactRequest: ContactRequest) => { | ||
return <ExaminerContactRequestListingRow contactRequest={contactRequest} />; | ||
}; | ||
|
||
const ExaminerContactRequestsTable = ({ | ||
contactRequests, | ||
}: { | ||
contactRequests: Array<ContactRequest>; | ||
}) => { | ||
return ( | ||
<CustomTable | ||
className="table-layout-auto" | ||
data={contactRequests} | ||
getRowDetails={getRowDetails} | ||
header={<ExaminerExamEventListingHeader />} | ||
/> | ||
); | ||
}; | ||
|
||
export const ExaminerContactRequestListing = () => { | ||
const { examiner } = useAppSelector(examinerDetailsSelector); | ||
|
||
return ( | ||
examiner?.contactRequests && | ||
examiner?.contactRequests?.length > 0 && ( | ||
<ExaminerContactRequestsTable | ||
contactRequests={examiner.contactRequests} | ||
/> | ||
) | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters