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

[FLAG-943] Tropical Tree Cover analysis malfunctioning #4707

Merged
merged 8 commits into from
Oct 20, 2023

Conversation

willian-viana
Copy link
Collaborator

@willian-viana willian-viana commented Oct 16, 2023

Overview

Tree Cover Density widget doesn't work correctly on Analysis when threshold is added as parameter.
This widget has its own threshold (>10 as default), but when a user selects Tropical Tree Cover layer and changes the threshold, a new parameter was added to the query, making the request fail.

We did a major refactor at the getWHEREQuery to improve readability and add some new validations.

Demo

Screenshot 2023-10-17 at 15 45 47

Screenshot 2023-09-07 at 17 49 47

Testing

  • Open the map
  • Select Tropical Tree Cover
  • Change the threshold
  • Try to see Tree Cover Density Widget (it should work normally)

Now when the user select a thresold on the ttc layer, tree cover density widget will ignore that and keep fetching using >=10% of thresold
and the right table wri_tropical_tree_cover__decile
@willian-viana willian-viana self-assigned this Oct 16, 2023
@willian-viana willian-viana changed the title fix(ttc): add tree cover density validation to getWHEREQuery method [FLAG-943] Tropical Tree Cover analysis malfunctioning Oct 16, 2023
@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 16, 2023 21:11 Inactive
@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 17, 2023 18:33 Inactive
- Improve readability
- Add tree cover density validation to remove threshold paramater from layers
- Split responsibilities to follow single-responsibility principle
@willian-viana willian-viana marked this pull request as ready for review October 17, 2023 18:41
@willian-viana willian-viana force-pushed the hotfix/ttc-analysis-FLAG-943 branch from 9f1e376 to abc47eb Compare October 17, 2023 18:41
@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 17, 2023 18:41 Inactive
@willian-viana willian-viana requested a review from wri7tno October 17, 2023 18:48
@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 20, 2023 16:31 Inactive
@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 20, 2023 16:39 Inactive
@@ -0,0 +1,41 @@
import { getWHEREQuery } from '../get-where-query';

describe('getWHEREQuery', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉

@willian-viana willian-viana temporarily deployed to gfw-staging-pr-4707 October 20, 2023 16:47 Inactive
@willian-viana willian-viana merged commit 1e19354 into develop Oct 20, 2023
4 checks passed
@willian-viana willian-viana deleted the hotfix/ttc-analysis-FLAG-943 branch October 20, 2023 17:12
@willian-viana willian-viana mentioned this pull request Oct 20, 2023
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