-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for preserving unnecessary groups in jsonlogic export #1077
Option for preserving unnecessary groups in jsonlogic export #1077
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 dc23329:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1077 +/- ##
=======================================
Coverage 82.18% 82.18%
=======================================
Files 211 211
Lines 11096 11097 +1
Branches 1328 1328
=======================================
+ Hits 9119 9120 +1
Misses 1367 1367
Partials 610 610 ☔ View full report in Codecov by Sentry. |
Thanks. |
@@ -24,6 +24,7 @@ export const settings = { | |||
canDeleteLocked: false, | |||
canLeaveEmptyGroup: true, | |||
shouldCreateEmptyGroup: false, | |||
jsonLogicExportPreserveGroups: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename to more generic name like exportPreserveGroups
Same approach could be used for other formats.
packages/core/modules/index.d.ts
Outdated
@@ -1369,6 +1369,7 @@ export interface BehaviourSettings { | |||
maxNumberOfCases?: Number; | |||
showErrorMessage?: boolean; | |||
convertableWidgets?: TypedMap<Array<string>>; | |||
jsonLogicExportPreserveGroups?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add description of new setting in https://github.com/ukrbublik/react-awesome-query-builder/blob/master/CONFIG.adoc#configsettings
Sure thing. I'll do it tomorrow |
Config description also added. I also changed validation logic so that if removeEmptyGroupsOnLoad/removeEmptyGroups is false then no errors are added during validation. Logic being that if exporting empty groups can be proper then importing them should be seen as correct as well. We could also do it so that exportPreserveGroups itself being true would prevent errors during validation but it seemed more logical for removeEmptyGroupsOnLoad to toggle that.
packages/examples/demo/index.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert change to the demo.
Otherwise PR looks 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... Did not mean to commit changes to demo and I thought I didn't, anyways I reverted them now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask for some estimation on when the next release is? I mean I made this suggestions because I want to use it.
Demo is changed to original including config that now uses the default(false) setting for exportPreserveGroups
see issue #1074