clients icon indicating copy to clipboard operation
clients copied to clipboard

[BEEEP] [SM-225] Extract captcha into separate component

Open Hinton opened this issue 3 years ago • 1 comments

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Previously we extended a base component for captcha functionality. Inheritance in Angular components is tricky and something that should be avoided in most cases. An alternative pattern is decomposition.

This PR extracts the Captcha functionality into it's own component, and also merges the new captcha component. The parent component communicates with it by setting input and receiving outputs.

This properly encapsulates the captcha logic into it's own class without leaking any concerns.

Code changes

  • apps/web/src/connectors/captcha.ts: Add support for reloading captcha

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

Hinton avatar Sep 12 '22 08:09 Hinton

We could certainly hide the state depending on values. We probably also want a way to re-trigger the captcha right?

Hinton avatar Sep 16 '22 09:09 Hinton