react-awesome-query-builder icon indicating copy to clipboard operation
react-awesome-query-builder copied to clipboard

Improve validation API

Open ukrbublik opened this issue 1 year ago • 4 comments

Fixes #977, #781, #1005, #374, #1021, #1016, #1033, #1036

Changes:

  • Breaking: Utils.validateTree returns array of errors
  • Utils.validateTree now checks LHS and RHS are completed
  • Deprecated Utils.validateAndFixTree and Utils.checkTree. Use Utils.sanitizeTree().fixedTree instead
  • Fixed validation of date ranges
  • Function validateValue in fieldSettings config can now return object {error, fixedValue}, error can be {key, args} for i18n

Also:

  • Added onInit prop to <Query>. Added 4th argument actions to onInit and onChange
  • Added optimizeRenderWithInternals to settings, default is false
  • Updated type RuleGroupExtProperties

Fixes:

  • Fixed import of select_any_in operator from JsonLogic
  • Fixed issue with antd and date/time pickers
  • Fixed typedef errors

ukrbublik avatar Mar 13 '24 18:03 ukrbublik

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar Mar 13 '24 18:03 codesandbox[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-awesome-query-builder-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 3:40pm
react-awesome-query-builder-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 3:40pm
react-awesome-query-builder-sandbox-next ✅ Ready (Inspect) Visit Preview May 14, 2024 3:40pm

vercel[bot] avatar Mar 13 '24 18:03 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 996d20d7f563c66e49676462d14f2dd1ec060a47:

Sandbox Source
@react-awesome-query-builder/examples Configuration
@react-awesome-query-builder/sandbox Configuration
@react-awesome-query-builder/sandbox-simple Configuration
@react-awesome-query-builder/sandbox-next Configuration

codesandbox-ci[bot] avatar Mar 18 '24 17:03 codesandbox-ci[bot]

Codecov Report

Attention: Patch coverage is 88.45090% with 167 lines in your changes are missing coverage. Please review.

Project coverage is 82.00%. Comparing base (d17da01) to head (996d20d).

Files Patch % Lines
packages/core/modules/utils/validation.js 93.07% 37 Missing :warning:
packages/core/modules/stores/tree.js 87.09% 20 Missing :warning:
packages/core/modules/utils/ruleUtils.js 75.00% 15 Missing :warning:
packages/core/modules/utils/configUtils.js 38.09% 13 Missing :warning:
packages/core/modules/export/queryString.js 83.78% 12 Missing :warning:
packages/core/modules/utils/configExtend.js 92.25% 12 Missing :warning:
packages/ui/modules/components/rule/FuncWidget.jsx 78.12% 4 Missing and 3 partials :warning:
packages/antd/modules/widgets/value/Slider.jsx 61.53% 0 Missing and 5 partials :warning:
packages/core/modules/export/mongoDb.js 84.61% 4 Missing :warning:
packages/core/modules/export/sql.js 84.00% 4 Missing :warning:
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1034      +/-   ##
==========================================
+ Coverage   81.74%   82.00%   +0.26%     
==========================================
  Files         187      211      +24     
  Lines       10059    10577     +518     
  Branches     1249     1318      +69     
==========================================
+ Hits         8223     8674     +451     
- Misses       1217     1291      +74     
+ Partials      619      612       -7     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 18 '24 17:03 codecov[bot]