-
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(Backend & Frontend): Move exam event selection to contact request…
… handling
- Loading branch information
Showing
14 changed files
with
204 additions
and
179 deletions.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
backend/vkt/src/main/java/fi/oph/vkt/api/dto/examiner/ExaminerEnrollmentExamEventDTO.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,6 @@ | ||
package fi.oph.vkt.api.dto.examiner; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.NonNull; | ||
|
||
public record ExaminerEnrollmentExamEventDTO(@NonNull @NotNull Long id) {} |
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
28 changes: 28 additions & 0 deletions
28
frontend/packages/vkt/src/hooks/useExamEventDescription.ts
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,28 @@ | ||
import { DateUtils } from 'shared/utils'; | ||
|
||
import { | ||
useCommonTranslation, | ||
useKoodistoMunicipalitiesTranslation, | ||
} from 'configs/i18n'; | ||
import { ExaminerExamEvent } from 'interfaces/examinerExamEvent'; | ||
|
||
export const useExamEventDescription = () => { | ||
const translateCommon = useCommonTranslation(); | ||
const translateMunicipality = useKoodistoMunicipalitiesTranslation(); | ||
const describeExamEvent = ({ | ||
language, | ||
date, | ||
examTime, | ||
municipality, | ||
}: ExaminerExamEvent) => { | ||
const dateStr = DateUtils.formatOptionalDate(date); | ||
|
||
return [ | ||
translateCommon(`examLanguage.${language}`), | ||
examTime ? `${dateStr} ${examTime}` : dateStr, | ||
translateMunicipality(municipality.code), | ||
].join(', '); | ||
}; | ||
|
||
return describeExamEvent; | ||
}; |
Oops, something went wrong.