bcgov / workbc-wage-subsidy

WorkBC intake form for Wage Subsidy.
Apache License 2.0
1 stars 1 forks source link

TECH-193: Prefill forms from employer profile, backfill employer profile from first application #111

Closed strdavis closed 11 months ago

strdavis commented 11 months ago

This pull request implements the employer data prefill feature. Changes for this feature are as follows:

This pull request also implements several other minor fixes:

This pull request also attempts to resolve the following issues. Must verify in dev since unable to reproduce precisely locally:

npham49 commented 11 months ago

Preliminary tests on the autofilling, it does work on the application forms (have and need). Couple items to note:

Will continue to test pre-fill based on first form submission.

npham49 commented 11 months ago

Backfill data works, had an account with 1 submission and the employer data was filled correctly.

npham49 commented 11 months ago

Tested the following 2 scenarios:

npham49 commented 11 months ago

Tested the following scenario:

sonarcloud[bot] commented 11 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 10 Code Smells

No Coverage information No Coverage information
2.1% 2.1% Duplication

strdavis commented 11 months ago

Preliminary tests on the autofilling, it does work on the application forms (have and need). Couple items to note:

  • If the user put in a Phone number in the form XXXXXXXXXX instead of XXX-XXX-XXXX, and then save and then start a new form, the field is autofilled as "XXXXXXXXXX " (two white spaces are added). And then when they return to the Admin Client, the 2 white spaces persists in the dialog.
  • Similar issue for the Fax number if it is not in this form +XXXXXXXXXX.
  • If a user inputs a number above 12 digits on Phone or Fax and then click save, the dialog would not react, nothing would happen, but on the API logs, it clearly states "value too long for type character(12)". I feel like there should be an error indicator on the dialog (useNotify might help?).

Will continue to test pre-fill based on first form submission.

Added validation to all fields in Edit Profile dialog, to conform with DB and with forms. Will also need to add validation to all application form fields that get backfilled into employer profile.

strdavis commented 11 months ago

Tested the following 2 scenarios:

  • test_ws: No applications. Account never had any pre-filled fields (except for the autogenerated name and email). Submitted a HaveEmployee and the dialog reflected properly, all the field are correctly filled based on the submitted application.
  • elmsd_ws: Account had 1 application already submitted, employer record already had name, org name and email from previous run. Data did not pre-fill. One thing to note: I removed all fields to empty and saved, and then refreshed, show application, refresh, the profile is still empty, no pre-filling. Is this the intended result?

This is the expected behaviour with the current implementation.

strdavis commented 11 months ago

Tested the following scenario:

  • elmsd_brian: 2 submitted application (1 in Submitted, 1 in Completed), data backfilled according to the first submitted application.

This is a bug, thanks for catching this! It was an error in the logic for detecting the first submission. I've implemented a fix for this.

npham49 commented 11 months ago

Loading does occur in opening and closing for both Employer Dialog and Share Dialog, Loading Indicator spins accordingly.

npham49 commented 11 months ago

Dialog validation works and prevents invalid inputs. Tested with numbers longer than 12 characters for Phone and Fax, form blocks accordingly. CRA number validation is a nice touch.