Skip to content

Commit

Permalink
Merge branch 'master' into robin/send-match-to-crumb
Browse files Browse the repository at this point in the history
  • Loading branch information
robines committed Sep 29, 2024
2 parents 389e724 + e65f650 commit 9065642
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ export function RecruitmentRecruiterDashboardPage() {
const [applications, setApplications] = useState<RecruitmentApplicationDto[]>();
const [loading, setLoading] = useState(true);

// biome-ignore lint/correctness/useExhaustiveDependencies: navigate must not be in deplist
useEffect(() => {
if (recruitmentId) {
getRecruitmentRecruiterDashboard(recruitmentId)
.then((resp) => {
setRecruitment(resp.data.recruitment);
setApplications(resp.data.applications);
setLoading(false);
})
.catch((data) => {
toast.error(t(KEY.common_something_went_wrong));
if (data.request.status === STATUS.HTTP_404_NOT_FOUND) {
navigate({ url: ROUTES.frontend.not_found });
}
});
}
}, [navigate, recruitmentId, t]);
if (!recruitmentId) return;
getRecruitmentRecruiterDashboard(recruitmentId)
.then((resp) => {
setRecruitment(resp.data.recruitment);
setApplications(resp.data.applications);
setLoading(false);
})
.catch((data) => {
toast.error(t(KEY.common_something_went_wrong));
if (data.request.status === STATUS.HTTP_404_NOT_FOUND) {
navigate({ url: ROUTES.frontend.not_found });
}
});
}, [recruitmentId, t]);

if (!recruitmentId) {
navigate({ url: ROUTES.frontend.not_found });
return <></>;
}

const title = `${t(KEY.recruitment_overview)} - ${getObjectFieldOrNumber(recruitment?.organization, 'name')} - ${dbT(
const title = `${t(KEY.recruitment_recruiter_dashboard)} - ${getObjectFieldOrNumber(recruitment?.organization, 'name')} - ${dbT(
recruitment,
'name',
)}`;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export const KEY = {
recruitment_no_current_applications_gang: 'recruitment_no_current_applications_gang',
recruitment_progression: 'recruitment_progression',
recruitment_overview: 'recruitment_overview',
recruitment_recruiter_dashboard: 'recruitment_recruiter_dashboard',
recruitment_dashboard_description: 'recruitment_dashboard_description',
recruitment_application: 'recruitment_application',
recruitment_admitted: 'recruitment_admitted',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export const nb = prepareTranslations({
[KEY.recruitment_applications]: 'søknader',
[KEY.recruitment_progression]: 'Opptak fremgang',
[KEY.recruitment_overview]: 'Opptak oversikt',
[KEY.recruitment_recruiter_dashboard]: 'Dashbord',
[KEY.recruitment_statistics]: 'Opptak statistikk',
[KEY.recruitment_applications_processed]: 'søknader behandlet',
[KEY.recruitment_automatic_rejection]: 'Automatisk avslag',
Expand Down Expand Up @@ -723,6 +724,7 @@ export const en = prepareTranslations({
[KEY.application_deadline]: 'Application deadline',
[KEY.recruitment_progression]: 'Recruitment progression',
[KEY.recruitment_overview]: 'Recruitment overview',
[KEY.recruitment_recruiter_dashboard]: 'Dashboard',
[KEY.recruitment_admitted]: 'admitted',
[KEY.recruitment_statistics]: 'Recruitment statistics',
[KEY.recruitment_applications]: 'applications',
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,6 @@ export const router = createBrowserRouter(
}
handle={{ crumb: () => <Link url={ROUTES.frontend.admin_recruitment_create}>{t(KEY.common_create)}</Link> }}
/>
<Route
path={ROUTES.frontend.admin_recruitment_recruiter_dashboard}
element={<RecruitmentRecruiterDashboardPage />}
/>
<Route
path={ROUTES.frontend.admin_recruitment_gang_all_applications}
element={<RecruitmentGangAllApplicantsAdminPage />}
Expand Down Expand Up @@ -409,6 +405,15 @@ export const router = createBrowserRouter(
crumb: ({ pathname }: UIMatch) => <Link url={pathname}>{t(KEY.common_edit)}</Link>,
}}
/>
<Route
path={ROUTES.frontend.admin_recruitment_recruiter_dashboard}
element={<RecruitmentRecruiterDashboardPage />}
handle={{
crumb: ({ pathname }: UIMatch) => (
<Link url={pathname}>{t(KEY.recruitment_recruiter_dashboard)}</Link>
),
}}
/>
<Route
path={ROUTES.frontend.admin_recruitment_gang_separateposition_create}
element={
Expand Down

0 comments on commit 9065642

Please sign in to comment.