Skip to content

Commit

Permalink
setup page
Browse files Browse the repository at this point in the history
  • Loading branch information
Snorre98 committed Nov 15, 2024
1 parent ba566b0 commit b6f3dea
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useState } from 'react';
import { Table } from '~/Components';
import type { TableRow } from '~/Components/Table';
import { AdminPageLayout } from '../AdminPageLayout/AdminPageLayout';

interface Position {
id: string;
name: string;
gang: string;
section: string;
applicantPriority: string;
interviewerPriority: string;
}

export function RecruitmentAllPositionsAdminPage() {
const [positions] = useState<Position[]>([
{
id: '1',
name: 'STILLING 1',
gang: 'SPP',
section: 'Admin',
applicantPriority: '2/3',
interviewerPriority: 'Vil ha',
},
{
id: '2',
name: 'STILLING 2',
gang: 'STINT',
section: 'PR',
applicantPriority: '1/3',
interviewerPriority: 'Vil ikke ha',
},
]);

const columns = [
{ content: 'Position', sortable: true },
{ content: 'Gang', sortable: true },
{ content: 'Section', sortable: true },
{ content: 'Applicant Priority', sortable: true },
{ content: 'Interviewer Priority', sortable: true },
];

const tableData: TableRow[] = positions.map((pos) => ({
cells: [
{ value: pos.name, content: pos.name },
{ value: pos.gang, content: pos.gang },
{ value: pos.section, content: pos.section },
{ value: pos.applicantPriority, content: pos.applicantPriority },
{ value: pos.interviewerPriority, content: pos.interviewerPriority },
],
}));

return (
<AdminPageLayout title="All Positions">
<Table columns={columns} data={tableData} defaultSortColumn={0} />
</AdminPageLayout>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { RecruitmentAllPositionsAdminPage } from './RecruitmentAllPositionsAdminPage';
3 changes: 2 additions & 1 deletion frontend/src/PagesAdmin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { InformationFormAdminPage } from './InformationFormAdminPage';
export { InterviewNotesPage } from './InterviewNotesAdminPage';
export { OpeningHoursAdminPage } from './OpeningHoursAdminPage';
export { RecruitmentAdminPage } from './RecruitmentAdminPage';
export { RecruitmentAllPositionsAdminPage } from './RecruitmentAllPositionsAdminPage';
export { RecruitmentApplicantAdminPage } from './RecruitmentApplicantAdminPage';
export { RecruitmentFormAdminPage } from './RecruitmentFormAdminPage';
export { RecruitmentGangAdminPage } from './RecruitmentGangAdminPage';
Expand All @@ -27,9 +28,9 @@ export { RecruitmentSeparatePositionFormAdminPage } from './RecruitmentSeparateP
export { RecruitmentUnprocessedApplicantsPage } from './RecruitmentUnprocessedApplicantsPage';
export { RecruitmentUsersWithoutInterviewGangPage } from './RecruitmentUsersWithoutInterviewGangPage';
export { RecruitmentUsersWithoutThreeInterviewCriteriaPage } from './RecruitmentUsersWithoutThreeInterviewCriteriaPage';
export { RolesAdminPage } from './RolesAdminPage';
export { RoleAdminPage } from './RoleAdminPage';
export { RoleFormAdminPage } from './RoleFormAdminPage';
export { RolesAdminPage } from './RolesAdminPage';
export { CreateInterviewRoomPage, RoomAdminPage } from './RoomAdminPage';
export { SaksdokumentAdminPage } from './SaksdokumentAdminPage';
export { SaksdokumentFormAdminPage } from './SaksdokumentFormAdminPage';
Expand Down
28 changes: 27 additions & 1 deletion frontend/src/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
InterviewNotesPage,
OpeningHoursAdminPage,
RecruitmentAdminPage,
RecruitmentAllPositionsAdminPage,
RecruitmentApplicantAdminPage,
RecruitmentFormAdminPage,
RecruitmentGangAdminPage,
Expand Down Expand Up @@ -375,13 +376,26 @@ export const router = createBrowserRouter(
<PermissionRoute required={[PERM.SAMFUNDET_VIEW_RECRUITMENT]} element={<RecruitmentOverviewPage />} />
}
/>
<Route
{/* <Route
path={ROUTES.frontend.admin_recruitment_create}
element={
<PermissionRoute required={[PERM.SAMFUNDET_ADD_RECRUITMENT]} element={<RecruitmentFormAdminPage />} />
}
handle={{ crumb: ({ pathname }: UIMatch) => <Link url={pathname}>{t(KEY.common_create)}</Link> }}
/> */}
<Route
path={ROUTES.frontend.admin_recruitment_all_positions}
element={
<PermissionRoute
required={[PERM.SAMFUNDET_VIEW_RECRUITMENT]}
element={<RecruitmentAllPositionsAdminPage />}
/>
}
handle={{
crumb: ({ pathname }: UIMatch) => <Link url={pathname}>{t(KEY.recruitment_administrate)}</Link>,
}}
/>

<Route
path={ROUTES.frontend.admin_recruitment_gang_all_applications}
element={<RecruitmentGangAllApplicantsAdminPage />}
Expand Down Expand Up @@ -541,6 +555,18 @@ export const router = createBrowserRouter(
),
}}
/>
<Route
path="all-positions/:recruitmentId"
element={
<PermissionRoute
required={[PERM.SAMFUNDET_VIEW_RECRUITMENT]}
element={<RecruitmentAllPositionsAdminPage />}
/>
}
handle={{
crumb: ({ pathname }: UIMatch) => <Link url={pathname}>{t(KEY.recruitment_administrate)}</Link>,
}}
/>
<Route
element={<Outlet />}
loader={gangLoader}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/routes/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const ROUTES_FRONTEND = {
admin_sulten_menuitem_edit: '/control-panel/lyche/menuitems/edit/:id',
admin_sulten_reservations: '/control-panel/lyche/reservations',
admin_recruitment_applicant: '/control-panel/recruitment/view-applicant/:applicationID/',
admin_recruitment_all_positions: '/control-panel/recruitment/:recruitmentId/all-positions/',
// ==================== //
// Development //
// ==================== //
Expand Down

0 comments on commit b6f3dea

Please sign in to comment.