diff --git a/backend/samfundet/migrations/0008_recruitmentstatistics_total_rejected.py b/backend/samfundet/migrations/0012_recruitmentstatistics_total_rejected.py similarity index 75% rename from backend/samfundet/migrations/0008_recruitmentstatistics_total_rejected.py rename to backend/samfundet/migrations/0012_recruitmentstatistics_total_rejected.py index 66e7e7ad9..8bcc50cf9 100644 --- a/backend/samfundet/migrations/0008_recruitmentstatistics_total_rejected.py +++ b/backend/samfundet/migrations/0012_recruitmentstatistics_total_rejected.py @@ -1,11 +1,11 @@ -# Generated by Django 5.1.1 on 2024-12-22 00:13 +# Generated by Django 5.1.1 on 2024-12-22 01:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("samfundet", "0007_alter_infobox_color_alter_infobox_image_and_more"), + ("samfundet", "0011_recruitmentposition_file_description_en_and_more"), ] operations = [ diff --git a/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentProgression/RecruitmentProgression.tsx b/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentProgression/RecruitmentProgression.tsx index 26df03064..69724b22f 100644 --- a/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentProgression/RecruitmentProgression.tsx +++ b/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentProgression/RecruitmentProgression.tsx @@ -1,11 +1,9 @@ -import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; import { Button, Link, ProgressBar, SamfundetLogoSpinner } from '~/Components'; -import { Table, type TableRow } from '~/Components/Table'; +import { Table } from '~/Components/Table'; import { Text } from '~/Components/Text/Text'; -import { getRecruitmentStats } from '~/api'; -import { GangStatsDto, type RecruitmentForRecruiterDto, type RecruitmentGangStatDto, RecruitmentStatsDto } from '~/dto'; +import type { RecruitmentForRecruiterDto, RecruitmentGangStatDto } from '~/dto'; import { useCustomNavigate } from '~/hooks'; import { KEY } from '~/i18n/constants'; import { reverse } from '~/named-urls'; diff --git a/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentStatistics/RecruitmentStatistics.tsx b/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentStatistics/RecruitmentStatistics.tsx index f8ba9159e..a2965d755 100644 --- a/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentStatistics/RecruitmentStatistics.tsx +++ b/frontend/src/PagesAdmin/RecruitmentOverviewPage/Components/RecruitmentStatistics/RecruitmentStatistics.tsx @@ -1,4 +1,3 @@ -import { useQuery } from '@tanstack/react-query'; import { useCallback, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; @@ -6,7 +5,6 @@ import { toast } from 'react-toastify'; import { Chart, SamfundetLogoSpinner } from '~/Components'; import { Table } from '~/Components/Table'; import { Text } from '~/Components/Text/Text'; -import { getRecruitmentStats } from '~/api'; import type { RecruitmentStatsDto } from '~/dto'; import { useCustomNavigate, useParentElementWidth } from '~/hooks'; import { KEY } from '~/i18n/constants'; diff --git a/frontend/src/PagesAdmin/RecruitmentOverviewPage/RecruitmentOverviewPage.tsx b/frontend/src/PagesAdmin/RecruitmentOverviewPage/RecruitmentOverviewPage.tsx index 4d27476f5..b2423aba3 100644 --- a/frontend/src/PagesAdmin/RecruitmentOverviewPage/RecruitmentOverviewPage.tsx +++ b/frontend/src/PagesAdmin/RecruitmentOverviewPage/RecruitmentOverviewPage.tsx @@ -6,16 +6,16 @@ import { TabView } from '~/Components'; import type { Tab } from '~/Components/TabBar/TabBar'; import { AdminPageLayout } from '~/PagesAdmin/AdminPageLayout/AdminPageLayout'; import { getRecruitmentForRecruiter } from '~/api'; -import { RecruitmentDto, type RecruitmentForRecruiterDto } from '~/dto'; +import type { RecruitmentForRecruiterDto } from '~/dto'; import { useTitle } from '~/hooks'; import { KEY } from '~/i18n/constants'; +import { dbT } from '~/utils'; import { RecruitmentProgression } from './Components/RecruitmentProgression'; import { RecruitmentStatistics } from './Components/RecruitmentStatistics'; export function RecruitmentOverviewPage() { const { t } = useTranslation(); const { recruitmentId } = useParams(); - const RECRUITMENT_TITLE_PLACEHOLDER: string = 'PLACEHOLDER-RECRUITMENT-TITLE'; const { data, isLoading, error } = useQuery({ queryKey: ['recruitmentStats', recruitmentId], @@ -29,10 +29,11 @@ export function RecruitmentOverviewPage() { { key: 2, label: t(KEY.recruitment_statistics), value: }, ]; }, [data, t]); - + useTitle(t(KEY.recruitment_overview)); + return ( - + ); diff --git a/frontend/src/dto.ts b/frontend/src/dto.ts index fb844bc7d..b6a5d65ef 100644 --- a/frontend/src/dto.ts +++ b/frontend/src/dto.ts @@ -441,7 +441,7 @@ export type RecruitmentForRecruiterDto = RecruitmentDto & { export type RecruitmentWriteDto = RecruitmentDto & { organization: number; -} +}; export type RecruitmentSeparatePositionDto = { id?: number; @@ -582,8 +582,8 @@ export type RecruitmentCampusStatDto = { export type RecruitmentGangStatDto = { gang: GangDto; - total_applications: number; - total_applicants: number; + application_count: number; + applicant_count: number; average_priority: number; total_accepted: number; total_rejected: number;