Introduce alternative recaptcha script initialization
Introduce alternative reCAPTCHA script initialization
What does this MR do?
Adds a better approach for initializing reCAPTCHA script when used from Vue components, in support of #217722 (closed).
Overview
Simplifies and switches to a memoized approach for attaching the reCAPTCHA script to the document.
Note that this technically not a "refactor", since it is a new approach being added, and the previous approach still exists as part of the old Vue recaptcha modal used from issue create/edit, but this can be deleted when the new approach is finished and issues can be converted to use it.
See Tasks for more details.
See #217722 (closed) for an issue with full context on all planned implementation MRs.
See !50559 (closed) for a spike/Proof of Concept showing a full working implementation of the new reCAPTCHA GraphQL support.
Tasks
-
Add a memoized initRecaptchaScript
function, which attaches the reCAPTCHA script to the document head. -
It should return a Promise which resolves when the reCAPTCHA script has finished initialization.
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related Issues
- Relates: #217722 (closed)
- Relates: !50559 (closed)
Edited by Chad Woolley