1Hive / apiary

Aragon DAO explorer
https://apiary.1hive.org
GNU General Public License v3.0
25 stars 16 forks source link

Add total activity and AUM #169

Closed sembrestels closed 4 years ago

sembrestels commented 4 years ago

Screenshot from 2020-02-14 23-43-37

AUM and Total activity of the Orgs displayed in the list is shown in the lateral.

I'm worried because it may be misleading. When filtering by timeframe, a user may expect to see how much activity there was in that time, not the last 90 days activity of the orgs created during that timeframe.

I think we may have to rethink the filters at this point, and see how we provide the best UX.

lkngtn commented 4 years ago

I think we may have to rethink the filters at this point, and see how we provide the best UX.

Yeah that makes sense, though I don't think it should prevent us from merging this. Having the aggregate value (especially when filtering by template) is quite useful. We probably should indicate that it is aggregating the "recent" (eg 90 days activity) rather than all activity though.

onbjerg commented 4 years ago

I'm worried because it may be misleading. When filtering by timeframe, a user may expect to see how much activity there was in that time, not the last 90 days activity of the orgs created during that timeframe.

I think we may have to rethink the filters at this point, and see how we provide the best UX.

The filters are as they should be. The reason that it is the last 90 days of activity is not because of the filters.

I don't think we should have this in the pagination code since that part is generic to a lot of different parts of the API, and total AUM/total activity is specific to organisations. I think we need a new type at the query root with statistics, possibly supporting the same filters as for organisations.

Also, I would advise that we should probably do the sums using MongoDB in an aggregation pipeline instead as that is faster in the long run.

lkngtn commented 4 years ago

Having a bit of trouble following the conversation on this one, what is the next step for this? Would love to get this included.

sembrestels commented 4 years ago

I need to refactor the code first. I think I can do it tomorrow.

sembrestels commented 4 years ago

@onbjerg I'm using mongo aggregation to sum up totals, and also using filters to obtain different numbers.

I was not sure of how to add a new type at the query root, and what schema it should have, so I moved the code to orgs/data.js file, as it is specific for organizations. If you want me to change it again, please tell me, and I'll try again.

onbjerg commented 4 years ago

I went ahead and did my suggested changes since I am going to take a stab at #123 and I want to base it off of this :) I will merge and continue work (some checks are failing).

Thanks!

sembrestels commented 4 years ago

Cool! I may retake that idea of separating the organization statistics when working on #123 😉

sembrestels commented 4 years ago

Lol! You read my mind! Yes, go ahead with #123, I'm going to take a flight in few minutes.

onbjerg commented 4 years ago

Haha 😁