aqualinkorg / aqualink-app

Aqualink.org Ocean Monitoring Application
MIT License
35 stars 12 forks source link

Add water quality sites in the map filter #1026

Open Caesarh97 opened 2 months ago

Caesarh97 commented 2 months ago

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
ericboucher commented 2 months ago

/bounty $40

algora-pbc[bot] commented 2 months ago

💎 $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 commented 2 months ago

/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 commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

sounds good, let me give it a go

yaodingyd commented 1 month ago

@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 commented 1 month ago

@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

algora-pbc[bot] commented 2 weeks ago

💡 @yaodingyd submitted a pull request that claims the bounty. You can visit your bounty board to reward.