-
Notifications
You must be signed in to change notification settings - Fork 27
Use dedicated class for representing Events #8963
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
Conversation
da81604 to
c6b692f
Compare
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
66bf647 to
1cd0607
Compare
1cd0607 to
2dc378e
Compare
| * @param { Number|undefined } ilmSessionId The event's ILM session ID | ||
| * @return { String } | ||
| */ | ||
| function getSlugForUserEvent(startDate, offeringId, ilmSessionId) { |
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.
I'm not sure why these live outside of the Event class and aren't just instance methods or getters.
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.
@jrjohnson i was waffling on this too. i could make these private methods, if that sits better with you. i wouldn't mind, as long as they don't become part of the public interface of this class.
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.
i'm gonna make these private methods. sit tight.
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.
handled ✔️
|
|
||
| module('Unit | Classes | Event', function (hooks) { | ||
| setupTest(hooks); | ||
| test.each( |
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.
Didn't know about this!
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's great, innit?
…put processing in constructor. all the data wrangling happens directly in the constructor now. this eliminates the need to a factory in the user/school events service. furthermore, Event.slug is now be cached getter as it should be - this required some re-shuffling of utility methods. this required a decent amount of rewiring in integration test coverage where we have to now use actual Event objects as component input instead of mock object that were hand-rolled or provided by mirage.
this is more straightforward.
2dc378e to
10e7595
Compare
the Event class does a data transformation on its input in the constructor, this covers the transformed attributes.
jrjohnson
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.
💟
|
@dartajax no functional or visual changes are to be expected here. for click-testing, please have a look at all the calendars
thanks! |
dartajax
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.
all calendars checked - looks good to me
this allows us to separate derived values, such as
calendarStartYearandcalendarEndYear, from raw data points, such asstartDateandendDate, using cached getters.the sets us up for a cleaner representation going forward.
refs #8956