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(custom-data-link): allow falsey values for resources #1112

Merged
merged 2 commits into from
Feb 8, 2022

Conversation

mediremi
Copy link
Contributor

Currently it is not possible to use falsey (e.g. false, null, '', 0, ...) values for resources when using CustomDataProvider.

// This throws the error 'No data provided for resource type <resource name>!'
<CustomDataProvider data={mockData}>
  <SomeComponent />
</CustomDataProvider>

This PR fixes that by only treating a resource as unavailable if its value is undefined (when using the CustomDataLink link).

@mediremi mediremi requested a review from amcgee January 19, 2022 16:19
Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

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

LGTM!

@mediremi mediremi enabled auto-merge (squash) February 8, 2022 08:12
@mediremi mediremi merged commit 75f3528 into master Feb 8, 2022
@mediremi mediremi deleted the fix/custom-data-link-fail-on-miss branch February 8, 2022 08:18
dhis2-bot added a commit that referenced this pull request Feb 8, 2022
## [3.2.9](v3.2.8...v3.2.9) (2022-02-08)

### Bug Fixes

* **custom-data-link:** allow falsey values for resources ([#1112](#1112)) ([75f3528](75f3528))
@dhis2-bot
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants