From 425ec36ad4b94d640cee1aa3429306cb67e79284 Mon Sep 17 00:00:00 2001 From: amirhossein-haerian Date: Fri, 31 May 2024 17:29:27 +0200 Subject: [PATCH] refactor(issues/KUI-1336): delete CoursePresentaion component and an small refactor in CourseMemo file --- i18n/messages.en.js | 3 --- i18n/messages.se.js | 3 --- .../js/app/components/CoursePresentation.jsx | 16 -------------- .../__tests__/CoursePresentation.test.js | 16 -------------- public/js/app/pages/CourseMemo.jsx | 9 +------- .../__snapshots__/CourseMemo.test.js.snap | 22 ------------------- 6 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 public/js/app/components/CoursePresentation.jsx delete mode 100644 public/js/app/components/__tests__/CoursePresentation.test.js diff --git a/i18n/messages.en.js b/i18n/messages.en.js index 050f2188..4f4168c3 100644 --- a/i18n/messages.en.js +++ b/i18n/messages.en.js @@ -269,9 +269,6 @@ module.exports = { previousOfferings: 'Previous course offerings', startdate: 'Start date', }, - coursePresentationLabels: { - coursePresentation: 'Course presentation', - }, breadCrumbs: { student: 'Student web', studies: 'Studies', diff --git a/i18n/messages.se.js b/i18n/messages.se.js index e84fe87d..387b87a6 100644 --- a/i18n/messages.se.js +++ b/i18n/messages.se.js @@ -239,9 +239,6 @@ module.exports = { previousOfferings: 'Tidigare kursomgångar', startdate: 'Startdatum', }, - coursePresentationLabels: { - coursePresentation: 'Presentation av kursen', - }, breadCrumbs: { student: 'Studentwebben', studies: 'Studier', diff --git a/public/js/app/components/CoursePresentation.jsx b/public/js/app/components/CoursePresentation.jsx deleted file mode 100644 index 1ef5ae1b..00000000 --- a/public/js/app/components/CoursePresentation.jsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import HtmlWrapper from './HtmlWrapper' - -const CoursePresentation = ({ courseImageUrl = '', introText = '', labels }) => ( -
-

- {labels.coursePresentation} -

- -
- -
-
-) - -export default CoursePresentation diff --git a/public/js/app/components/__tests__/CoursePresentation.test.js b/public/js/app/components/__tests__/CoursePresentation.test.js deleted file mode 100644 index 231c5df6..00000000 --- a/public/js/app/components/__tests__/CoursePresentation.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' - -import CoursePresentation from '../CoursePresentation' - -import i18n from '../../../../../i18n' - -const { coursePresentationLabels } = i18n.messages[0] - -describe('Component ', () => { - test('renders a links aside', done => { - render() - done() - }) -}) diff --git a/public/js/app/pages/CourseMemo.jsx b/public/js/app/pages/CourseMemo.jsx index 0acff1d7..d3877c4a 100644 --- a/public/js/app/pages/CourseMemo.jsx +++ b/public/js/app/pages/CourseMemo.jsx @@ -11,7 +11,6 @@ import { menuItemsForCurrentMemo } from '../util/menu-memo-items' import { useWebContext } from '../context/WebContext' -import CoursePresentation from '../components/CoursePresentation' import SideMenu from '../components/SideMenu' import CourseHeader from '../components/CourseHeader' import CourseContacts from '../components/CourseContacts' @@ -127,7 +126,6 @@ function CourseMemo() { courseFactsLabels, courseMemoLinksLabels, extraInfo, - coursePresentationLabels, courseLinksLabels, courseContactsLabels, sectionsLabels, @@ -212,13 +210,8 @@ function CourseMemo() { /> -

- {sectionsLabels.asterisk} {seasonStr(i18n.messages[memoLanguageIndex].extraInfo, validFromTerm)} + {sectionsLabels.asterisk} {seasonStr(extraInfo, validFromTerm)}

diff --git a/public/js/app/pages/__tests__/__snapshots__/CourseMemo.test.js.snap b/public/js/app/pages/__tests__/__snapshots__/CourseMemo.test.js.snap index 73708684..4be24888 100644 --- a/public/js/app/pages/__tests__/__snapshots__/CourseMemo.test.js.snap +++ b/public/js/app/pages/__tests__/__snapshots__/CourseMemo.test.js.snap @@ -311,28 +311,6 @@ exports[`Page CourseMemo renders a side menu and a page structure 1`] = ` class="text-break col-print-12 content-center col-lg-8" id="flexible-content-of-center" > -
-

- Presentation av kursen -

- -
-
-
-