WildAid / o-fish-web

Web application for the Officer's Fishery Information Sharing Hub (O-FISH). The web app allows agencies to gain insights from the aggregated information gathered during a routine vessel inspection (submitted via the web app).
Apache License 2.0
32 stars 41 forks source link

Agencies Dashboard for Global Administrator should filter by date #233

Closed o-fish-wildaid closed 4 years ago

o-fish-wildaid commented 4 years ago

The Agencies Dashboard at /#/global_agencies (Dashboard->Agencies for the global administrator) shows all the agencies with their boardings/violations/compliance rate. However it shows those numbers for all time; it should show those numbers by date range in the date filter.

Example of the date filter on the agencies page: Screen Shot 2020-10-02 at 12 50 30 PM

SEGH commented 4 years ago

I'd like to try working on this issue

Sheeri commented 4 years ago

Go for it, @SEGH - I've assigned it to you. Thanks for continuing to work on O-FISH - it's awesome to have you contributing so much!

SEGH commented 4 years ago

@Sheeri I was able to get this working, but only by also modifying the getAgencies function in Realm. That function currently only returns the total number of boardings and violations, so I added date to the $match in that function. Should I go ahead and make my pull request for the changes to the web repository even though the page doesn't work without the new function?

Sheeri commented 4 years ago

Hi @SEGH yes, go ahead and add that PR in - you can also add a PR to the o-fish-realm code - the file should be https://github.com/WildAid/o-fish-realm/blob/main/WildAidDemo/functions/getAgencies/source.js

(or, if you clone the o-fish-realm repository, it will be in: WildAidDemo/functions/getAgencies/source.js)

We can change Realm first, then merge in the web code.