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

Add water quality sites in the map filter #1026

Open
Caesarh97 opened this issue Sep 18, 2024 · 8 comments · May be fixed by #1076
Open

Add water quality sites in the map filter #1026

Caesarh97 opened this issue Sep 18, 2024 · 8 comments · May be fixed by #1076
Assignees

Comments

@Caesarh97
Copy link
Collaborator

On the /map page where we have a drop-down list where we filter sites, I’d like to add all the sites with water quality data. Would it be easy to add these? In this filter, all sites that have either {sonde} or {hui} can be added. Both are displaying water quality data and would fit in this filter. This issue is of low priority, so if it’s fast and easy, we could add it now. Otherwise, it can wait.

Screenshot 2024-09-17 at 4 15 05 PM
@Caesarh97 Caesarh97 changed the title Water quality sites in the map filter Add water quality sites in the map filter Sep 18, 2024
@ericboucher
Copy link
Member

/bounty $40

Copy link

algora-pbc bot commented Sep 18, 2024

💎 $40 bounty • Aqualink.org

Steps to solve:

  1. Start working: Comment /attempt #1026 with your implementation plan
  2. Submit work: Create a pull request including /claim #1026 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to aqualinkorg/aqualink-app!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @yaodingyd Sep 18, 2024, 2:34:51 PM #1049

@yaodingyd
Copy link
Collaborator

yaodingyd commented Sep 18, 2024

/attempt #1026

Algora profile Completed bounties Tech Active attempts Options
@yaodingyd    1 aqualinkorg bounty
+ 4 bounties from 1 project
JavaScript, TypeScript,
Python & more
Cancel attempt

@yaodingyd
Copy link
Collaborator

yaodingyd commented Sep 26, 2024

Not sure if there's an easy way to do this. Right now we need to query forcastData and latestData two endpoints to find if there's any hui or sonde data, and these two endpoints require each specific site id, so we need to paginate through all sites and dispatch two endpoint for all of them to aggregate the collection of sites with water samplings. This seems rather inefficient.

I think to enable this feature, we would need to return

  1. water quality data to the top level site model, or
  2. return ALL of latestData and forcastData

so we can process this in client side
not sure the implication/feasibility of doing this in api

@ericboucher
Copy link
Member

Indeed, I think we probably need to update the API /sites endpoint to achieve this. We could maybe add a boolean flag to the site if it has received any water quality data in the past X weeks. Where X weeks is the same metric we currently used on the site page to determined if we will display Water Quality data or not. Is that something you feel comfortable looking into @yaodingyd ?

@yaodingyd
Copy link
Collaborator

sounds good, let me give it a go

@yaodingyd
Copy link
Collaborator

@ericboucher is there a way to populate local db with some mock data? I'm doing development under api, applied the migrations but need some data (ideally medium scale) to run it end-to-end

@ericboucher
Copy link
Member

@yaodingyd unfortunately we don't have a great way to do this at the moment, but I could create a small extract of our staging DB for you. Which tables would you need? You can email me: eric at ovio.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment