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

Reports->Terms->Program Year title fixed #8170

Merged

Conversation

michaelchadwick
Copy link
Contributor

@michaelchadwick michaelchadwick force-pushed the frontend-4934-prog-year-report-fix branch from 37e9c46 to 15e3522 Compare October 1, 2024 17:54
@michaelchadwick michaelchadwick added the run ui tests Run the expensive UI tests label Oct 1, 2024
@michaelchadwick michaelchadwick force-pushed the frontend-4934-prog-year-report-fix branch from 15e3522 to a9c7d0c Compare October 9, 2024 23:02
@michaelchadwick
Copy link
Contributor Author

michaelchadwick commented Oct 9, 2024

For some reason, the "year" part of the auto-generated report title only loads properly once the report has been accessed once.

To reproduce:

  1. Go to /reports
  2. Create a report like the following:
Screenshot 2024-10-09 at 4 21 37 PM
  1. Save report
  2. There should be a saved report called All Terms for 2018 Doctor of Medicine in Medicine
  3. Reload site
  4. Notice it now says All Terms for Doctor of Medicine in Medicine
  5. Click on report
  6. Click on "Back to Reports" or anywhere else on the site, really
  7. Notice how it says the correct title again

As long as you don't reload/refresh the site, it says the correct report title. Is this not being saved in the database somewhere? If so, then it isn't loading something correctly.

@jrjohnson any ideas?

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.

This needs a test.

@jrjohnson jrjohnson dismissed their stale review October 10, 2024 05:13

Not ready to review yet

@jrjohnson
Copy link
Member

This is a reactivity mess. Basically you just shouldn't use classOfYear and we should probably deprecated and remove it. What is happening is that programYear.classOfYear seems like a property, but it's actually doing some async behind the scenes. When you access it when the program isn't loaded yet it returns an empty string. What usually happens is that the program then loads and whatever getter accessed the value updates. That's a mouthful and hard to type. In this case there isn't a getter so Ember's auto tracking isn't happening, it's being resolved into this object as an empty string. The next time you access it if works because the program is resolved in the classOfYear getter.

I'll add a line comment for a solution here, but let's connect live and talk about this because it's a gotcha that needs discussion and then removal.

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.

And for sure needs some tests to make sure it doesn't recur again.

packages/frontend/app/services/reporting.js Outdated Show resolved Hide resolved
@michaelchadwick michaelchadwick force-pushed the frontend-4934-prog-year-report-fix branch from b0f0e0b to 56f1042 Compare October 14, 2024 23:21
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.

I may be wrong, but I think the extra description is not needed.

packages/frontend/app/services/reporting.js Outdated Show resolved Hide resolved
@dartajax dartajax merged commit 4576853 into ilios:master Oct 17, 2024
36 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.

Busted Report - Terms (in School) by Program Year
3 participants