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

[JSON Logic] Part 1: JSON Logic Skeleton #35

Merged
merged 16 commits into from
Aug 31, 2023
Merged

[JSON Logic] Part 1: JSON Logic Skeleton #35

merged 16 commits into from
Aug 31, 2023

Conversation

brennj
Copy link
Collaborator

@brennj brennj commented Aug 16, 2023

This is a breakdown of #28 to make it more digestible for review.

There will be multiple PRs:

  • Adding JSON Logic's skeleton, with basic support for x-jsf-logic-validations. That is this PR.
  • Add in x-jsf-logic-computedAttrs (with reference to values defined in x-jsf-logic.computedValues) support.
  • General error handling.
  • Fieldset support
  • Conditional handling
  • Inline rules for x-jsf-logic-computedAttrs support.

This PR:

  • Adds the JSON Logic library.
  • Sets up the plumbing of json-logic's implementation in a JSON schema to work on different object levels (the scopes).
  • Adds the plumbing to use JSON logic during the runtime of a json-schema-form instance in createHeadlessForm.js
  • Adds the logic to apply this at the yup level during the validation of the form.
  • Adds a number of tests to express the ability to use JSON logic in a JSON Schema.

src/helpers.js Show resolved Hide resolved
@brennj brennj changed the title Part One: JSON Logic Skeleton [JSON Logic] Part One: JSON Logic Skeleton Aug 16, 2023
@brennj brennj changed the title [JSON Logic] Part One: JSON Logic Skeleton [JSON Logic] Part 1: JSON Logic Skeleton Aug 16, 2023
Copy link
Contributor

@johnstonbl01 johnstonbl01 left a comment

Choose a reason for hiding this comment

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

Just a couple comments / questions, otherwise 👍
Really appreciate all the detailed tests!

src/helpers.js Outdated Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
src/jsonLogic.js Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
@dilvane dilvane self-requested a review August 25, 2023 13:47
src/createHeadlessForm.js Outdated Show resolved Hide resolved
src/createHeadlessForm.js Show resolved Hide resolved
src/yupSchema.js Outdated Show resolved Hide resolved
src/createHeadlessForm.js Show resolved Hide resolved
src/createHeadlessForm.js Outdated Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
src/jsonLogic.js Outdated Show resolved Hide resolved
src/tests/jsonLogicFixtures.js Outdated Show resolved Hide resolved
src/tests/jsonLogic.test.js Outdated Show resolved Hide resolved
src/tests/jsonLogic.test.js Show resolved Hide resolved
src/tests/jsonLogic.test.js Outdated Show resolved Hide resolved
src/tests/jsonLogic.test.js Show resolved Hide resolved
chore: clean up conditional additions

chore: remove const tests

chore: remove dupe file

chore: remove group array stuff

chore: clean up yupschema

chore: clean up helpers a small bit

chore: remove all error handling for now

chore: clean up package-lock

chore: more removing stuff

chore: clean more
@brennj
Copy link
Collaborator Author

brennj commented Aug 31, 2023

Hopefully this is ready for another look and a merge 👀

Copy link
Contributor

@johnstonbl01 johnstonbl01 left a comment

Choose a reason for hiding this comment

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

Looks good from my perspective - appreciate the changes! One suggestion that Sandrina made about the name of the jsonLogic fixtures file is still outstanding, I believe?

@brennj
Copy link
Collaborator Author

brennj commented Aug 31, 2023

Looks good from my perspective - appreciate the changes! One suggestion that Sandrina made about the name of the jsonLogic fixtures file is still outstanding, I believe?

i know i seen this before but i cant find it again

johnstonbl01
johnstonbl01 previously approved these changes Aug 31, 2023
@johnstonbl01
Copy link
Contributor

Looks good from my perspective - appreciate the changes! One suggestion that Sandrina made about the name of the jsonLogic fixtures file is still outstanding, I believe?

i know i seen this before but i cant find it again

Sometimes it's easier to see all the comments from the Files changed view in my experience.

@brennj brennj merged commit 63149ae into main Aug 31, 2023
3 checks passed
@brennj brennj deleted the json-logic-skeleton branch August 31, 2023 14:35
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.

None yet

4 participants