Open entrotech opened 7 months ago
@heejung-hong was stuck on how to get the target vs earned points for each project (it's not easy) and submitted a partial solution for me to help with on 10/30/24. I have not been able to work on this yet, but it may require us to to save the calculation result to the database when a project is modified, instead of trying to re-compute all the projects when they appear on this page (this is also a problem on the My Projects Page), to improve performance and simplify issues that need to process sets of calculations based on elements in the results of the calculation.
I did not mean to close this issue, as we still need work on the User Interface for the Submit Snapshot form to make it look like the designed wireframes.
To complete this issue, I modified the Save Project feature in the Calculation Wizard to store the target points, earned points and project level in the project table. This makes these values available wherever they are needed for each project without having to run the engine on each project each time we want to get these values.
However, to populate these new columns for existing projects, I has to create a "temporary" feature that can be run to fetch every existing project, run the calculation engine to calculate these three values and store the result back to the project table. This feature needs to be run only once after the change in paragraph 1 above is run for each environment. This "populate totals" feature is enabled by setting the ENABLE_UPDATE_TOTALS constant in the Constants.js file to a value of true. When this constant is set, a new button labelled "T" is added to the MultiProjectToolbar on the My Projects page. Selecting one or more displayed projects and pressing the button will recalculate target points, earned points and project level for the selected projects. So to recalculate all the projects, you need to set the My Projects filters to their default values, but change the Visibility filter to "All" (i.e. Visible and Hidden) and the Status Filter to "Draft and Snapshot" and set "Show Deleted" on the Status Filter drop-down to include all projects. Then set the items per page to All and select the checkbox in the first column header to select all projects. Then press the "T" button to initiate the calculation. You can open you dev tools and watch the network calls to see progress as each project is recalculated. With this feature enables, an extra column is added to the My Project grid that shows the x/y/z, where x is the target points, y is the earned points, and z is the project level. After the recalculation is complete, you should be able to refresh the page and see that this column confirms the calculated values have been computed.
Once the totals have been populated as above, be sure to disable this feature by re-setting the ENABLE_UPDATE_TOTALS value to false, to hide the "T" button and extra column on the My Projects page. The corresponding code could be deleted at some future time.
This is partially complete, but I'm going to put this back in the Backlog and let someone else take over this issue to finish the UI:
Overview
Users should be able to go to a page where all of their completed forms are available to be selected and submitted to LA City Planning Department for review.
Action Items
[ ] The web api endpoint /api/projects/submit was implemented under Issue #1704.
[ ] Create Snapshot Submittal Form page.
[ ] Create successful submission modal.
Resources/Instructions
Figma Requirements for submission