-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding client side report generation #146
base: develop
Are you sure you want to change the base?
Conversation
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.
A few comments
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.
some initial suggestions while I continue with a full review
webapp/src/features/intersections/reports/graphs/bar-chart-component.tsx
Outdated
Show resolved
Hide resolved
webapp/src/features/intersections/reports/report-color-palette.ts
Outdated
Show resolved
Hide resolved
webapp/src/features/intersections/reports/report-list-table.tsx
Outdated
Show resolved
Hide resolved
webapp/src/features/intersections/reports/graphs/map-minimum-data-graph.tsx
Outdated
Show resolved
Hide resolved
webapp/src/features/intersections/reports/graphs/stop-line-stop-graph.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Matt Cook <mattheworion.cook@gmail.com>
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.
Seems to be the same PR I approved previously. Approving again.
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.
just a couple questions
@jacob6838 Do we have any unit tests for this new functionality? Or a user story in place to add them? It looks like we're pretty lacking in that department. |
@@ -94,17 +99,14 @@ const Page = () => { | |||
|
|||
useEffect( | |||
() => { | |||
console.log(filters) |
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.
leftover from testing?
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.
removed
@@ -177,13 +217,14 @@ const Page = () => { | |||
></Box> | |||
</Box> | |||
<ReportListTable | |||
group={group} | |||
group={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.
question: Should there be a variable we're connecting this property to? If not, do we need to open it as an option?
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 was unused inside the table object - removed!
return currentPage | ||
} | ||
|
||
export const generatePdf = async ( |
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.
suggestion: commenting/documentation on what this method is doing and what various components are setting. As it stands, this would be quite difficult for someone not very familiar with it to make any updates.
@@ -52,6 +52,7 @@ | |||
"keyfile", | |||
"ksession", | |||
"loadercss", | |||
"ldot", |
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.
question(non-blocking): what is ldot?
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.
lane direction of travel. This was used in variables like "ldotReportData"
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.
A few questions
PR Details
Description
Adding Intersection Client Side Report Generation
The changes in this PR were copied directly from #138
This PR adds client-side report generation to the jpo-cvmanager. This feature was originally developed for the conflictvisualizer, and was carried into the jpo-cvmanager to be compatible with changes made to the intersection api.
Data for reports is aggregated in the background, and stored in MongoDB. When a report is pre-viewed, the API provides the data from MongoDB, and the webapp renders the report client side. When the report is download, the webapp uses jspdf to convert the rendered report into a pdf.
Ex:

Client-side Preview:
Downloading:

PDF:

How Has This Been Tested?
These changes were tested by running the webapp alongside the intersection api. To generate a report, go to the intersectionDashboard/reports page, select the intersection '12109', then select "Generate Manual Report", and include at a minimum the day 2024-08-20 (this is when most of the pre-loaded mocked data is from)
Types of changes
Checklist: