Skip to content
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

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

Tupsu-jy
Copy link
Contributor

see issue #1074

Copy link

codesandbox bot commented Jun 28, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Jun 28, 2024

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 Jul 2, 2024 9:47am
react-awesome-query-builder-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 9:47am
react-awesome-query-builder-sandbox-next ✅ Ready (Inspect) Visit Preview Jul 2, 2024 9:47am

Copy link

codesandbox-ci bot commented Jun 28, 2024

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:

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

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.18%. Comparing base (29fcbe2) to head (7c1b8ee).

Current head 7c1b8ee differs from pull request most recent head dc23329

Please upload reports for the commit dc23329 to get more accurate results.

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.
📢 Have feedback on the report? Share it here.

@ukrbublik
Copy link
Owner

Thanks.
Could you please add a test(s)?

@@ -24,6 +24,7 @@ export const settings = {
canDeleteLocked: false,
canLeaveEmptyGroup: true,
shouldCreateEmptyGroup: false,
jsonLogicExportPreserveGroups: false,
Copy link
Owner

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.

@@ -1369,6 +1369,7 @@ export interface BehaviourSettings {
maxNumberOfCases?: Number;
showErrorMessage?: boolean;
convertableWidgets?: TypedMap<Array<string>>;
jsonLogicExportPreserveGroups?: boolean;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tupsu-jy
Copy link
Contributor Author

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.
Copy link
Owner

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 👍🏻

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants