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

fix: update conditional prop codegen #917

Merged
merged 1 commit into from
Feb 13, 2023
Merged

fix: update conditional prop codegen #917

merged 1 commit into from
Feb 13, 2023

Conversation

letsbelopez
Copy link
Contributor

Issue #, if available:

Description of changes:

Added another test case for Predicate operandType.

The conditional property code was wordy because it's using optional chaining and validating references between nested objects with &&. Using both isn't necessary.

If the object is null or undefined, the optional chaining short circuits returns undefined.

It looked like user?.lastName && user?.lastName == \\"Bound Value\\" and buttonColor && buttonColor == \\"red\\" ? true : false}

This commit updates it to remove the the &&

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@letsbelopez letsbelopez requested a review from a team as a code owner February 13, 2023 18:59
@codecov-commenter
Copy link

Codecov Report

Merging #917 (3abf2e2) into main (9a716a3) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #917   +/-   ##
=======================================
  Coverage   92.99%   92.99%           
=======================================
  Files         118      118           
  Lines        5097     5097           
  Branches     1500     1500           
=======================================
  Hits         4740     4740           
  Misses        336      336           
  Partials       21       21           
Impacted Files Coverage Δ
...egen-ui-react/lib/react-component-render-helper.ts 91.69% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a716a3...3abf2e2. Read the comment docs.

@letsbelopez letsbelopez merged commit 4b47155 into main Feb 13, 2023
@letsbelopez letsbelopez deleted the conditional-prop branch February 13, 2023 21:28
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.

4 participants