From 0b00b3d621f91a2731efe7647dbca006b81e5892 Mon Sep 17 00:00:00 2001 From: RamaChandiniDevarapalli Date: Wed, 13 Nov 2024 12:43:57 -0700 Subject: [PATCH] fix: review fix --- .../src/lib/Controls/Inputs/InputTextControl.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/jsonforms-components/src/lib/Controls/Inputs/InputTextControl.tsx b/libs/jsonforms-components/src/lib/Controls/Inputs/InputTextControl.tsx index 1ba947587..1ac9083c7 100644 --- a/libs/jsonforms-components/src/lib/Controls/Inputs/InputTextControl.tsx +++ b/libs/jsonforms-components/src/lib/Controls/Inputs/InputTextControl.tsx @@ -5,6 +5,7 @@ import { WithInputProps } from './type'; import { GoAInputBaseControl } from './InputBaseControl'; import { checkFieldValidity } from '../../util/stringUtils'; import { onBlurForTextControl, onKeyPressForTextControl, onChangeForInputControl } from '../../util/inputControlUtils'; +import { sinTitle } from '../../common/Constants'; export type GoAInputTextProps = CellProps & WithClassname & WithInputProps; @@ -33,7 +34,7 @@ export const GoAInputText = (props: GoAInputTextProps): JSX.Element => { const placeholder = appliedUiSchemaOptions?.placeholder || schema?.description || ''; const errorsFormInput = checkFieldValidity(props as ControlProps); - const isSinField = schema.title === 'Social insurance number'; + const isSinField = schema.title === sinTitle; const autoCapitalize = uischema?.options?.componentProps?.autoCapitalize === true || uischema?.options?.autoCapitalize === true; @@ -58,7 +59,7 @@ export const GoAInputText = (props: GoAInputTextProps): JSX.Element => { // side effect that causes the validation to render when it shouldn't. onChange={(name: string, value: string) => { let formattedValue = value; - if (schema && schema.title === 'Social insurance number' && value !== '') { + if (schema && schema.title === sinTitle && value !== '') { formattedValue = formatSin(value); } onChangeForInputControl({