diff --git a/services/backend/src/services/faculty/facultyBasics.ts b/services/backend/src/services/faculty/facultyBasics.ts index 26d5fe1a3e..cdc9607ab9 100644 --- a/services/backend/src/services/faculty/facultyBasics.ts +++ b/services/backend/src/services/faculty/facultyBasics.ts @@ -1,12 +1,11 @@ import { cloneDeep } from 'lodash' +import { NameWithCode } from '../../shared/types' import { DegreeProgrammeType } from '../../types' import { getBasicStats, setBasicStats } from '../analyticsService' import { getBasicStatsForStudytrack } from '../studyProgramme/studyProgrammeBasics' import type { ProgrammesOfOrganization } from './faculty' -type ProgrammeName = { code: string; en?: string; fi?: string; sv?: string } - type StudyTrackBasicStats = Awaited> const calculateCombinedStats = async ( @@ -19,12 +18,12 @@ const calculateCombinedStats = async ( graphStats: [] as StudyTrackBasicStats['graphStats'], programmeTableStats: {} as Record, tableStats: [] as StudyTrackBasicStats['tableStats'], - titles: ['', 'Started\nstudying', 'Accepted', 'Graduated'], + titles: ['Code', 'Started\nstudying', 'Accepted', 'Graduated'], } if (includeAllSpecials) { studentInfo.titles.push('Transferred out\nof programme', 'Transferred into\nprogramme') } - const programmeNames: Record = {} + const programmeNames: Record = {} let years: Array = [] for (const programme of facultyProgrammes) { @@ -143,7 +142,7 @@ const calculateCombinedStats = async ( graphStats: combinedGraphStats, programmeTableStats: combinedProgrammeTableStats, tableStats: combinedTableStats, - titles: ['', 'All', 'Bachelors', 'Masters', 'Doctors', 'Others'], + titles: ['Code', 'All', 'Bachelors', 'Masters', 'Doctors', 'Others'], }, } } diff --git a/services/backend/src/services/faculty/facultyThesisWriters.ts b/services/backend/src/services/faculty/facultyThesisWriters.ts index a9bb6f7296..6bcd010565 100644 --- a/services/backend/src/services/faculty/facultyThesisWriters.ts +++ b/services/backend/src/services/faculty/facultyThesisWriters.ts @@ -133,7 +133,7 @@ export const combineFacultyThesisWriters = async ( tableStats, graphStats, programmeTableStats, - titles: ['', 'All', 'Bachelors', 'Masters'], + titles: ['Code', 'All', 'Bachelors', 'Masters'], programmeNames, status: 'Done', lastUpdated: '', diff --git a/services/frontend/src/components/common/CreditsProduced.jsx b/services/frontend/src/components/common/CreditsProduced.jsx index 10c9850d49..2cb090c21e 100644 --- a/services/frontend/src/components/common/CreditsProduced.jsx +++ b/services/frontend/src/components/common/CreditsProduced.jsx @@ -67,7 +67,7 @@ export const makeTableStats = (data, showAll, isAcademicYear) => { if (showAll) yearStats.splice(5, 0, Math.round(agreement), Math.round(separate)) tableStats.push(yearStats) } - const titles = ['', 'Total', 'Degree students', 'Exchange students', 'Open university', 'Transferred'] + const titles = ['Code', 'Total', 'Degree students', 'Exchange students', 'Open university', 'Transferred'] if (showAll) titles.splice(5, 0, 'Other university', 'Separate') return { data: tableStats, titles } } diff --git a/services/frontend/src/pages/Faculties/BasicInformationTab/InteractiveDataTable/index.tsx b/services/frontend/src/pages/Faculties/BasicInformationTab/InteractiveDataTable/index.tsx index 8f23e33f82..eba09abe6b 100644 --- a/services/frontend/src/pages/Faculties/BasicInformationTab/InteractiveDataTable/index.tsx +++ b/services/frontend/src/pages/Faculties/BasicInformationTab/InteractiveDataTable/index.tsx @@ -1,4 +1,4 @@ -import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel } from '@mui/material' +import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel } from '@mui/material' import { Fragment, useState } from 'react' import { facultyToolTips } from '@/common/InfoToolTips' @@ -117,15 +117,21 @@ export const InteractiveDataTable = ({ {titles.map((title, index) => ( - - {index === 0 && } - handleSortClick(sorterNames[index], index)} - > - {title} - + + + {index === 0 && ( + + + + )} + handleSortClick(sorterNames[index], index)} + > + {title} + + ))}