-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(tupaiaWeb): RN-1111: Disable map overlays for levels higher than current entity #5888
base: dev
Are you sure you want to change the base?
Conversation
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
export const getFriendlyEntityType = entityType => { |
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.
Could you please add a comment here as it's hard to tell exactly why this needs to be done 🙏
@@ -219,6 +236,7 @@ export const MapOverlayList = ({ toggleOverlayLibrary }: { toggleOverlayLibrary? | |||
|
|||
if (isLoadingMapOverlays) return null; | |||
|
|||
const friendlyEntityType = getFriendlyEntityType(entity?.type); |
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.
Might be nice to just add this to useEntity?!
@@ -141,6 +156,11 @@ export class MapOverlaysRoute extends Route<MapOverlaysRequest> { | |||
(relation: MapOverlayGroupRelation) => { | |||
if (relation.child_type === MAP_OVERLAY_CHILD_TYPE) { | |||
const overlay = overlaysById[relation.child_id]; | |||
|
|||
// If the measure level is found in the ancestor types, that means the currently selected entity is a descendant of the measure level entity, so there will be no data to display. In this case, the overlay should be disabled. | |||
const isDisabled = overlay.config.measureLevel |
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.
Nice - I think this is a great solution in the end. It took 2 years but we finally figured it out 😆
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.
Love it!
merge: update branch with latest dev
Issue RN-1111: Disable map overlays for levels higher than current entity
Changes:
Screenshots: