Skip to content

Conversation

@stopfstedt
Copy link
Member

this allows us to separate derived values, such as calendarStartYear and calendarEndYear, from raw data points, such as startDate and endDate, using cached getters.

the sets us up for a cleaner representation going forward.

refs #8956

@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for ilios-frontend ready!

Name Link
🔨 Latest commit da81604
🔍 Latest deploy log https://app.netlify.com/projects/ilios-frontend/deploys/691e4b5061f57600079265b6
😎 Deploy Preview https://deploy-preview-8963--ilios-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for ilios-frontend ready!

Name Link
🔨 Latest commit 4865e3e
🔍 Latest deploy log https://app.netlify.com/projects/ilios-frontend/deploys/692092cf70335400084ee577
😎 Deploy Preview https://deploy-preview-8963--ilios-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stopfstedt stopfstedt force-pushed the event-class-v2 branch 7 times, most recently from 66bf647 to 1cd0607 Compare November 21, 2025 01:25
@stopfstedt stopfstedt marked this pull request as ready for review November 21, 2025 01:25
* @param { Number|undefined } ilmSessionId The event's ILM session ID
* @return { String }
*/
function getSlugForUserEvent(startDate, offeringId, ilmSessionId) {
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

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(
Copy link
Member

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!

Copy link
Member Author

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.
the Event class does a data transformation on its input in the constructor,
this covers the transformed attributes.
@stopfstedt stopfstedt requested a review from jrjohnson November 21, 2025 16:27
Copy link
Member

@jrjohnson jrjohnson left a comment

Choose a reason for hiding this comment

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

💟

@jrjohnson jrjohnson removed the request for review from michaelchadwick November 21, 2025 17:26
@jrjohnson jrjohnson added the run ui tests Run the expensive UI tests label Nov 21, 2025
@stopfstedt
Copy link
Member Author

@dartajax no functional or visual changes are to be expected here.

for click-testing, please have a look at all the calendars

  • dashboard user/school calendar
  • learner group calendar
  • user profile calendar
  • offering calendar

thanks!

Copy link
Member

@dartajax dartajax left a 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

@dartajax dartajax merged commit 2fa3764 into ilios:master Nov 21, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run ui tests Run the expensive UI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants