canonical / canonical.com

Repository for the new version of canonical.com
Other
34 stars 71 forks source link

Сandidate cannot receive a link to the GIA report #1218

Closed sukhodiy closed 7 months ago

sukhodiy commented 8 months ago

Summary

After passing the psychometric assessment, the candidate should receive a link on his page to download the report from the result of this assessment. Instead, when you click the 'Get Report' button in the popup, nothing happens.

Steps to reproduce the behavior

  1. Go to https://canonical.com/careers/application/[id]
  2. Click on 'Request assessment report' button.
  3. Fill in the email field in the popup that opens.
  4. Click on 'Get Report' button.

Expected behavior

The pop-up should close and on the candidate’s page, instead of the 'Request assessment report' button, a link to download a report with assessment results should appear.

Screenshot

image

Browser/device details

More information

After viewing the browser console on this page, the following error was found:

image

A quick analysis indicates that the problem is the reuse of the same names for constants in the get-report.js file. There again the constants form and submitButton are declared. Before this, these same constants were already declared in the forms.js file. Also, most likely there is an issue with the logic of the order of loading modules, since sometimes (rarely) the get-report.js file is loaded first. In this case, the issue described above no longer occurs, but browser gives an error about re-declaring same constants already in the forms.js file.

Hot-fix

Here you can find the fixed get-report.js file with comments, where I just changed the names of the form and submitButton constants to unique ones. This code helps fix the error of re-declaring constants. To run it, just copy the entire code from the file to the browser console on the candidate page, run it and click the 'Get Report' button in the popup again. After this everything should work.

sukhodiy commented 7 months ago

It seems this issue was recently fixed by #1226. I'm closing it.