Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(issues/KUI-1336): delete CoursePresentaion component and a small refactor in CourseMemo file #385

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these users will be requested for
# review when someone opens a pull request.
* @belanglos @karlandindrakryggen @amirhossein-haerian @axelbjo
3 changes: 0 additions & 3 deletions i18n/messages.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ module.exports = {
previousOfferings: 'Previous course offerings',
startdate: 'Start date',
},
coursePresentationLabels: {
coursePresentation: 'Course presentation',
},
breadCrumbs: {
student: 'Student web',
studies: 'Studies',
Expand Down
3 changes: 0 additions & 3 deletions i18n/messages.se.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ module.exports = {
previousOfferings: 'Tidigare kursomgångar',
startdate: 'Startdatum',
},
coursePresentationLabels: {
coursePresentation: 'Presentation av kursen',
},
breadCrumbs: {
student: 'Studentwebben',
studies: 'Studier',
Expand Down
16 changes: 0 additions & 16 deletions public/js/app/components/CoursePresentation.jsx

This file was deleted.

16 changes: 0 additions & 16 deletions public/js/app/components/__tests__/CoursePresentation.test.js

This file was deleted.

9 changes: 1 addition & 8 deletions public/js/app/pages/CourseMemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -127,7 +126,6 @@ function CourseMemo() {
courseFactsLabels,
courseMemoLinksLabels,
extraInfo,
coursePresentationLabels,
courseLinksLabels,
courseContactsLabels,
sectionsLabels,
Expand Down Expand Up @@ -212,13 +210,8 @@ function CourseMemo() {
/>
<Row>
<Col id="flexible-content-of-center" lg="8" className="text-break col-print-12 content-center">
<CoursePresentation
courseImageUrl={courseImageUrl}
introText={webContext.sellingText}
labels={coursePresentationLabels}
/>
<p className="mb-4">
{sectionsLabels.asterisk} {seasonStr(i18n.messages[memoLanguageIndex].extraInfo, validFromTerm)}
{sectionsLabels.asterisk} {seasonStr(extraInfo, validFromTerm)}
</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realised that we got the data for "extraInfo" in previous steps so I decided to make this a little shorter in case of having cleaner code

<AllSections memoData={memo} memoLanguageIndex={memoLanguageIndex} />
<Contacts language={memoLanguage} memoData={memo} labels={courseContactsLabels} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<section
aria-labelledby="course-presentation"
class="d-print-none"
>
<h2
class="visually-hidden"
id="course-presentation"
>
Presentation av kursen
</h2>
<img
alt=""
class="float-sm-start"
id="course-presentation-image"
src="localhost://Picture_by_MainFieldOfStudy_26_Default_picture.jpg"
/>
<article
aria-labelledby="course-presentation"
>
<div />
</article>
</section>
<p
class="mb-4"
>
Expand Down
Loading