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

Adding client side report generation #146

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

jacob6838
Copy link
Collaborator

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:
image

Downloading:
image

PDF:
image

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

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • My changes require new environment variables:
    • I have updated the docker-compose, K8s YAML, and all dependent deployment configuration files.
  • My changes require updates to the documentation:
    • I have updated the documentation accordingly.
  • My changes require updates and/or additions to the unit tests:
    • I have modified/added tests to cover my changes.
  • All existing tests pass.

Copy link
Collaborator

@payneBrandon payneBrandon left a comment

Choose a reason for hiding this comment

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

A few comments

@jacob6838 jacob6838 requested a review from mcook42 January 28, 2025 18:14
Copy link

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

@jacob6838 jacob6838 requested a review from mcook42 January 30, 2025 15:31
Copy link
Collaborator

@drewjj drewjj left a 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.

Copy link
Collaborator

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

@payneBrandon
Copy link
Collaborator

@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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

leftover from testing?

Copy link
Collaborator Author

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}
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

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",
Copy link
Collaborator

@payneBrandon payneBrandon Mar 5, 2025

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?

Copy link
Collaborator Author

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"

Copy link
Collaborator

@payneBrandon payneBrandon left a comment

Choose a reason for hiding this comment

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

A few questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants