diff --git a/i18n/messages.en.js b/i18n/messages.en.js index 005a221..79d27e8 100644 --- a/i18n/messages.en.js +++ b/i18n/messages.en.js @@ -147,7 +147,6 @@ module.exports = { teacherAssistantsTitle: 'Teacher Assistants', examinerTitle: 'Examiner', otherContactsTitle: 'Other Contacts', - infoContactName: 'Course Contact', }, extraInfo: { season: { diff --git a/i18n/messages.se.js b/i18n/messages.se.js index bbb35ad..ac5e344 100644 --- a/i18n/messages.se.js +++ b/i18n/messages.se.js @@ -118,7 +118,6 @@ module.exports = { teacherAssistantsTitle: 'Lärarassistenter', examinerTitle: 'Examinator', otherContactsTitle: 'Övriga kontakter', - infoContactName: 'Kontaktperson', }, extraInfo: { season: { diff --git a/public/js/app/components/AboutCourseContacts.jsx b/public/js/app/components/AboutCourseContacts.jsx index 2c8b0ad..e9b69df 100644 --- a/public/js/app/components/AboutCourseContacts.jsx +++ b/public/js/app/components/AboutCourseContacts.jsx @@ -3,22 +3,6 @@ import React from 'react' import { EMPTY } from '../util/constants' import HtmlWrapper from './HtmlWrapper' -// Mandatory information -const InfoContact = ({ languageIndex, infoContactName, labels }) => - infoContactName ? ( - <> -

{labels.infoContactName}

- - - ) : ( - <> -

{labels.infoContactName}

-

- {EMPTY[languageIndex]} -

- - ) - // Mandatory information const ExaminerContacts = ({ languageIndex, examiners, labels }) => examiners ? ( @@ -35,10 +19,9 @@ const ExaminerContacts = ({ languageIndex, examiners, labels }) => ) -const CourseContacts = ({ languageIndex, infoContactName = '', examiners = '', labels = {} }) => ( +const CourseContacts = ({ languageIndex, examiners = '', labels = {} }) => ( <>
-
diff --git a/public/js/app/pages/AboutCourseMemo.jsx b/public/js/app/pages/AboutCourseMemo.jsx index 7b76ed3..bee72d4 100644 --- a/public/js/app/pages/AboutCourseMemo.jsx +++ b/public/js/app/pages/AboutCourseMemo.jsx @@ -367,7 +367,6 @@ function AboutCourseMemo({ mockKursPmDataApi = false, mockMixKoppsApi = false })

{courseContactsLabels.courseContactsTitle}

diff --git a/public/js/app/pages/__tests__/AboutCourseMemoEN.test.js b/public/js/app/pages/__tests__/AboutCourseMemoEN.test.js index d42cff3..760dd11 100644 --- a/public/js/app/pages/__tests__/AboutCourseMemoEN.test.js +++ b/public/js/app/pages/__tests__/AboutCourseMemoEN.test.js @@ -87,7 +87,7 @@ describe('User language: English. Component show all memos: pd const mainContent = screen.getByRole('main') const allH3Headers = within(mainContent).getAllByRole('heading', { level: 3 }) - expect(allH3Headers.length).toBe(5) + expect(allH3Headers.length).toBe(4) const expectedh3ds = [ 'Course offerings starting Autumn 2020', 'Course offerings starting Autumn 2019', @@ -109,7 +109,7 @@ describe('User language: English. Component show all memos: pd test('renders text about empty fields (Course Contact, Examiner) ', () => { const noInfo = getAllByText('No information inserted') - expect(noInfo.length).toBe(2) + expect(noInfo.length).toBe(1) }) test('renders menu link of web-based memo as expected', () => { diff --git a/public/js/app/pages/__tests__/AboutCourseMemoSV.test.js b/public/js/app/pages/__tests__/AboutCourseMemoSV.test.js index 4325c43..b58eeba 100644 --- a/public/js/app/pages/__tests__/AboutCourseMemoSV.test.js +++ b/public/js/app/pages/__tests__/AboutCourseMemoSV.test.js @@ -88,7 +88,7 @@ describe('User language: Swedish. Component show all memos: pd test('renders h3 ', () => { const mainContent = screen.getByRole('main') const allH3Headers = within(mainContent).getAllByRole('heading', { level: 3 }) - expect(allH3Headers.length).toBe(5) + expect(allH3Headers.length).toBe(4) const expectedh3ds = [ 'Kursomgångar som startar HT 2020', 'Kursomgångar som startar HT 2019', @@ -108,11 +108,6 @@ describe('User language: Swedish. Component show all memos: pd expectedh4ds.map((h4, index) => expect(allH4Headers[index]).toHaveTextContent(h4)) }) - test('renders text about empty fields (Kontaktperson) ', () => { - const noInfo = getAllByText('Ingen information tillagd') - expect(noInfo.length).toBe(1) - }) - test('renders menu link of web-based memo as expected', done => { const menuItems = getAllByText('Course memo Autumn 2019-1') expect(menuItems.length).toBe(2) diff --git a/server/controllers/memoCtrl.js b/server/controllers/memoCtrl.js index 49c2072..934b2cc 100644 --- a/server/controllers/memoCtrl.js +++ b/server/controllers/memoCtrl.js @@ -200,23 +200,17 @@ async function getContent(req, res, next) { let fromTerm = semester ?? extractTerm(courseCode, finalMemoEndPoint) - const { - courseMainSubjects, - recruitmentText, - title, - credits, - creditUnitAbbr, - infoContactName, - examiners, - roundInfos, - } = await getDetailedInformation(courseCode, languagesContext.memoLanguage, fromTerm) + const { courseMainSubjects, title, credits, creditUnitAbbr, examiners, roundInfos } = await getDetailedInformation( + courseCode, + languagesContext.memoLanguage, + fromTerm + ) const courseContext = { courseMainSubjects, title, credits, creditUnitAbbr, - infoContactName, examiners, } @@ -330,15 +324,16 @@ async function getOldContent(req, res, next) { memoDatas: [], } - const { courseMainSubjects, recruitmentText, title, credits, creditUnitAbbr, infoContactName, examiners } = - await getDetailedInformation(courseCode, languagesContext.memoLanguage) + const { courseMainSubjects, title, credits, creditUnitAbbr, examiners } = await getDetailedInformation( + courseCode, + languagesContext.memoLanguage + ) const courseContext = { courseMainSubjects, title, credits, creditUnitAbbr, - infoContactName, examiners, } @@ -416,7 +411,7 @@ async function getAboutContent(req, res, next) { const fromTerm = getLastYearsTerm() - const { title, credits, creditUnitAbbr, infoContactName, examiners, roundInfos } = await getDetailedInformation( + const { title, credits, creditUnitAbbr, examiners, roundInfos } = await getDetailedInformation( courseCode, responseLanguage, fromTerm @@ -424,7 +419,6 @@ async function getAboutContent(req, res, next) { webContext.title = title webContext.credits = credits webContext.creditUnitAbbr = creditUnitAbbr - webContext.infoContactName = infoContactName webContext.examiners = examiners webContext.memoDatas = enrichMemoDatasWithOutdatedFlag(rawMemos, roundInfos) diff --git a/server/koppsApi.js b/server/koppsApi.js index c84d999..b502fd4 100644 --- a/server/koppsApi.js +++ b/server/koppsApi.js @@ -67,7 +67,6 @@ async function getDetailedInformation(courseCode, language, fromTerm) { title: course && course.title ? course.title : '', credits: isCreditNotStandard ? course.credits + '.0' : course.credits || '', creditUnitAbbr: course && course.creditUnitAbbr ? course.creditUnitAbbr : '', - infoContactName: course && course.infoContactName ? course.infoContactName : '', examiners: createPersonHtml(examiners), roundInfos: roundInfos || [], } diff --git a/server/ssr-context/createServerSideContext.js b/server/ssr-context/createServerSideContext.js index cf95bea..a286286 100644 --- a/server/ssr-context/createServerSideContext.js +++ b/server/ssr-context/createServerSideContext.js @@ -24,7 +24,6 @@ function createServerSideContext() { title: '', credits: '', creditUnitAbbr: '', - infoContactName: '', semester: '', examiners: '', userLanguageIndex: 1, diff --git a/test/mock-api/responses.js b/test/mock-api/responses.js index faae36f..d331ad3 100644 --- a/test/mock-api/responses.js +++ b/test/mock-api/responses.js @@ -41,7 +41,6 @@ module.exports = { extraHeaders4: '', extraHeaders5: '', equipment: '', - infoContactName: '', literature: '', possibilityToCompletion: '', possibilityToAddition: '',