-
Notifications
You must be signed in to change notification settings - Fork 1
KUI-2067: map to syllabusValid object (undefined showing in header) #447
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
base: master
Are you sure you want to change the base?
Conversation
belanglos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
I think it would be good to get semesterUtils into this project though, so that we have one unified way of dealing with semesters.
Please have a look at my comments and then we can sync!
belanglos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
We should be able to use semesterutils in more places that we touched though.
And we might be able to put it in a shared folder.
shared/semesterUtils.js
Outdated
| * @returns YearSemesterNumberArray, e.g. [2024, 1] | ||
| */ | ||
| const parseLadokSemester = semester => { | ||
| export const parseLadokSemester = semester => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be enough to use parseSemesterIntoYearSemesterNumber, as it has a fallback. But I actually like that we use the more specific function if we know that we have a ladokSemester.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point actually. Starting to think it might be better to use parseSemesterIntoYearSemesterNumber instead in case it for some reason isn't a Ladok semester.
|
|
||
| describe('parseLadokSemester', () => { | ||
| test('parseLadokSemester', () => { | ||
| expect(parseLadokSemester('HT2024')).toEqual([2024, 2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add at least one more combination?
|
@belanglos Added more of your requested changes. What do you think? |
|
Reminder to self: this needs to be released with the changes in changes in om-kursen-ladok-client |
belanglos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
📌 Summary
Fixes https://kth-se.atlassian.net/browse/KUI-2067
🔍 Changes
✅ Checklist (Author)
🧪 Testing & Verification
(VT2019 - HT2025)
🚧 Out of Scope
📦 Downstream apps