Skip to content

Commit

Permalink
Rename config variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Malith-19 committed Dec 10, 2024
1 parent 3f33e36 commit 00a3218
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions features/admin.validation.v1/pages/validation-config-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
state?.config?.ui?.features?.loginAndRegistration?.disabledFeatures);
const isRuleBasedPasswordExpiryDisabled: boolean = disabledFeatures?.includes("ruleBasedPasswordExpiry");
const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state?.config?.ui?.features);
const maxPasswordValue: number = useSelector((state: AppState) =>
const maxPasswordLenghtLimit: number = useSelector((state: AppState) =>
state?.config?.ui?.passwordPolicyConfigs?.maxPasswordAllowedLength);
const maxPasswordValueLength: number = maxPasswordValue.toString().length;
const maxPasswordLenghtLimitLength: number = maxPasswordLenghtLimit.toString().length;

const [ isSubmitting, setSubmitting ] = useState<boolean>(false);
const [ initialFormValues, setInitialFormValues ] = useState<
Expand Down Expand Up @@ -512,10 +512,10 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
description = t(
"validation:validationError.minLimitError"
);
} else if (Number(values.maxLength) > maxPasswordValue) {
} else if (Number(values.maxLength) > maxPasswordLenghtLimit) {
error = true;
description = t(
"validation:validationError.maxLimitError", { maxPasswordValue: maxPasswordValue }
"validation:validationError.maxLimitError", { maxPasswordValue: maxPasswordLenghtLimit }
);
} else if (Number(values.minLength) > Number(values.maxLength)) {
error = true;
Expand Down Expand Up @@ -743,7 +743,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
const max: number = allValues.maxLength
? parseInt(allValues.maxLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -757,7 +757,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.maxLength
? currentValues.maxLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
listen={ (
value: string
Expand All @@ -774,7 +774,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
required
hidden={ false }
placeholder={ "min" }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
minLength={
ValidationConfigConstants
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
Expand Down Expand Up @@ -806,7 +806,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
return t("common:minValidation", { min });
}

const max: number = maxPasswordValue;
const max: number = maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -819,7 +819,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
.PASSWORD_MIN_VALUE
}
max={ maxPasswordValue }
max={ maxPasswordLenghtLimit }
width={ 2 }
required
hidden={ false }
Expand All @@ -835,7 +835,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
);
} }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
labelPosition="top"
minLength={
ValidationConfigConstants
Expand Down Expand Up @@ -1006,7 +1006,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
const max: number = allValues.maxLength
? parseInt(allValues.maxLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1020,13 +1020,13 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.maxLength
? currentValues.maxLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
hidden={ false }
placeholder={ "min" }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
minLength={
ValidationConfigConstants
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
Expand Down Expand Up @@ -1066,7 +1066,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
return t("common:minValidation", { min });
}

const max: number = maxPasswordValue;
const max: number = maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1079,7 +1079,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
.PASSWORD_MIN_VALUE
}
max={ maxPasswordValue }
max={ maxPasswordLenghtLimit }
width={ 2 }
required
hidden={ false }
Expand All @@ -1094,7 +1094,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
);
} }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
labelPosition="top"
minLength={
ValidationConfigConstants
Expand Down Expand Up @@ -1138,7 +1138,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1152,7 +1152,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand All @@ -1168,7 +1168,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
);
} }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
minLength={
ValidationConfigConstants
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
Expand Down Expand Up @@ -1202,7 +1202,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1216,7 +1216,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand All @@ -1232,7 +1232,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
);
} }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
minLength={
ValidationConfigConstants
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
Expand Down Expand Up @@ -1267,7 +1267,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1281,7 +1281,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand All @@ -1297,7 +1297,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
}
);
} }
maxLength={ maxPasswordValueLength }
maxLength={ maxPasswordLenghtLimitLength }
minLength={
ValidationConfigConstants
.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
Expand Down Expand Up @@ -1332,7 +1332,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1346,7 +1346,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand Down Expand Up @@ -1416,7 +1416,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1426,7 +1426,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand Down Expand Up @@ -1505,7 +1505,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa

const max: number = allValues.minLength
? parseInt(allValues.minLength as string)
: maxPasswordValue;
: maxPasswordLenghtLimit;

if (numValue > max) {
return t("common:maxValidation", { max });
Expand All @@ -1515,7 +1515,7 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
max={
currentValues.minLength
? currentValues.minLength
: maxPasswordValue
: maxPasswordLenghtLimit
}
width={ 2 }
required
Expand Down

0 comments on commit 00a3218

Please sign in to comment.