From 3d09375397739406388db9546d2358804d42800e Mon Sep 17 00:00:00 2001 From: andsamfu Date: Thu, 31 Oct 2024 20:06:53 +0100 Subject: [PATCH 1/8] Created missing useTitle to files (#1545) * Created missing useTitle to files * Removed unused code * Added back wrong deleted file, and short modified code --- .../OrganizationRecruitmentPage.tsx | 3 ++- .../InterviewNotesAdminPage/InterviewNotesAdminPage.tsx | 5 ++++- .../RecruitmentGangAllApplicantsAdminPage.tsx | 3 ++- .../RecruitmentOverviewPage/RecruitmentOverviewPage.tsx | 2 ++ .../RecruitmentRecruiterDashboardPage.tsx | 3 ++- .../RecruitmentSeparatePositionFormAdminPage.tsx | 5 ++++- .../RecruitmentUsersWithoutInterviewGangPage.tsx | 3 ++- .../RecruitmentUsersWithoutThreeInterviewCriteriaPage.tsx | 3 ++- frontend/src/PagesAdmin/RoleAdminPage/RoleAdminPage.tsx | 5 ++++- frontend/src/PagesAdmin/RolesAdminPage/RolesAdminPage.tsx | 6 ++++-- frontend/src/PagesAdmin/RoomAdminPage/RoomAdminPage.tsx | 3 ++- .../SultenMenuItemFormAdminPage.tsx | 2 ++ frontend/src/PagesAdmin/UsersAdminPage/UsersAdminPage.tsx | 5 ++++- 13 files changed, 36 insertions(+), 12 deletions(-) diff --git a/frontend/src/Pages/OrganizationRecruitmentPage/OrganizationRecruitmentPage.tsx b/frontend/src/Pages/OrganizationRecruitmentPage/OrganizationRecruitmentPage.tsx index d2ab3e25b..efae692f0 100644 --- a/frontend/src/Pages/OrganizationRecruitmentPage/OrganizationRecruitmentPage.tsx +++ b/frontend/src/Pages/OrganizationRecruitmentPage/OrganizationRecruitmentPage.tsx @@ -7,7 +7,7 @@ import { PersonalRow } from '~/Pages/RecruitmentPage'; import { getOrganization, getRecruitment } from '~/api'; import { useOrganizationContext } from '~/context/OrgContextProvider'; import type { RecruitmentDto } from '~/dto'; -import { useDesktop } from '~/hooks'; +import { useDesktop, useTitle } from '~/hooks'; import { KEY } from '~/i18n/constants'; import { OrgNameType, type OrgNameTypeValue } from '~/types'; import { dbT, getObjectFieldOrNumber } from '~/utils'; @@ -24,6 +24,7 @@ export function OrganizationRecruitmentPage() { const [recruitment, setRecruitment] = useState(); const [organizationName, setOrganizationName] = useState(OrgNameType.FALLBACK); const [loading, setLoading] = useState(true); + useTitle(dbT(recruitment, 'name') ?? ''); useEffect(() => { if (recruitmentId) { diff --git a/frontend/src/PagesAdmin/InterviewNotesAdminPage/InterviewNotesAdminPage.tsx b/frontend/src/PagesAdmin/InterviewNotesAdminPage/InterviewNotesAdminPage.tsx index 17a0c9d3f..011e6a765 100644 --- a/frontend/src/PagesAdmin/InterviewNotesAdminPage/InterviewNotesAdminPage.tsx +++ b/frontend/src/PagesAdmin/InterviewNotesAdminPage/InterviewNotesAdminPage.tsx @@ -6,6 +6,7 @@ import { Button } from '~/Components'; import { TextAreaField } from '~/Components/TextAreaField/TextAreaField'; import { getRecruitmentApplicationsForGang, putRecruitmentApplicationInterview } from '~/api'; import type { InterviewDto, RecruitmentApplicationDto } from '~/dto'; +import { useTitle } from '~/hooks'; import { STATUS } from '~/http_status_codes'; import { KEY } from '~/i18n/constants'; import { ROUTES } from '~/routes'; @@ -25,6 +26,8 @@ export function InterviewNotesPage() { const [nameUser, setNameUser] = useState(''); const { t } = useTranslation(); const navigate = useNavigate(); + const title = t(KEY.recruitment_interview_notes); + useTitle(title); // biome-ignore lint/correctness/useExhaustiveDependencies: t does not need to be in deplist useEffect(() => { @@ -73,7 +76,7 @@ export function InterviewNotesPage() { } return ( - +