gc-proto / wayfinding-orientation

TBS prototypes for Covid-19
http://test.canada.ca/covid-19-guidance/hc-links-en.html
5 stars 17 forks source link

Calculator to update retroactive changes #84

Closed lbelmore-gc closed 3 years ago

lbelmore-gc commented 4 years ago

Calculator doesn't update with retroactive changes

If an amount is changed in the monthly revenue section, the summary of revenue drop will update when you tab out of the field. But to have the employee amounts update, you must click into the pre-crisis pay amount to have the employee update. This must be done with each individual employee listed.

Solution - update the button to "Calculate data and send to the form below"

Christopher-O commented 4 years ago

@lbelmore-gc this has already been updated with slightly different text. I assume this can be closed?

Michel-Tremblay commented 4 years ago

I believe the only change that was required for the script is to have the employee amounts in the accordion summary update when the button is clicked the send data down - which has been completed.

Christopher-O commented 4 years ago

@Michel-Tremblay yes thanks for clarifying. I believe this resolves the issue.

lbelmore-gc commented 4 years ago

Just reopening this one until it goes live. Adding it to the Ready for approval list (in project view) so we can get it on AEM and then live

lbelmore-gc commented 3 years ago

@Christopher-O @Michel-Tremblay - can you summarize the change made to the logic for the button? I was trying to compare the live site with test and want to make sure I understand the difference with the button functionality.

Christopher-O commented 3 years ago

@lbelmore-gc I believe all it does is recalculate the values in the calculator for step 2a before reinputing the values into the next steps. Before all it did was just put the values into the next steps but did not re-calculate if an amount was changed above. @Michel-Tremblay I cannot recall if the function does anything more compared to it's current iteration.

Michel-Tremblay commented 3 years ago

I believe all it does is recalculate the values in the calculator for step 2a before reinputing the values into the next steps

This is correct. When the button is clicked to send data down, the blur (when element loses focus) event is triggered for each weekly wage input, so it's as if the user tabs through each week to update the calculations. Then those updated results are sent down.

tanyafowler commented 3 years ago

@Michel-Tremblay can you outline the code changes for the recalculate functionality and send it to me so I can include it in the PubHub ticket? Mathieu will be working on the ticket. Thanks :)

Michel-Tremblay commented 3 years ago

if we're publishing #83 and #86 along with this, could we just copy all the javascript rather than doing this one bit at a time?

tanyafowler commented 3 years ago

@Michel-Tremblay - Yes - so if I tell Mathieu to just copy all JS he won't pick up anything that isn't meant for this release? I wasn't sure what might be on the test page that isn't finalized or approved.

Michel-Tremblay commented 3 years ago

Correct. These three changes plus the validation change that was all that I had worked on. I think it's safe to copy all the JS.

tanyafowler commented 3 years ago

Great, thanks Michel.

tanyafowler commented 3 years ago

Mathieu has reminded me that there were some JS changes made for the French version in AEM. He's asking if he can copy and paste the JS from GitHub to the French version of the page. I assume no, that would overwrite the customization we need for French?

Michel-Tremblay commented 3 years ago

I double checked, all my code is written to support both languages. If Matthieu could point out the part that's specific, I would actually want to rewrite it so we never have to worry about this kind of difference again.