Skip to content

Commit

Permalink
Merge pull request #296 from KTH/issues/KUI-1009
Browse files Browse the repository at this point in the history
Issues/k UI 1009
  • Loading branch information
vsdkth authored Mar 4, 2024
2 parents 0917e82 + 88c767d commit a77f19d
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 30 deletions.
6 changes: 3 additions & 3 deletions i18n/messages.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ module.exports = {
course_supplemental_information: 'Supplementary information ',
course_examiners: 'Examiner',
course_recruitment_text: 'Abstract',
course_room_canvas: 'Course room in Canvas',
course_room_canvas_info:
'Registered students find further information about the implementation of the course in the course room in Canvas. A link to the course room can be found under the tab Studies in the Personal menu at the start of the course.',
course_application_info: 'Information for research students about course offerings',
course_link: 'Course web',
course_link_text:
'<p>Further information about the course can be found on the Course web at the link below. Information on the Course web will later be moved to this site. </p>',
},
courseRoundInformation: {
header_round: 'About course offering',
Expand Down
6 changes: 3 additions & 3 deletions i18n/messages.se.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ module.exports = {
course_supplemental_information: 'Övrig information',
course_examiners: 'Examinator',
course_recruitment_text: 'Kort beskrivning svenska',
course_room_canvas: 'Kursrum i Canvas',
course_room_canvas_info:
'Registrerade studenter hittar information för genomförande av kursen i kursrummet i Canvas. En länk till kursrummet finns under fliken Studier i Personliga menyn vid kursstart.',
course_application_info: 'Information för forskarstuderande om när kursen ges',
course_link: 'Kurswebb',
course_link_text:
'<p>Ytterligare information om kursen kan hittas på kurswebben via länken nedan. Information på kurswebben kommer framöver flyttas till denna sida. </p>',
},
courseRoundInformation: {
header_round: 'Om kursomgång',
Expand Down
13 changes: 5 additions & 8 deletions public/js/app/components/CourseSectionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ function CourseSectionList(props) {

function getOther() {
const prepare = [
{
header: translation.courseInformation.course_room_canvas,
text: translation.courseInformation.course_room_canvas_info,
},
{
header: translation.courseInformation.course_department,
text: courseInfo.course_department_link ?? courseInfo.course_department,
Expand Down Expand Up @@ -173,14 +177,7 @@ function CourseSectionList(props) {
header: translation.courseInformation.course_supplemental_information_url_text,
text: courseInfo.course_supplemental_information_url_text,
})
if (courseInfo.course_web_link !== LABEL_MISSING_INFO[language]) {
prepare.unshift({
header: translation.courseInformation.course_link,
text: `${translation.courseInformation.course_link_text} <a href='${courseInfo.course_web_link}'> ${translation.courseInformation.course_link} ${courseInfo.course_code}</a>`,
})
} else {
prepare.unshift({ header: translation.courseInformation.course_link, text: courseInfo.course_web_link })
}

if (!isContractEducation() && syllabus.course_additional_regulations !== '')
prepare.push({
header: translation.courseInformation.course_additional_regulations,
Expand Down
1 change: 0 additions & 1 deletion public/js/app/pages/CoursePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ function CoursePage() {
courseInfo={courseInfo}
syllabusList={courseData.syllabusList[activeSyllabusIndex]}
syllabusSemesterList={courseData.syllabusSemesterList}
showCourseLink={context.showCourseWebbLink}
partToShow="courseContentBlock"
syllabusName={
courseData.syllabusSemesterList.length > 0
Expand Down
1 change: 0 additions & 1 deletion public/js/app/pages/__tests__/CoursePage.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions server/controllers/__tests__/courseCtrl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ describe('Discontinued course to test', () => {
"course_supplemental_information": "<p>Övrig info</p>",
"course_supplemental_information_url": "<i>Ingen information tillagd</i>",
"course_supplemental_information_url_text": "<i>Ingen information tillagd</i>",
"course_web_link": "https://www.kth.se/social/course/FCK3305/",
"imageFromAdmin": "own_image",
"sellingText": "<p>Fantastisk kurs</p>",
},
Expand Down Expand Up @@ -264,7 +263,6 @@ describe('Discontinued course to test', () => {
},
"semesterSelectedIndex": 0,
"setBrowserConfig": [Function],
"showCourseWebbLink": true,
"showRoundData": false,
"syllabusInfoFade": false,
"useStartSemesterFromQuery": false,
Expand Down
17 changes: 8 additions & 9 deletions server/controllers/courseCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function _parseCourseDefaultInformation(courseDetails, language) {
course_supplemental_information_url: parseOrSetEmpty(course.supplementaryInfoUrl, language),
course_supplemental_information_url_text: parseOrSetEmpty(course.supplementaryInfoUrlName, language),
course_state: parseOrSetEmpty(course.state, language, true),
course_web_link: parseOrSetEmpty(socialCoursePageUrl, language),
}
}

Expand Down Expand Up @@ -128,11 +127,11 @@ function _parseExamObject(exams, grades, language = 0, semester = '', creditUnit
examString += `<li>${exam.examCode} -
${exam.title},
${language === 'en' ? exam.credits : exam.credits.toString().replace('.', ',')} ${
language === 'en' ? ' credits' : creditUnitAbbr
},
language === 'en' ? ' credits' : creditUnitAbbr
},
${language === 'en' ? 'grading scale' : 'betygsskala'}: ${
grades[exam.gradeScaleCode]
}
grades[exam.gradeScaleCode]
}
</li>`
}
}
Expand Down Expand Up @@ -222,11 +221,11 @@ function _getRoundProgramme(programmes, language = 0) {
const { electiveCondition, progAdmissionTerm, programmeCode, specCode, studyYear, title } = programme
programmeString += `<p>
<a href="${PROGRAMME_URL}/${programmeCode}/${progAdmissionTerm.term}/arskurs${studyYear}${
specCode ? '#inr' + specCode : ''
}">
specCode ? '#inr' + specCode : ''
}">
${title}, ${language === 0 ? 'year' : 'åk'} ${studyYear}, ${specCode ? specCode + ', ' : ''}${
electiveCondition.abbrLabel
}
electiveCondition.abbrLabel
}
</a>
</p>`
})
Expand Down
4 changes: 2 additions & 2 deletions server/controllers/noCourseCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function getIndex(req, res, next) {
const lang = languageUtils.getLanguage(res) || 'sv'
const html =
lang === 'en'
? 'No course code was entered. Try to add a course code to the existing web browser addresss'
: 'Web addressen saknar en kurskod. Försöka med att lägga till en kurskod till addressen.'
? 'No course code was entered. Try to add a course code to the existing web browser address'
: 'Webbaddressen saknar kurskod. Försök att lägga till en kurskod till addressen.'
const title = lang === 'en' ? 'No course code was entered' : 'Ingen kurskod'

res.render('noCourse/index', {
Expand Down
1 change: 0 additions & 1 deletion server/ssr-context/createServerSideContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function createServerSideContext() {
hasStartPeriodFromQuery: false,
sellingText: { en: '', sv: '' },
imageFromAdmin: '',
showCourseWebbLink: true,
memoList: {},
isCancelled: false,
isDeactivated: false,
Expand Down

0 comments on commit a77f19d

Please sign in to comment.