diff --git a/public/js/app/components/CourseSectionList.jsx b/public/js/app/components/CourseSectionList.jsx index 0116dd3e..58e84920 100644 --- a/public/js/app/components/CourseSectionList.jsx +++ b/public/js/app/components/CourseSectionList.jsx @@ -59,9 +59,17 @@ function CourseSectionList({ courseInfo = {}, partToShow, syllabus = {}, syllabu const eligibility = getEligibility() + const recommendedPrerequisitesSection = + courseInfo.course_recommended_prerequisites != '' + ? { + header: translation.courseInformation.course_prerequisites, + text: courseInfo.course_recommended_prerequisites, + } + : {} + const during = [ ...eligibility, - { header: translation.courseInformation.course_prerequisites, text: courseInfo.course_prerequisites }, + recommendedPrerequisitesSection, { header: translation.courseInformation.course_required_equipment, text: courseRequiredEquipment }, { header: translation.courseInformation.course_literature, text: literatureText }, ] diff --git a/server/apiCalls/getFilteredData.js b/server/apiCalls/getFilteredData.js index ddb31eb0..b0c28b72 100644 --- a/server/apiCalls/getFilteredData.js +++ b/server/apiCalls/getFilteredData.js @@ -44,7 +44,6 @@ function _parseCourseDefaultInformation(courseDetails, language) { : INFORM_IF_IMPORTANT_INFO_IS_MISSING_ABOUT_MIN_FIELD_OF_STUDY[language], course_possibility_to_addition: parseOrSetEmpty(course.possibilityToAddition, language), course_possibility_to_completions: parseOrSetEmpty(course.possibilityToCompletion, language), - course_prerequisites: parseOrSetEmpty(course.prerequisites, language), course_recruitment_text: parseOrSetEmpty(course.recruitmentText, language, true), course_required_equipment: parseOrSetEmpty(course.requiredEquipment, language), course_suggested_addon_studies: parseOrSetEmpty(course.addOn, language), @@ -241,13 +240,15 @@ const getFilteredData = async ({ courseCode, language, memoList }) => { //* **** Course information that is static on the course side *****// const courseDefaultInformation = _parseCourseDefaultInformation(courseDetails, language) - const { sellingText, courseDisposition, supplementaryInfo, imageInfo } = await courseApi.getCourseInfo(courseCode) + const { sellingText, courseDisposition, recommendedPrerequisites, supplementaryInfo, imageInfo } = + await courseApi.getCourseInfo(courseCode) const courseInfo = { ...courseDefaultInformation, sellingText: resolveText(sellingText, language), imageFromAdmin: imageInfo, course_disposition: resolveText(courseDisposition, language), + course_recommended_prerequisites: resolveText(recommendedPrerequisites, language), course_supplemental_information: resolveText(supplementaryInfo, language), } diff --git a/server/apiCalls/kursinfoApi.js b/server/apiCalls/kursinfoApi.js index 2de5f603..0e964f74 100644 --- a/server/apiCalls/kursinfoApi.js +++ b/server/apiCalls/kursinfoApi.js @@ -14,6 +14,7 @@ async function _getCourseInfo(courseCode) { imageInfo: '', supplementaryInfo: { sv: '', en: '' }, courseDisposition: { sv: '', en: '' }, + recommendedPrerequisites: { sv: '', en: '' }, } if (res.statusCode === 200 && res.body) { @@ -21,6 +22,7 @@ async function _getCourseInfo(courseCode) { return { sellingText: body.sellingText ?? defaultValues.sellingText, courseDisposition: body.courseDisposition ?? defaultValues.courseDisposition, + recommendedPrerequisites: body.recommendedPrerequisites ?? defaultValues.recommendedPrerequisites, supplementaryInfo: body.supplementaryInfo ?? defaultValues.supplementaryInfo, imageInfo: body.imageInfo ?? defaultValues.imageInfo, } diff --git a/server/controllers/__tests__/courseCtrl.test.js b/server/controllers/__tests__/courseCtrl.test.js index 9a3ea5d7..66ce6126 100644 --- a/server/controllers/__tests__/courseCtrl.test.js +++ b/server/controllers/__tests__/courseCtrl.test.js @@ -139,7 +139,7 @@ describe('Discontinued course to test', () => { "course_main_subject": "Denna kurs tillhör inget huvudområde.", "course_possibility_to_addition": "Ingen information tillagd", "course_possibility_to_completions": "Ingen information tillagd", - "course_prerequisites": "Ingen information tillagd", + "course_recommended_prerequisites": "", "course_recruitment_text": "

Teori och metoder inom glykovetenskap.

", "course_required_equipment": "Ingen information tillagd", "course_state": "ESTABLISHED",