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

feat(KUI-1135): add fallback without link when SU is course department #278

Merged
2 commits merged into from
Feb 2, 2024

Conversation

ghost
Copy link

@ghost ghost commented Feb 1, 2024

Today we have a broken link when Stockholm university is course department. This PR adds a fallback that only display the course department name as text when SU is course department.

JIRA: KUI-1135

Karl Andin added 2 commits February 1, 2024 08:37
@ghost ghost marked this pull request as ready for review February 1, 2024 11:54
@ghost ghost requested a review from belanglos February 1, 2024 11:55
Copy link
Contributor

@belanglos belanglos left a comment

Choose a reason for hiding this comment

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

This looks super nice! \o/

const { buildCourseDepartmentLink } = require('../courseDepartmentUtils')
const { INFORM_IF_IMPORTANT_INFO_IS_MISSING } = require('../constants')

function htmlStringToElement(html) {
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

expect(result).not.toBeDefined()
})

test.each([undefined, { name: undefined }])('returns fallback text if department is %p', department => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🥇 I had no idea this was possible \o/

return courseDepartment.code === DEPARTMENT_CODE_STOCKHOLM_UNIVERSITY
}

function buildCourseDepartmentLink(courseDepartment, language) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Much more readable!

@ghost ghost merged commit 36d6cf7 into master Feb 2, 2024
3 checks passed
@ghost ghost deleted the issues/KUI-1135 branch February 2, 2024 09:54
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant