-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11154 from 18F/stages/rc-2024-08-27-patch-1
* Revert "Merge pull request #11152 from 18F/stages/rc-2024-08-27-revert" This reverts commit 90d418c, reversing changes made to a951867. * Allow for extra arguments to `idv_doc_auth_verify_polling_wait_visited` event (#11153) The `idv_doc_auth_verify_polling_wait_visited` gets logged when a polling event occurs on the verify info step. This event does not have any extra attributes that it needs to log. As a result we left off the extra arguments when adding it. Leaving off the extra arguments led to an issue with the `AnalyticsEventsEnhancer`. This adds attributes to the events that are prefixed with `idv_` when they are called. A result of this was a `ArgumentError` for this event since it did not have the extra arguments for these attributes. [skip changelog]
- Loading branch information
Showing
42 changed files
with
605 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,42 @@ | ||
import Cleave from 'cleave.js'; | ||
|
||
function formatSSNFieldAndLimitLength() { | ||
const inputs = document.querySelectorAll<HTMLInputElement>('input.ssn-toggle[type="password"]'); | ||
|
||
if (inputs) { | ||
inputs.forEach((input) => { | ||
const toggle = document.querySelector<HTMLInputElement>(`[aria-controls="${input.id}"]`)!; | ||
|
||
let cleave: Cleave | undefined; | ||
|
||
function sync() { | ||
const { value } = input; | ||
cleave?.destroy(); | ||
if (toggle.checked) { | ||
cleave = new Cleave(input, { | ||
numericOnly: true, | ||
blocks: [3, 2, 4], | ||
delimiter: '-', | ||
}); | ||
} else { | ||
const nextValue = value.replace(/-/g, ''); | ||
if (nextValue !== value) { | ||
input.value = nextValue; | ||
} | ||
} | ||
const didFormat = input.value !== value; | ||
if (didFormat) { | ||
input.checkValidity(); | ||
} | ||
const inputs = document.querySelectorAll<HTMLInputElement>('input.ssn-toggle[type="password"]'); | ||
inputs.forEach((input) => { | ||
const toggle = document.querySelector<HTMLInputElement>(`[aria-controls="${input.id}"]`)!; | ||
|
||
let cleave: Cleave | undefined; | ||
|
||
function sync() { | ||
const { value } = input; | ||
cleave?.destroy(); | ||
if (toggle.checked) { | ||
cleave = new Cleave(input, { | ||
numericOnly: true, | ||
blocks: [3, 2, 4], | ||
delimiter: '-', | ||
}); | ||
} else { | ||
const nextValue = value.replace(/-/g, ''); | ||
if (nextValue !== value) { | ||
input.value = nextValue; | ||
} | ||
} | ||
const didFormat = input.value !== value; | ||
if (didFormat) { | ||
input.checkValidity(); | ||
} | ||
} | ||
|
||
sync(); | ||
toggle.addEventListener('change', sync); | ||
|
||
function limitLength(this: HTMLInputElement) { | ||
const maxLength = 9 + (this.value.match(/-/g) || []).length; | ||
if (this.value.length > maxLength) { | ||
this.value = this.value.slice(0, maxLength); | ||
this.checkValidity(); | ||
} | ||
} | ||
sync(); | ||
toggle.addEventListener('change', sync); | ||
|
||
input.addEventListener('input', limitLength.bind(input)); | ||
}); | ||
function limitLength(this: HTMLInputElement) { | ||
const maxLength = 9 + (this.value.match(/-/g) || []).length; | ||
if (this.value.length > maxLength) { | ||
this.value = this.value.slice(0, maxLength); | ||
this.checkValidity(); | ||
} | ||
} | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', formatSSNFieldAndLimitLength); | ||
input.addEventListener('input', limitLength.bind(input)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.