Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stepper #1101

Merged
merged 108 commits into from
Nov 13, 2024
Merged

Stepper #1101

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
0d8e28b
initial commit
alex-solo Jul 3, 2024
a1082a1
Merge branch 'develop' into stepper
alex-solo Jul 10, 2024
8558356
new files
alex-solo Jul 25, 2024
c1a2022
Merge branch 'develop' into stepper
alex-solo Jul 25, 2024
dc39cae
dont pass children as props
alex-solo Jul 26, 2024
59a6f56
display inputs for different steps
alex-solo Jul 29, 2024
7c64661
form updates
alex-solo Jul 29, 2024
55c6bd9
apos symbol
alex-solo Jul 30, 2024
e19547a
create component factory
alex-solo Jul 30, 2024
9ae5cd2
refresh components on language change
alex-solo Aug 5, 2024
f3a8c28
duration and ageDate added
alex-solo Aug 14, 2024
aedeb6d
removing design system css
alex-solo Aug 14, 2024
0cd8676
port over css styles for tooltip and adjust radio options
alex-solo Aug 15, 2024
d6dee30
fixed tooltip css
alex-solo Aug 15, 2024
0cf0246
style of stepper title
alex-solo Aug 15, 2024
1eb3bd0
styled buttons
alex-solo Aug 16, 2024
6256683
include dynamic metadata for income question currency component
alex-solo Aug 16, 2024
015ead9
switch between lanbguages
alex-solo Aug 16, 2024
d9fcd5c
minor
alex-solo Aug 16, 2024
27dc177
changed to correct language on few components
alex-solo Aug 16, 2024
d64bbbb
make sure language of the income label and hints changes with global …
alex-solo Aug 16, 2024
6a0c1ed
add your and partner information text
alex-solo Aug 19, 2024
5c1179c
added french text
alex-solo Aug 20, 2024
a978cda
removed help from one of the questions
alex-solo Aug 20, 2024
56d5f94
new requirement for partner benefit status question
alex-solo Aug 20, 2024
1030f8c
scroll up every time a step is changed
alex-solo Aug 20, 2024
cce0e78
fix regex so french currency works and moved the dollar sign outside …
alex-solo Aug 21, 2024
2a3bb89
keep the active page state in session so we stay on the right page du…
alex-solo Aug 21, 2024
66696cf
make sure the partner age is valid before showing the benefit status …
alex-solo Aug 21, 2024
4119adb
fix error when ageDate did not update
alex-solo Aug 21, 2024
a1a7f50
update the intro page
alex-solo Aug 22, 2024
9a9aefa
fix sanitization to only affect currency
alex-solo Aug 22, 2024
320c6ce
start of adding error messages
alex-solo Aug 22, 2024
d5c2668
keep track of visible errors in session for each step
alex-solo Aug 23, 2024
f98fa4b
fixed error on itital renderng of oasDeferDuration question
alex-solo Aug 26, 2024
296bda9
fixed error related to Duration component when changing active step
alex-solo Aug 26, 2024
d00d03f
basic error handling
alex-solo Aug 27, 2024
88bbc20
error summary stylings
alex-solo Aug 27, 2024
eb5c2ea
add button attributes to next button so it works with adobe analytics
alex-solo Sep 3, 2024
30c0806
ability to go back to edit questions
alex-solo Sep 3, 2024
978c50c
code cleanup, delete questions page replace with stepper
alex-solo Sep 4, 2024
a3a8b79
comments
alex-solo Sep 4, 2024
9226eb9
delete old accordion form page
alex-solo Sep 4, 2024
466dca3
change benefits.test.ts to reflect lack of legal status question
alex-solo Sep 4, 2024
ab210ce
fix tests
alex-solo Sep 4, 2024
23cbf92
fix tests
alex-solo Sep 4, 2024
9fff147
fix tests
alex-solo Sep 4, 2024
5a783ab
fix tests
alex-solo Sep 4, 2024
827c0eb
fix tests
alex-solo Sep 4, 2024
7727120
fix tests
alex-solo Sep 6, 2024
019cf84
temporary comment out some tests
alex-solo Sep 6, 2024
ec1aba6
empty commit to push
alex-solo Sep 6, 2024
453544e
change schema to set partnerBenefitStatus to none when residency req …
alex-solo Sep 18, 2024
dbd6f09
added new field for partner residence since OAS in the case they alre…
alex-solo Sep 19, 2024
8c450de
validation and error messages on partner residency if they lived in c…
alex-solo Sep 19, 2024
d421dcc
saving progress - accommodate the new field for partner residency
alex-solo Sep 19, 2024
57477ef
delete notion of partner years since oas. Only care about years since 18
alex-solo Sep 23, 2024
461438f
save progress
alex-solo Sep 23, 2024
0384c52
trying to make tests pass
alex-solo Sep 23, 2024
44caa0a
all tests pass
alex-solo Sep 23, 2024
3a27a55
all tests pass
alex-solo Sep 23, 2024
2817222
updated with latest rates to deal with merge conflict
alex-solo Sep 23, 2024
8240387
change order of questions in what you told us section
alex-solo Sep 26, 2024
36f6f57
fix bug related to income field showing zero value
alex-solo Oct 7, 2024
62cfb05
change order in some of the failing tests
alex-solo Oct 7, 2024
4d80f03
fixed wrong error message for partner
alex-solo Oct 7, 2024
5a5feec
empty commit to push
alex-solo Oct 10, 2024
08f0ebd
addressed some comments relating to fonts and headers
alex-solo Oct 16, 2024
c3f820f
fixed button focus on step change
alex-solo Oct 16, 2024
889abe7
fixed font sizes in hint expander as well as added vertical line
alex-solo Oct 17, 2024
094ae33
added french help text to partner residence question
alex-solo Oct 17, 2024
9e8c214
fixed spelling
alex-solo Oct 18, 2024
a2f1c1b
additional help text when client has partner
alex-solo Oct 18, 2024
e1372f9
added aria label to select
alex-solo Oct 21, 2024
8138440
made changes based on ITAO audit
alex-solo Oct 23, 2024
3f14ad7
added contact us to the link label for a11y reader
alex-solo Oct 23, 2024
6e217ed
fixed html semantics, got rid of nested h1
alex-solo Oct 23, 2024
538c6b1
changed html structure of questions. Got rid of fieldset and legend a…
alex-solo Oct 23, 2024
1eeeed1
make the page title dynamic so it reflects the current step
alex-solo Oct 28, 2024
287026f
keep the colour the same on the topnav links even when visited
alex-solo Oct 28, 2024
470ac13
changed out warning alert and changed the messaging
alex-solo Oct 28, 2024
0e26614
select and focus the target
alex-solo Oct 29, 2024
abb6157
added ids as constants to pass as props
alex-solo Oct 29, 2024
f63c1f8
changed id to not overlap
alex-solo Oct 29, 2024
e17368d
empty commit to push
alex-solo Nov 1, 2024
badb7f2
fixed the first page to match the new design system
alex-solo Nov 4, 2024
82a76ab
remove the WIP alert from stepper pages and fix spacing
alex-solo Nov 4, 2024
c544780
fixed spelling
alex-solo Nov 4, 2024
eaa255e
save progress
alex-solo Nov 4, 2024
d4160cf
the options now update correctly when age date changes
alex-solo Nov 5, 2024
1fbf706
fixed the issue of having different button heights
alex-solo Nov 5, 2024
b99b813
fixed colour of tooltip and spacing
alex-solo Nov 5, 2024
bdefb13
scroll to the first error on the page
alex-solo Nov 5, 2024
8394b62
SSA question should not appear if client is already receiving OAS
alex-solo Nov 6, 2024
9edab66
fixed hr adding a default 1px to its border
alex-solo Nov 6, 2024
95240fd
added new input to schema and changed the verification logic
alex-solo Nov 12, 2024
4374084
fix logic to accomodate new field
alex-solo Nov 12, 2024
e16c268
set step to 1 in session storage when clicking on the start link
alex-solo Nov 12, 2024
6cf4a83
add spacing for partner income help
alex-solo Nov 12, 2024
18e0d25
added missing word in french
alex-solo Nov 12, 2024
107d89c
prevent button text wrap
alex-solo Nov 12, 2024
e17431b
fixed the border issue on the eligibility tag component
alex-solo Nov 12, 2024
07cb74a
changed the border width to match the design
alex-solo Nov 12, 2024
66db96f
make tests pass
alex-solo Nov 12, 2024
e0638ca
bring back the consoleDev
alex-solo Nov 12, 2024
be32c4e
fixed button behaviour
alex-solo Nov 13, 2024
891c252
button fits the narrow width screen
alex-solo Nov 13, 2024
641e754
maintain question order on results page when mobile
alex-solo Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions __tests__/pages/api/benefits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,7 @@ describe('consolidated benefit tests: eligible: 60-64', () => {
})

expect(res.body.summary.state).toEqual('MORE_INFO')
expect(res.body.missingFields).toEqual([
'everLivedSocialCountry',
'partnerLegalStatus',
])
expect(res.body.missingFields).toEqual(['everLivedSocialCountry'])
})

it('returns "ALW eligible" - married, living in No Agreement, 10 years in Canada', async () => {
Expand Down Expand Up @@ -988,6 +985,6 @@ describe('consolidated benefit tests: eligible: 60-64', () => {
})

expect(res.status).toEqual(400)
expect(res.body.missingFields).toEqual(['partnerLegalStatus'])
expect(res.body.missingFields).toEqual([])
})
})
32 changes: 17 additions & 15 deletions __tests__/pages/api/field-reqs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ describe('field requirement analysis', () => {
})
expect(res.body.summary.state).toEqual(SummaryState.MORE_INFO)
expect(res.body.missingFields).toEqual([
FieldKey.MARITAL_STATUS,
FieldKey.AGE,
FieldKey.INCOME,
//FieldKey.INCOME_WORK,
FieldKey.LEGAL_STATUS,
// FieldKey.LEGAL_STATUS,
FieldKey.LIVING_COUNTRY,
FieldKey.LIVED_ONLY_IN_CANADA,
FieldKey.MARITAL_STATUS,
])
expect(res.body.visibleFields).toEqual([
FieldKey.MARITAL_STATUS,
FieldKey.AGE,
FieldKey.INCOME,
FieldKey.INCOME_WORK,
FieldKey.LEGAL_STATUS,
// FieldKey.LEGAL_STATUS,
FieldKey.LIVING_COUNTRY,
FieldKey.LIVED_ONLY_IN_CANADA,
FieldKey.MARITAL_STATUS,
])
})

Expand Down Expand Up @@ -83,30 +83,30 @@ describe('field requirement analysis', () => {
partnerYearsInCanadaSince18: 5,
})
// expect(res.body.summary.state).toEqual(SummaryState.AVAILABLE_ELIGIBLE)
expect(res.body.missingFields).toEqual([])
expect(res.body.missingFields).toEqual(['partnerYearsInCanadaSinceOAS'])
expect(res.body.visibleFields).toEqual([
FieldKey.MARITAL_STATUS,
FieldKey.INV_SEPARATED,
FieldKey.AGE,
FieldKey.ALREADY_RECEIVE_OAS,
FieldKey.OAS_AGE,
// FieldKey.INCOME_AVAILABLE,
FieldKey.PARTNER_AGE,
FieldKey.PARTNER_BENEFIT_STATUS,
FieldKey.INCOME,
FieldKey.INCOME_WORK,
FieldKey.LEGAL_STATUS,
FieldKey.PARTNER_INCOME,
FieldKey.PARTNER_INCOME_WORK,
// FieldKey.LEGAL_STATUS,
FieldKey.LIVING_COUNTRY,
FieldKey.LIVED_ONLY_IN_CANADA,
FieldKey.YEARS_IN_CANADA_SINCE_18,
// FieldKey.EVER_LIVED_SOCIAL_COUNTRY, // this field is odd because when visible, no matter what is selected it will return an error
FieldKey.MARITAL_STATUS,
FieldKey.INV_SEPARATED,
FieldKey.PARTNER_AGE,
// FieldKey.PARTNER_INCOME_AVAILABLE,
FieldKey.PARTNER_INCOME,
FieldKey.PARTNER_INCOME_WORK,
// FieldKey.PARTNER_BENEFIT_STATUS,
FieldKey.PARTNER_LEGAL_STATUS,
// FieldKey.PARTNER_LEGAL_STATUS,
FieldKey.PARTNER_LIVING_COUNTRY,
FieldKey.PARTNER_LIVED_ONLY_IN_CANADA,
FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_18,
FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_OAS,
FieldKey.OAS_AGE,
])
})
})
Expand Down Expand Up @@ -196,6 +196,8 @@ describe('field requirements analysis: conditional fields', () => {
FieldKey.INV_SEPARATED,
FieldKey.PARTNER_AGE,
FieldKey.PARTNER_INCOME,
FieldKey.PARTNER_LIVING_COUNTRY,
FieldKey.PARTNER_LIVED_ONLY_IN_CANADA,
])
// expect(res.body.visibleFields).toContain(FieldKey.PARTNER_INCOME_AVAILABLE)
expect(res.body.visibleFields).toContain(FieldKey.PARTNER_AGE)
Expand Down
94 changes: 1 addition & 93 deletions __tests__/pages/api/gisCoupleOnePenBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('gisCoupleOnePenBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
// expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
expectGisEligible(res, 651.45)
expectAlwTooOld(res)
expectAlwsMarital(res)
Expand All @@ -104,50 +104,6 @@ describe('gisCoupleOnePenBenefit', () => {
expectAllIneligible(res, true)
})

/* CALC-51 */
it('should pass 51 test - CALC-51', async () => {
const desiredName = 'CALC-51' // Replace with the desired name
const extractedPayload = getTransformedPayloadByName(filePath, desiredName)

const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 768.46)
expectGisEligible(res, 0.82)
expectAlwTooOld(res)
expectAlwsMarital(res)

//Future Benefit
expectFutureOasGisBenefitEligible(res, 82, 768.46, 0.82, 0)
expectFutureOasGisBenefitEligible(res, 87, 768.46, 0.0, 1)

//partner results
expectAllIneligible(res, true)

//Future Benefit
expectFutureAwlBenefitEligible(res, 60, 0.0, true)
expectFutureOasGisBenefitEligible(res, 65, 698.6, 0.0, 1, true)
})

/* CALC-52 */
it('should pass 52 test - CALC-52', async () => {
const desiredName = 'CALC-52' // Replace with the desired name
const extractedPayload = getTransformedPayloadByName(filePath, desiredName)
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 882.19)
expectGisEligible(res, 0)
expect(res.body.results.gis.eligibility.reason).toEqual(ResultReason.INCOME)
expectAlwTooOld(res)
expectAlwsMarital(res)

//partner results
expectOasNotEligible(res, true)
expectGisNotEligible(res, ResultReason.OAS, true)
expectAlwTooOld(res, true)
})

/* CALC-53 */
it('should pass 53 test - CALC-53', async () => {
const desiredName = 'CALC-53' // Replace with the desired name
Expand Down Expand Up @@ -475,35 +431,6 @@ describe('gisCoupleOnePenBenefit', () => {
expectFutureOasGisBenefitEligible(res, 71, 174.65, 1297.4, 0, true)
})

/* CALC-68 */
it('should pass 68 test - CALC-68', async () => {
const desiredName = 'CALC-68' // Replace with the desired name
const extractedPayload = getTransformedPayloadByName(filePath, desiredName)
const res = await mockGetRequest(extractedPayload)
const deferralTable = [
{ age: 69, amount: 472.39 },
{ age: 70, amount: 498.8 },
]

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 461.39)
expectDeferralTable(res, deferralTable)
expectGisEligible(res, 983.28)
expectAlwTooOld(res)
expectAlwsMarital(res)

//Future Benefit
expectFutureOasGisBenefitEligible(res, 69.58, 461.39, 400.65, 0)
expectFutureOasGisBenefitEligible(res, 74.58, 461.39, 400.65, 1)

//partner results
expectAllIneligible(res, true)

//Future Benefit
expectFutureAwlBenefitEligible(res, 60, 1326.69, true)
expectFutureOasGisBenefitEligible(res, 65, 698.6, 1043.45, 1, true)
})

/* CALC-69 */
it('should pass 69 test - CALC-69', async () => {
const desiredName = 'CALC-69' // Replace with the desired name
Expand All @@ -528,23 +455,4 @@ describe('gisCoupleOnePenBenefit', () => {
expectGisEligible(res, 0.0, true)
expectAlwTooOld(res, true)
})

/* CALC-70 */
it('should pass 70 test - CALC-70', async () => {
const desiredName = 'CALC-70' // Replace with the desired name
const extractedPayload = getTransformedPayloadByName(filePath, desiredName)
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 458.28)
expectGisEligible(res, 0)
expect(res.body.results.gis.eligibility.reason).toEqual(ResultReason.INCOME)
expectAlwTooOld(res)
expectAlwsMarital(res)

//partner results
expectOasNotEligible(res, true)
expectGisNotEligible(res, ResultReason.OAS, true)
expectAlwTooOld(res, true)
})
})
2 changes: 2 additions & 0 deletions __tests__/pages/api/oasBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ it('should pass the second test - OAS-CALC-02', async () => {
expectGisNotEligible(res, ResultReason.OAS, true)
expectAlwTooOld(res, true)
})

/* CALC-06 */
it('should pass the 06 test - OAS-CALC-06', async () => {
const desiredName = 'CALC-6' // Replace with the desired name
Expand Down Expand Up @@ -245,6 +246,7 @@ it('should pass the second test - OAS-CALC-02', async () => {
expectGisNotEligible(res, ResultReason.OAS, true)
expectAlwTooOld(res, true)
})

/* CALC-15 */
it('should pass the 15 test - OAS-CALC-15', async () => {
const desiredName = 'CALC-15' // Replace with the desired name
Expand Down
Binary file modified __tests__/utils/ScenariosWith2023Q3RatesAndThresholds.xlsx
Binary file not shown.
22 changes: 20 additions & 2 deletions __tests__/utils/excelReaderUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export function getTransformedPayloadByName(
const data = readExcelData(filePath)
const rowToTransform = data.find((row) => row['Scenario'] === testName) // Assuming "testName" column is represented by "Column1"

//console.log('Extracted rowToTransform:', rowToTransform)

if (rowToTransform) {
const transformedPayload = createTransformedPayload(rowToTransform)
return transformedPayload
Expand Down Expand Up @@ -152,6 +150,24 @@ function createTransformedPayload(rowToTransform: string): Record<string, any> {
],
rowToTransform['Partner Birth Year and Month']
),
partnerYearsInCanadaSinceOAS:
transformLiveOnlyCanadaValue(
rowToTransform[
'Partner: # of years resided in Canada after age 18 (Full, 40, 10, etc.)'
]
) !== 'true'
? transformValue(
rowToTransform["Partner Rec'ing OAS (Yes / No / IDK)"]
) === 'true'
? transformYearsInCanadaSinceOAS18Value(
rowToTransform['Partner Age'],
rowToTransform[
'Partner: # of years resided in Canada after age 18 (Full, 40, 10, etc.)'
],
rowToTransform['Partner Birth Year and Month']
)
: undefined
: undefined,
}
payload = Object.fromEntries(
Object.entries(payload).filter(
Expand Down Expand Up @@ -244,6 +260,8 @@ function transformPartnerBenefitStatusValue(value: string): String {
return PartnerBenefitStatus.HELP_ME
} else if (value.toUpperCase() === 'NO') {
return PartnerBenefitStatus.NONE
} else if (value.toUpperCase() === 'N/A') {
return PartnerBenefitStatus.HELP_ME
}
return undefined
}
Expand Down
4 changes: 2 additions & 2 deletions __tests__/utils/expectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ export const partnerUndefined = {
}

export const partnerNoHelpNeeded = {
partnerLivingCountry: undefined,
partnerLivingCountry: 'CAN',
alex-solo marked this conversation as resolved.
Show resolved Hide resolved
partnerLegalStatus: undefined,
partnerLivedOnlyInCanada: undefined,
partnerLivedOnlyInCanada: true,
partnerYearsInCanadaSince18: undefined,
}

Expand Down
1 change: 1 addition & 0 deletions client-state/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FieldsHandler } from '../utils/api/fieldsHandler'
import { Language, ValidationErrors } from '../utils/api/definitions/enums'
import {
FieldConfig,
fieldDefinitions,
FieldKey,
FieldType,
} from '../utils/api/definitions/fields'
Expand Down
32 changes: 30 additions & 2 deletions client-state/FormField.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { FieldConfig, FieldKey } from '../utils/api/definitions/fields'
import { getBirthMonthAndYear } from '../components/StepperPage/utils'
import {
FieldConfig,
FieldKey,
FieldType,
} from '../utils/api/definitions/fields'
import { VisibleFieldsObject } from '../utils/web/types'
import { InputHelper } from './InputHelper'

Expand All @@ -15,10 +20,27 @@ export class FormField {
return this.inputHelper.getInputByKey(this.config.key)
}

get inputs(): any {
return this.inputHelper.inputs
}

set value(value: string) {
this.inputHelper.setInputByKey(this.config.key, value)
this.inputHelper.setInputByKey(this, value)
}

// get metaData(): { [key: string]: any } {
// const metaData: { [key: string]: any } = {}
// if (this.config.type === FieldType.DURATION) {
// // const age = this.inputHelper.inputs.age
// // metaData.age = age
// // ? getBirthMonthAndYear(age)
// // : { month: 1, year: undefined }
// return { age: { month: 1, year: 1953 } }
// }

// return metaData
// }

get visible(): boolean {
return this.visibleFieldsObject[this.config.key]
}
Expand All @@ -27,6 +49,12 @@ export class FormField {
this.visibleFieldsObject[this.config.key] = value
}

// set metaData(value: { [key: string]: any }) {}

// get metaData(): { [key: string]: any } {
// return { ageDate: { month: 1, year: 1953 } }
// }

get valid(): boolean {
return !this.error && this.value !== undefined
}
Expand Down
22 changes: 16 additions & 6 deletions client-state/InputHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Language } from '../utils/api/definitions/enums'
import { fieldDefinitions, FieldKey } from '../utils/api/definitions/fields'
import {
fieldDefinitions,
FieldKey,
FieldType,
} from '../utils/api/definitions/fields'
import { sanitizeCurrency } from '../components/Forms/validation/utils'
import { FormField } from './FormField'

interface LanguageInput {
key: '_language'
Expand All @@ -24,7 +29,7 @@ export type ErrorsVisibleObject = {

export class InputHelper {
constructor(
private readonly inputs: FieldInputsObject,
readonly inputs: FieldInputsObject,
private readonly setInputs: (value: FieldInputsObject) => void,
private readonly language: Language
) {
Expand All @@ -35,10 +40,15 @@ export class InputHelper {
return this.asObject[key]
}

setInputByKey(key: FieldKey, newValue: string): void {
if (newValue === '' || newValue === undefined) delete this.inputs[key]
else this.inputs[key] = InputHelper.sanitizeValue(newValue, this.language)
this.setInputs(this.inputs)
setInputByKey(field: FormField, newValue: string): void {
if (newValue === '' || newValue === undefined) delete this.inputs[field.key]
else {
this.inputs[field.key] =
field.config.type === FieldType.CURRENCY
? InputHelper.sanitizeValue(newValue, this.language)
: newValue
this.setInputs(this.inputs)
}
}

/**
Expand Down
Loading
Loading