hackforla / tdm-calculator

DTLA Hack for LA is partnering with Los Angeles Department of Transportation (LADOT) to develop a Traffic Demand Management (TDM) calculator tool. This tool will help planners at LADOT and real estate developers to meet the Los Angeles’s Mobility Plan goals by 2035.
https://tdm.ladot.lacity.org
GNU General Public License v2.0
49 stars 33 forks source link

Create a Submit Snapshot Form and Main Menu Item to select it. #1655

Open entrotech opened 7 months ago

entrotech commented 7 months ago

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

Resources/Instructions

Figma Requirements for submission

entrotech commented 1 week 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.

entrotech commented 2 days ago

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.

entrotech commented 2 days ago
  1. 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.

  2. 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.

  3. 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.

entrotech commented 2 days ago

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:

  1. Make the page layout look like the wireframe in the description. It should be responsive to changes in device width, and design elements should conform to the style guide.
  2. The wireframe in the description of this issue is a "Ready for Submission" warning dialog, but the one in the design Issue #1407 is just a "Thank You for Your Submission" after completing the submission - which one is right, and are they compliant with the style guide? What's implemented in this issue: Image