Skip to content

Commit

Permalink
Merge pull request #161 from episerver/user/thng/AFORM-4451-Error-whe…
Browse files Browse the repository at this point in the history
…n-going-to-back-next-step-on-depend-form

AFORM-4451: error when going to back next step on depend form
  • Loading branch information
thachnd authored Oct 29, 2024
2 parents 9b59ff1 + 54736a1 commit 880c3a6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Equals(actualValue: any, dependencyFieldValue: string): boolean {
* @returns
*/
function NotEquals(actualValue: any, dependencyFieldValue: string): boolean {
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
dependencyFieldValue = !dependencyFieldValue ? "" : dependencyFieldValue.toLocaleUpperCase();
return _actualValue !== dependencyFieldValue;
}
Expand All @@ -40,7 +40,7 @@ function NotEquals(actualValue: any, dependencyFieldValue: string): boolean {
* @returns
*/
function Contains(actualValue: any, dependencyFieldValue: string): boolean {
const _actualValue = isNull(actualValue) ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
const _actualValue = isNull(actualValue) ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
dependencyFieldValue = !dependencyFieldValue ? "" : dependencyFieldValue.toLocaleUpperCase();
return _actualValue.indexOf(dependencyFieldValue) >= 0;
}
Expand All @@ -51,7 +51,7 @@ function Contains(actualValue: any, dependencyFieldValue: string): boolean {
* @returns
*/
function NotContains(actualValue: any, dependencyFieldValue: string): boolean {
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
const actualValueNull = isNullOrEmpty(_actualValue)
const dependencyFieldValueNull = isNullOrEmpty(dependencyFieldValue)
return (!actualValueNull && dependencyFieldValueNull) ||
Expand All @@ -66,6 +66,6 @@ function NotContains(actualValue: any, dependencyFieldValue: string): boolean {
*/
function MatchRegularExpression(actualValue: any, patternOfExpected: string): boolean {
var regex = new RegExp(patternOfExpected, "igm");
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",");
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",");
return isNullOrEmpty(patternOfExpected) || (!isNullOrEmpty(patternOfExpected) && regex.test(_actualValue));
}

0 comments on commit 880c3a6

Please sign in to comment.