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 ra-data-graphql incorrectly warns about deprecated override option being set #10138

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Fix ra-data-graphql incorrectly warns about deprecated override option being set #10138

merged 1 commit into from
Aug 13, 2024

Conversation

JonasDoe
Copy link
Contributor

@JonasDoe JonasDoe commented Aug 12, 2024

Problem

#10052 - the check whether the override prop was used is faulty and warns even when not appropriate.

Solution

As suggested in the comments, instead of checking whether override is != null, we check whether it has keys in it. This way, its default value - {} won't pass this check, and no warning gets logged.
I used Object.keys(override).length > 0 instead of Object.keys(override).length before I favor explicitness over the somewhat wonky JavaScript coercion. I can change this, though.

How To Test

Follow the steps described in #10052 with this fixed version.

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The PR includes unit tests (if not possible, describe why) - it's quite an effort and I'm not sure it's worth it for a behavior which will disappear once the depcrecated property gets removed, and whose impact is rather neglectable (we're talking about the condition for a log entry here 🙈 ). Additionally, the make scripts don't seem to work under Windows, so I had to switch to another platform first, or try to make it run under WSL. I could try that, but I dunno when I find time for such an undertaking.
  • The PR includes one or several stories (if not possible, describe why) - no were feature changed, and a log entry isn't really something to be displayed in a story anyway
  • The documentation is up to date

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and its detailed description 🙂

@slax57 slax57 added this to the 5.1.2 milestone Aug 13, 2024
@slax57 slax57 merged commit bf58a52 into marmelab:master Aug 13, 2024
13 checks passed
@slax57 slax57 changed the title adjusted check for use of the override option Fix ra-data-graphql incorrectly warns about deprecated override option being set Aug 13, 2024
@JonasDoe JonasDoe deleted the #10052_fix_faulty_override_warning branch August 13, 2024 08:41
@fzaninotto fzaninotto changed the title Fix ra-data-graphql incorrectly warns about deprecated override option being set Fix ra-data-graphql incorrectly warns about deprecated override option being set Aug 19, 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