Commit Graph

22 Commits

Author SHA1 Message Date
Kevin Ansfield
93b4262db5 Extracted member activity fetching into new service
refs https://github.com/TryGhost/Team/issues/1277

- pulled timeline fetching from `members-stats` service to `members-activity` service ready for further refactoring to make fetching/processing more generic
2022-01-18 13:55:42 +00:00
Rishabh
948934da2d 🐛 Fixed incorrect MRR value on dashboard
closes https://github.com/TryGhost/Team/issues/950

- fixes the mrr value/chart on dashboard when a site has no new mrr events in more than 30 days shown as 0
- adds tests to cover more mrr event scenarios
2021-08-09 17:47:09 +05:30
Rish
803523c31d 🐛 Fixed incorrect member count on dashboard
closes https://github.com/TryGhost/Team/issues/561

In case the last event for a new member on site was before 30 day period, the count for members was showing 0 instead of the actual value. The change fixes the count to show the correct value even if there is no new recent member activity.
2021-03-24 21:56:35 +05:30
Rishabh Garg
74e2d3ef8c 🐛 Fixed MRR start date value in chart (#1865)
no refs

MRR start date value for charts was being calculated with start value as 0, assuming we have the data for first date in our range to use as start value. Since the events data returned only has data on dates where any MRR event happened, in case the first date in our range didn't have any. data we started from 0 instead of value on previous date. This fix

- updates calculation to pick the start value for chart based on value on last date in our range(30 days)
- adds unit tests for stats
2021-03-15 15:23:55 +05:30
Kevin Ansfield
287c98c707 Fixed membersStats service stale-data logic
no issue

- the stale data checks would always return false because the calculation was reversed
  - `old date - new date` will always result in a negative number so it would never be greater than 60000
  - switched to `new date - old date` to get a positive number so the `>` comparison works
  - moved `1 * 60 * 1000` into a constant so it's easier to the intended behaviour at a glance
2021-03-10 10:06:06 +00:00
Rish
137071500f Cleaned calculation for total/paid member count
refs https://github.com/TryGhost/Team/issues/469

- Fixed calculation for total/paid member count to use last value from outside range
- Fixed stats data override in dashboard
2021-02-25 21:19:10 +05:30
Rish
ee1bb32113 Cleaned newsletter open rate stats
refs https://github.com/TryGhost/Team/issues/469

- Cleaned up newsletter open rate stats and summary data
- Fixed incorrect cached value for open rate charts
2021-02-25 13:34:34 +05:30
Peter Zimon
92dbc288ec Updated open rate chart
- changed to bar chart
- added handling of empty dataset
2021-02-23 13:54:23 +01:00
Fabien O'Carroll
110335c7ac Updated fetching event timeline to accept limit
refs https://github.com/TryGhost/Team/issues/469

We want to allow the consumer of the data to be able to specify how much
data to fetch.
2021-02-23 12:44:17 +00:00
Rish
670d20bda5 Fixed newsletter charts data format
refs https://github.com/TryGhost/Team/issues/469

Uses updated data structure for newsletter charts, also updates to calculated openRate value
2021-02-23 03:16:10 +05:30
Rish
f1ea66fb5f Filled defaults for newsletter open stats
refs https://github.com/TryGhost/Team/issues/469

Pads newsletter stats in case of insufficient data with empty values for line chart
2021-02-23 02:48:47 +05:30
Rish
624001b15e Cleaned up mrr and count stats
refs https://github.com/TryGhost/Team/issues/469

- Cleans up incorrect values for mrr and count stats
2021-02-22 14:01:08 +05:30
Rish
e554e26b02 Added newsletter open rate stats
refs https://github.com/TryGhost/Team/issues/469

- Adds new chart to track newsletter open rates on dashboard
2021-02-22 14:01:08 +05:30
Peter Zimon
c83e54f21b Updated MRR chart style 2021-02-19 13:09:01 +01:00
Rishabh Garg
b7ae1233bf Updated MRR and count dashboard charts (#1846)
refs https://github.com/TryGhost/Team/issues/469

- Cleaned MRR stats data and label formatting
- Cleaned member counts stats - total and paid
2021-02-19 11:18:01 +05:30
Rish
d7cf0b4042 Fixed empty data handling for mrr chart
refs https://github.com/TryGhost/Team/issues/469
2021-02-19 00:49:59 +05:30
Rish
05df2bbad4 Added initial charts for dashboard
refs https://github.com/TryGhost/Team/issues/469

- Added MRR chart for last 30 days
- Added initial chart for Total member count
2021-02-18 22:20:58 +05:30
Fabien 'egg' O'Carroll
c56ba0c71e Added initial event timeline to dashboard (#1840)
refs https://github.com/TryGhost/Team/issues/469

* Updated stats service to fetch event timeline
* Updated dashboard controller to load events
* Added currency utils
* Added GhEventTimeline component
* Updated dashboard to render GhEventTimeline
2021-02-18 14:17:10 +00:00
Kevin Ansfield
147943f3a3 Fixed members list/chart not updating after members import
no issue

- move members loading code into `members` controller so that it's more accessible to other areas of the app
- add `refreshData()` to the `members` controller which forces members list and stats to be re-fetched
- call `members.refreshData()` after successful upload of members import file
- store range/days in `membersStats` service so that it's remembered across refreshes and component renders
2020-06-01 15:48:46 +01:00
Kevin Ansfield
514034d329 Fixed and improved members stats "debounced" fetches
no issue

- the "days changed" logic was incorrect so we were always performing new fetches rather than using existing data
- added a minor improvement that returns an in-progress fetch promise if we have one and params haven't changed - avoids triggering unnecessary extra fetches in the rare occasions the chart is re-rendered before a previous stats fetch has finished
2020-05-28 11:11:43 +01:00
Kevin Ansfield
76b93c3be7 Fixed members chart
no issue

- "stale data" logic was incorrect so we were always returning `undefined` from `membersStats.fetch()`
- improved behaviour of the chart when stats are not available or are loading
2020-05-27 16:12:13 +01:00
Kevin Ansfield
86702ed949 Memoized member stats with expiration
no issue

- added a `member-stats` service to keep member stats state outside of the chart component's lifecycle
- returns memoized member stats when fetching if the query hasn't changed and the data is less than a minute old
- reduces potentially heavy network requests when quickly navigating between members list and other screens
2020-05-26 17:17:52 +01:00