-
Notifications
You must be signed in to change notification settings - Fork 38
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: avoid reading from undefined error (DHIS2-17334) #2970
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When using View as with filters applied.
🚀 Deployed on https://pr-2970--dhis2-dashboard.netlify.app |
@@ -232,8 +232,9 @@ class Item extends Component { | |||
} | |||
case CHART: | |||
case VISUALIZATION: { | |||
return item.visualization.type === | |||
VIS_TYPE_OUTLIER_TABLE && | |||
return item.type === VISUALIZATION && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any use for the originalType
here? Check the function getItemTypeForVis
jenniferarnesen
approved these changes
May 3, 2024
Merged
dhis2-bot
added a commit
that referenced
this pull request
May 16, 2024
## [100.2.2](v100.2.1...v100.2.2) (2024-05-16) ### Bug Fixes * avoid re-rendering an item when adding the same again (DHIS2-17016) ([#2935](#2935)) ([dd67fc6](dd67fc6)) * avoid reading from undefined error (DHIS2-17334) ([#2970](#2970)) ([a4e5340](a4e5340)) * dimension list design (DHIS2-16270) ([#2861](#2861)) ([790afd2](790afd2)) * system / user setting for display name not respected in Org Unit tree (DHIS2-15000) ([#2971](#2971)) ([928b88a](928b88a))
🎉 This PR is included in version 100.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
kabaros
pushed a commit
that referenced
this pull request
May 31, 2024
## [100.2.2](v100.2.1...v100.2.2) (2024-05-16) ### Bug Fixes * avoid re-rendering an item when adding the same again (DHIS2-17016) ([#2935](#2935)) ([dd67fc6](dd67fc6)) * avoid reading from undefined error (DHIS2-17334) ([#2970](#2970)) ([a4e5340](a4e5340)) * dimension list design (DHIS2-16270) ([#2861](#2861)) ([790afd2](790afd2)) * system / user setting for display name not respected in Org Unit tree (DHIS2-15000) ([#2971](#2971)) ([928b88a](928b88a))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes DHIS2-17334
Key features
Description
This happened when using "View as" from Map to DV with some filters applied.
The reason is that
item
in that case is the Map item, and does not have thevisualization
key.The tag part only make sense when rendering an Outlier table visualization type.
The fix makes sure the
item
is of typeVISUALIZATION
and then checks if the visualization type is an Outlier table one.Screenshots
Before:
After:
the leftmost item is a Map one, and can be viewed as Chart even with filters applied
the rightmost item is a Visualization of type Outlier table and should render a tag informing about some filters not applied (Area in the example)