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

Rearrange Report Results #8144

Merged
merged 14 commits into from
Sep 26, 2024
Merged

Conversation

jrjohnson
Copy link
Member

@jrjohnson jrjohnson commented Sep 19, 2024

Ripped apart the way we display results in order to move the download button inside the results. This improves the download functionality:

  • to re-use the data that is already loaded
  • to build the data in the same place for display and download
  • to allow reports that are run without saving to be downloaded

Fixes ilios/ilios#5652

Todo from first demo:

  • Move the academic year selection to the left column (download last in mobile)
  • Fix download button size in various places (particularly mobile where it stretches)
  • Singualirze course title in download
  • Reset the year when running another report
  • Ensure the best year is selected when building a report
  • Hide the academic year filter when the year is used to create the report

@jrjohnson
Copy link
Member Author

@dartajax I need to clean up a few things and move them around in the UI, but this should be functionally complete. Would you mind taking a first pass at downloads and report results and see if you can break anything or if anything pops out at you as needing work before this is merged. I'll keep working on my stuff in parallel.

@dartajax dartajax self-assigned this Sep 20, 2024
@dartajax
Copy link
Member

I assigned myself as a tester not to merge - DO NOT MERGE in place.

@dartajax dartajax self-requested a review September 20, 2024 01:06
@dartajax dartajax removed their assignment Sep 20, 2024
@jrjohnson jrjohnson marked this pull request as ready for review September 20, 2024 06:57
@dartajax
Copy link
Member

I feel I have the luxury of testing this for a while since it won't go anywhere for a bit. READY TO MERGE needs to be added especially since I added "DO NOT MERGE` so it's doubled up on not merging. That having been said @jrjohnson could you make the heading when a Course report is downloaded to be "Course" rather than "Courses" - plural not needed as data table header.

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.

When running a new report, "All Academic Years" should be the value in the drop-down of the output, even if the user was tinkering with other years on the previous report generated - my $.02.

image

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.

I hate to be that person but when I run a report for all sessions in academic year, the default selecting comes up 2009. Certainly if we were going to pick a year, 2024 would be better since "All Academic Years" is not available until ... you run the report. Here is what a report based on 2024 looks like on output for reference. First if we need a year make it the current year. If we don't need a year, make "All Available Years" available on the drop-down like it is in the output as will be shown below.

image

image

As one would surmise, there are no 2016 return values in a 2024 dataset.

Moving this into a standalone component as a first step to moving it
inside of each report.
We need more of these, and I don't think it quite fits under the subject
tree.
This is it's own component so it can be put inside the results. This is
a hack job right now, limited test, not hooked up everywhere because
it's going to move around and change.
Ripping this out for use elsewhere.
Pulling this all apart and moving the report header into the results so
that we can have more control over the download within the results
container.
Improved the item placement and style
The final step, now each report downloads data from the results.
These methods don't exist on this service anymore.
Moved a few things around, I put the download button inside of a div so
the grid spacing wouldn't cause the button to fully fill it. This way we
don't have to guess at the button size, it's just normal.
Anytime we run a report we should reset the year so all years are shown
in the results.
@jrjohnson
Copy link
Member Author

Good catch @dartajax, I've hidden that filter when the year is used to build the report and also fixed the academic year report association to select the current year instead of defaulting to the oldest year.

When adding academic year to a report we should pick the current year
instead of the oldest year. As this mirrors the behavior of the course
filters I extracted the selection of current year into a utility.
When the sessions report is using academic year to run we shouldn't
display the filter for the year.
@michaelchadwick
Copy link
Contributor

Probably out of the purview of this PR, but there should be some kind of warning if you're about to run a report that's gonna take a while and/or return a lot of results.

Screenshot 2024-09-25 at 8 30 15 AM
Screenshot 2024-09-25 at 8 30 24 AM

If you change tabs or something and come back while it's doing that, the site can get a bit unresponsive.

@michaelchadwick
Copy link
Contributor

Speaking of which, I did that report I screenshotted, and then went to download it without saving, and it's running the same ~1min-long graphql fetch again. It's cool that I can download it without saving, but I thought there was talk of being able to download something that just ran without that extra fetch.

@jrjohnson
Copy link
Member Author

If it ran the fetch again that's a bug. I'm on it. Thanks!

@michaelchadwick
Copy link
Contributor

michaelchadwick commented Sep 25, 2024

If it ran the fetch again that's a bug. I'm on it. Thanks!

First fetch when running, 1.2 min and finished successfully. Second fetch when downloading, 4 min and timed out.

Screenshot 2024-09-25 at 9 44 50 AM

@jrjohnson
Copy link
Member Author

Actually I forgot about this one. The sessions download has a lot more data than the on screen report. So it's split up into two parts and the fetch has to re-run. All sessions in Medicine is always going to be a huge amount of data. I'd like to leave this as is for now and possibly circle back if we want to slow down the first on-screen report to load more data or accept the current second load network request.

@jrjohnson jrjohnson added run ui tests Run the expensive UI tests and removed DO NOT MERGE labels Sep 25, 2024
@dartajax dartajax merged commit bd7fbd9 into ilios:master Sep 26, 2024
39 of 40 checks passed
@jrjohnson jrjohnson deleted the report-download-in-viewer branch September 26, 2024 19:08
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.

Refactor Report Download
3 participants