From 6f404658d185652d969bc19b211a4ba9b4aa0c02 Mon Sep 17 00:00:00 2001 From: joonas-a Date: Tue, 22 Sep 2026 15:50:46 +0300 Subject: [PATCH] [Class stats] manage visibility button add to all relevant places, tweak warning --- .../FilterDegreeCoursesModal.tsx | 17 ++++++++++++++--- .../PopulationCourses/index.tsx | 4 +++- .../Students/Table/ModulesTab/ModulesTable.tsx | 4 ++++ .../Students/Table/ModulesTab/index.tsx | 4 +++- .../Students/Table/ProgressTab/index.tsx | 4 +++- .../PopulationComponents/Students/index.tsx | 3 ++- .../StudyProgramme/DegreeCoursesTab/InfoBox.tsx | 6 ++++-- 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/services/frontend/src/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal.tsx b/services/frontend/src/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal.tsx index 7cd3cf080..9f764fdc0 100644 --- a/services/frontend/src/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal.tsx +++ b/services/frontend/src/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal.tsx @@ -9,13 +9,24 @@ import { DegreeCoursesTab } from '@/pages/StudyProgramme/DegreeCoursesTab' import { VisibilityIcon } from '@/theme' import { ManageCoursesShownInfo } from '@/pages/StudyProgramme/DegreeCoursesTab/InfoBox' -export const FilterDegreeCoursesModal = ({ degreeProgramme }: { degreeProgramme: string }) => { +const defaultText = 'Manage course visibility' +const defaultIcon = + +export const FilterDegreeCoursesModal = ({ + degreeProgramme, + text, + icon, +}: { + degreeProgramme: string + text?: string + icon?: React.ReactNode +}) => { const [modalOpen, setModalOpen] = useState(false) return ( <> - setModalOpen(false)} open={modalOpen}> Degree programme settings diff --git a/services/frontend/src/components/PopulationComponents/PopulationCourses/index.tsx b/services/frontend/src/components/PopulationComponents/PopulationCourses/index.tsx index 077a2da82..54732e601 100644 --- a/services/frontend/src/components/PopulationComponents/PopulationCourses/index.tsx +++ b/services/frontend/src/components/PopulationComponents/PopulationCourses/index.tsx @@ -38,7 +38,9 @@ export const PopulationCourses = ({ return ( <> - {query.programme && !onlyIamRights ? : null} + {query.programme && !onlyIamRights ? ( + + ) : null} diff --git a/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/ModulesTable.tsx b/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/ModulesTable.tsx index 1964fee16..f7c9198d0 100644 --- a/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/ModulesTable.tsx +++ b/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/ModulesTable.tsx @@ -13,6 +13,7 @@ import { CopyStudentNumbersHeader } from '@/components/OodiTable/common/CopyStud import { OodiTableExcelExport } from '@/components/OodiTable/excelExport' import type { FormattedModules, ModuleTabStudent } from '@/components/PopulationComponents/Students/Table/ModulesTab' import { CheckIcon, CropSquareIcon } from '@/theme' +import { FilterDegreeCoursesModal } from '@/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal' const getModuleIfExists = (student: ModuleTabStudent, moduleCode: string) => student.studyModulesInHOPS.find(studyModule => studyModule.code === moduleCode) ?? null @@ -22,9 +23,11 @@ const ooditableColumnHelper = createColumnHelper() export const ModulesTab = ({ formattedModules, formattedStudents, + programme, }: { formattedModules: FormattedModules formattedStudents: ModuleTabStudent[] + programme: string }) => { const { getTextIn } = useLanguage() const { visible: namesVisible } = useStudentNameVisibility() @@ -189,6 +192,7 @@ export const ModulesTab = ({ toolbarContent={ <> + } diff --git a/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/index.tsx b/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/index.tsx index a90a41d7d..b7cd588aa 100644 --- a/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/index.tsx +++ b/services/frontend/src/components/PopulationComponents/Students/Table/ModulesTab/index.tsx @@ -90,11 +90,13 @@ export const ModulesTabContainer = ({ students, courses, idToGroupIdMap, + programme, }: { curriculum: ExtendedCurriculumDetails | null | undefined students: Student[] courses: FilteredCourse[] idToGroupIdMap: Record + programme: string }) => { const curriculumModules = useMemo( () => (curriculum ? [...curriculum.defaultProgrammeModules, ...curriculum.secondProgrammeModules] : []), @@ -119,5 +121,5 @@ export const ModulesTabContainer = ({ [students, degreeProgrammeCodes, idToGroupIdMap, groupIdToCode] ) - return + return } diff --git a/services/frontend/src/components/PopulationComponents/Students/Table/ProgressTab/index.tsx b/services/frontend/src/components/PopulationComponents/Students/Table/ProgressTab/index.tsx index 6946b44c3..65f32fe1c 100644 --- a/services/frontend/src/components/PopulationComponents/Students/Table/ProgressTab/index.tsx +++ b/services/frontend/src/components/PopulationComponents/Students/Table/ProgressTab/index.tsx @@ -20,7 +20,7 @@ import { DateFormat } from '@/constants/date' import { ExtendedCurriculumDetails } from '@/hooks/useCurriculums' import { useSemesters } from '@/hooks/useSemesters' import { useGetProgressCriteriaQuery } from '@/redux/progressCriteria' -import { CheckIcon, CloseIcon, RemoveIcon, SwapHorizIcon } from '@/theme' +import { CheckIcon, CloseIcon, EditIcon, RemoveIcon, SwapHorizIcon } from '@/theme' import { isMedicalProgramme } from '@/util/studyProgramme' import { formatDate } from '@/util/timeAndDate' import { @@ -34,6 +34,7 @@ import { import { StudentCourse } from '@oodikone/shared/types/studentData' import { keyBy, range } from '@oodikone/shared/util' import '@/components/PopulationComponents/Students/Table/ProgressTab/index.css' +import { FilterDegreeCoursesModal } from '@/components/PopulationComponents/PopulationCourses/FilterDegreeCoursesModal' dayjsExtend(isBetween) dayjsExtend(isSameOrBefore) @@ -614,6 +615,7 @@ export const ProgressTable = ({ toolbarContent={ <> + } /> } diff --git a/services/frontend/src/components/PopulationComponents/Students/index.tsx b/services/frontend/src/components/PopulationComponents/Students/index.tsx index f40cf23bc..4338aaa07 100644 --- a/services/frontend/src/components/PopulationComponents/Students/index.tsx +++ b/services/frontend/src/components/PopulationComponents/Students/index.tsx @@ -104,7 +104,7 @@ export const PopulationStudents = ({ curriculum={curriculum} // TODO: add guard for missing curriculum (it should never be missing) idToGroupIdMap={idToGroupIdMap ?? {}} students={filteredStudents} - programme={programme ?? ''} + programme={programme} /> ), Modules: ( @@ -113,6 +113,7 @@ export const PopulationStudents = ({ curriculum={curriculum} idToGroupIdMap={idToGroupIdMap ?? {}} students={filteredStudents} + programme={programme} /> ), Tags: , diff --git a/services/frontend/src/pages/StudyProgramme/DegreeCoursesTab/InfoBox.tsx b/services/frontend/src/pages/StudyProgramme/DegreeCoursesTab/InfoBox.tsx index 4ba98fac8..626181b61 100644 --- a/services/frontend/src/pages/StudyProgramme/DegreeCoursesTab/InfoBox.tsx +++ b/services/frontend/src/pages/StudyProgramme/DegreeCoursesTab/InfoBox.tsx @@ -3,9 +3,11 @@ import { useLanguage } from '@/components/LanguagePicker/useLanguage' const textContent = { fi: `Nämä asetukset eivät ole henkilökohtaisia. - Esim. kurssin tai moduulin piilottaminen piilottaa sen myös muilta Oodikoneen käyttäjiltä.`, + Esim. kurssin tai moduulin piilottaminen piilottaa sen myös muilta Oodikoneen käyttäjiltä. + Muutetut asetukset astuvat voimaan sivun uudelleenlatauksen jälkeen.`, en: `These settings are non-personal. - Example: hiding a course or a module will also hide it from other Oodikone users.`, + Example: hiding a course or a module will also hide it from other Oodikone users. + Changed settings will require a page reload to take effect.`, } export const ManageCoursesShownInfo = () => {