-
Notifications
You must be signed in to change notification settings - Fork 27
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
Curriculum Report #8268
base: master
Are you sure you want to change the base?
Curriculum Report #8268
Conversation
Thanks for catching that @michaelchadwick, I'd forgotten to put that in my todo notes. Got it now! |
eed6004
to
5038802
Compare
dc8e6b6
to
434cc20
Compare
This got quite out of hand, code wise, the individual commits hopefully provide some context. Unfortunately the UI concept changed half way through so some of the early commits are now for components that didn't make the Final Cut. |
@jrjohnson I can't seem to reproduce the bug with selections in the URL despite no selections in the UI, so... |
return rhett; | ||
}); | ||
const csv = PapaParse.unparse(data); | ||
this.finishedBuildingReport = true; |
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.
this component property is not declared, and it appears that its value is not being processed in the template. please remove.
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.
Was actually a mostly implemented feature, I hooked it up. Thanks!
packages/frontend/app/components/reports/curriculum/session-objectives.js
Show resolved
Hide resolved
@service session; | ||
|
||
beforeModel(transition) { | ||
this.session.requireAuthentication(transition, 'login'); |
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.
double-checking - is the removal of the auth check here intentional?
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.
Nope, must have gotten re-generated and I missed this in my review. Great catch!
async model() { | ||
const schools = await this.store.findAll('school'); | ||
const threeYearsAgo = DateTime.now().year - 3; | ||
// Limit query to surounding years |
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.
pedantic jerk alert - this is a typo.
// Limit query to surounding years | |
// Limit query to surrounding years |
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 commit yours because I was already rebased locally. Fixed.
assert.strictEqual(result[0][0].name, 'jayden'); | ||
assert.strictEqual(result[0][1].name, 'jasper'); | ||
assert.strictEqual(result[1][0].name, 'jackson'); |
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.
😍 😍 😍
year: c.year, | ||
sessionTitle: s.title, | ||
firstOfferingDate: firstOfferingDate | ||
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primarlyLocale) |
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.
typo
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primarlyLocale) | |
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primaryLocale) |
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.
✅ fixed.
link: `${origin}${path}`, | ||
instructors: s.instructors, | ||
firstOfferingDate: firstOfferingDate | ||
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primarlyLocale) |
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.
typo
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primarlyLocale) | |
? DateTime.fromISO(firstOfferingDate).toLocaleString(this.intl.primaryLocale) |
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.
✅ fixed.
Switched from expand collapse to the same type of dropdown picker we have in other places in the app. User chooses what type of report they'd like to add and then adds it. Courses report super blank right now.
Pick courses to report on and display them.
Pull all the data from the GraphQL API for all of these selected courses and put a summary on the screen. There are some guesses here. I've selected the first offering of ILM to determine start date, for example. Will have to test the output and see if it's correct.
This component was getting pretty huge, let's split the results out into another container.
I wasn't understanding this report. Instead each session objective gets a line, that's the focus of the output.
Adding data for instructors, first offering, and duration to the report and re-doing the query to be course based to fetch all this additional information efficiently.
Instead of searching for a course all of the schools are listed and you pick each course you want to report on from that list.
Moving the subject reports and the list into a tree so we can differentiate the curriculum reports into their own space. This is first step cleanup to get it working, lost more to add to make it good.
This is the new container, just moving everyone over for now and getting rid of some old stuff.
It's not a lot of data and takes less than a few seconds to load. By having it all upfront we avoid loading spinners in the course chooser and screen jumps in the list of selected courses.
Moving buttons around and putting the results OR the course picker on the screen.
Moving the action buttons out of their containers so they appear into the same space when a report is run, even though they're in different levels of the component tree.
Sort the primary school to the top of the list and fixed the HTML structure to be a correct list and not an invalid bunch of tags.
This isn't part of the language, have to add it ourselves.
Trying out a progress bar loading approach and chunking requests into smaller pieces. Loading the entire year's worth of courses breaks in some unspecified way without breaking it apart, plus we get to know how we're doing loading.
Without this you can get stuck in a very long load without a clear way to escape.
Also realized we should be choosing the current academic year with our utility function, which also makes testing this easier.
I didn't love the ergonomics of this and it only gets worst the more tests you add. I've replaced it with a utility method that builds the data out of what is in the mirage server so data loading looks like it does in other tests.
Without this it looks like a course didn't load.
We're going to need this in other curriculum report tests.
Mostly tests, but found an oddity in the API where we were exposing the selection internals up a layer (probably copy / paste). Cleaned that up.
This belongs under curriculum reports
I'm still not thrilled at all this manual fetch code, but at least it's all in one place now.
We'd need the router mocked and all we'd be testing is that the UI renders.
UL elements can't container other UL elements. They have to be inside the list item. Added the a11y check and this popped up. Fixed.
Needed a label on the select and a visible button control.
Adding some basic component tests
Chunking by zero is never going to happen, but it was running an infinite for loop and we already had the test so I added a fix.
This is just some links in a box, but we need the page object for other tests so I added it.
6815c52
to
93afb0d
Compare
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
93afb0d
to
8236555
Compare
Got rid of the report chooser cruft and pointed the test at the correct page object to run.
These are pretty basic, but add some percy snapshots and a bit of data checking.
When we run a report download the download icon is briefly replaced with a check mark, but that flag wasn't being tracked nor passed to the header.
Not sure when this got removed, but it's needed.
8236555
to
4b43498
Compare
Creating a new type of Curriculum report that covers multiple courses. Each report is a separate component so it can control its own data loading, summary, and download.
WIP: