Skip to content

adding the ability to have custom logic for jsonlogic groups #714

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

Merged

Conversation

smplman
Copy link
Contributor

@smplman smplman commented Jun 5, 2024

This PR adds the ability to override jsonLogic groups processing functions. The previous logic would not allow for and, or, !, and !!to be overridden.

@jakeboone02 there is probably a better way to structure this, but wanted to get your thoughts on the current changes.

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for react-querybuilder ready!

Name Link
🔨 Latest commit c64398f
🔍 Latest deploy log https://app.netlify.com/sites/react-querybuilder/deploys/6660f1b6bc35b0000800735f
😎 Deploy Preview https://deploy-preview-714--react-querybuilder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 66 (no change from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 88 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codesandbox-ci bot commented Jun 5, 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 685ecde:

Sandbox Source
React Query Builder CI Template Configuration
React Query Builder Basic Template Configuration
React Query Builder Basic TypeScript Template Configuration
React Query Builder Drag-and-drop Template Configuration
React Query Builder Ant Design Template Configuration
React Query Builder Bootstrap Template Configuration
React Query Builder Bulma Template Configuration
React Query Builder Chakra UI Template Configuration
React Query Builder Fluent UI Template Configuration
React Query Builder Mantine Template Configuration
React Query Builder MUI/Material Template Configuration
React Query Builder Native Template Configuration
React Query Builder Next.js Template Configuration
React Query Builder Tremor Template Configuration

Copy link

codesandbox-ci bot commented Jun 5, 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 a07bc40:

Sandbox Source
React Query Builder CI Template Configuration
React Query Builder Basic Template Configuration
React Query Builder Basic TypeScript Template Configuration
React Query Builder Drag-and-drop Template Configuration
React Query Builder Ant Design Template Configuration
React Query Builder Bootstrap Template Configuration
React Query Builder Bulma Template Configuration
React Query Builder Chakra UI Template Configuration
React Query Builder Fluent UI Template Configuration
React Query Builder Mantine Template Configuration
React Query Builder MUI/Material Template Configuration
React Query Builder Native Template Configuration
React Query Builder Next.js Template Configuration
React Query Builder Tremor Template Configuration

Copy link

codesandbox-ci bot commented Jun 5, 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 239cff8:

Sandbox Source
React Query Builder CI Template Configuration
React Query Builder Basic Template Configuration
React Query Builder Basic TypeScript Template Configuration
React Query Builder Drag-and-drop Template Configuration
React Query Builder Ant Design Template Configuration
React Query Builder Bootstrap Template Configuration
React Query Builder Bulma Template Configuration
React Query Builder Chakra UI Template Configuration
React Query Builder Fluent UI Template Configuration
React Query Builder Mantine Template Configuration
React Query Builder MUI/Material Template Configuration
React Query Builder Native Template Configuration
React Query Builder Next.js Template Configuration
React Query Builder Tremor Template Configuration

@jakeboone02
Copy link
Member

Commit c64398f may look a big change, but I really just consolidated the logic into a single if statement toward the top of the function. I also added some tests where the custom functions return a rule, as well as some that return false (indicating that the JsonLogic rule is invalid). The tests are run in a for loop for brevity, but the ones you added are still there.

Copy link

codesandbox-ci bot commented Jun 5, 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 c64398f:

Sandbox Source
React Query Builder CI Template Configuration
React Query Builder Basic Template Configuration
React Query Builder Basic TypeScript Template Configuration
React Query Builder Drag-and-drop Template Configuration
React Query Builder Ant Design Template Configuration
React Query Builder Bootstrap Template Configuration
React Query Builder Bulma Template Configuration
React Query Builder Chakra UI Template Configuration
React Query Builder Fluent UI Template Configuration
React Query Builder Mantine Template Configuration
React Query Builder MUI/Material Template Configuration
React Query Builder Native Template Configuration
React Query Builder Next.js Template Configuration
React Query Builder Tremor Template Configuration

@jakeboone02
Copy link
Member

I'll merge this unless you wanted to add anything else.

@smplman
Copy link
Contributor Author

smplman commented Jun 6, 2024

I'll merge this unless you wanted to add anything else.

This looks good, thanks for checking.

@jakeboone02 jakeboone02 merged commit 9eb7605 into react-querybuilder:main Jun 6, 2024
10 of 11 checks passed
jakeboone02 added a commit that referenced this pull request Jun 6, 2024
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