From 5139248be148dd7b7292f6ff46b1d522af8a41e1 Mon Sep 17 00:00:00 2001 From: Lorenzo Battigelli Date: Mon, 29 Jul 2024 18:28:35 -0400 Subject: [PATCH 1/2] accept 0 value in isRequired --- aofl-js-packages/form-validate/modules/is-required.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aofl-js-packages/form-validate/modules/is-required.js b/aofl-js-packages/form-validate/modules/is-required.js index 57f07beeb..ab3f1d102 100644 --- a/aofl-js-packages/form-validate/modules/is-required.js +++ b/aofl-js-packages/form-validate/modules/is-required.js @@ -15,7 +15,7 @@ * @return {Boolean} */ function isRequired(value) { - return Boolean(value && String(value) !== ''); + return Boolean((value && String(value) !== '') || (typeof value === 'number' && value === 0)); } export { From 8cfdf3ba3ed0aafdd843529b2d7530e6c0512efa Mon Sep 17 00:00:00 2001 From: Lorenzo Battigelli Date: Mon, 29 Jul 2024 19:25:18 -0400 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d7c0879..5c9ca96ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### [Fixed] ### [Security] +--- +## [v3.14.2](https://github.com/AgeOfLearning/aofl/compare/v3.14.1...v3.14.2) - 2024-07-29 + +### [Added] +### [Changed] + - @aofl/form-validate - allow zero value in isRequired +### [Deprecated] +### [Removed] +### [Fixed] +### [Security] + +--- +## [v3.14.1](https://github.com/AgeOfLearning/aofl/compare/v3.14.0...v3.14.1) - 2022-03-17 + +### [Added] +### [Changed] + - @aofl/unit-testing-plugin - update wdio dependencies +### [Deprecated] +### [Removed] +### [Fixed] +### [Security] + --- ## [v3.14.0](https://github.com/AgeOfLearning/aofl/compare/v3.13.1...v3.14.0) - 2022-03-17