Commit Graph

53 Commits

Author SHA1 Message Date
Kevin Ansfield
060d791a63 Removed need for .get() with settings service
no issue

The `settings` service has been a source of confusion when writing with modern Ember patterns because it's use of the deprecated `ProxyMixin` forced all property access/setting to go via `.get()` and `.set()` whereas the rest of the system has mostly (there are a few other uses of ProxyObjects remaining) eliminated the use of the non-native get/set methods.

- removed use of `ProxyMixin` in the `settings` service by grabbing the attributes off the setting model after fetching and using `Object.defineProperty()` to add native getters/setters that pass through to the model's getters/setters. Ember's autotracking automatically works across the native getters/setters so we can then use the service as if it was any other native object
- updated all code to use `settings.{attrName}` directly for getting/setting instead of `.get()` and `.set()`
- removed use of observer in the `customViews` service because it was being set up before the native properties had been added on the settings service meaning autotracking wasn't able to set up properly
2022-10-07 16:14:57 +01:00
Rishabh
190031f38c Added modal for showing all attribution sources
refs https://github.com/TryGhost/Team/issues/1941

- limits the source attribution list to top 5 on dashboard, and shows all sources on clicking on `Other` link

Fixed lint
2022-09-26 10:43:05 +05:30
Kevin Ansfield
fa84808048 Dropped ember-cli-moment-shim dependency
no issue

Since `ember-moment@10.0` it's not been necessary to use the `ember-cli-moment-shim` package, with `moment` instead being usable directly via `ember-auto-import`. Getting rid of the shim package is necessary for compatibility with `embroider`, Ember's new build tooling.

- dropped `ember-cli-moment-shim` dependency
- added `moment-timezone` dependency and updated all imports to reflect the different package
- worked around `ember-power-calendar` having `ember-cli-moment-shim` as a sub-dependency
  - added empty in-repo-addon `ember-power-calendar-moment` to avoid `ember-power-calendar` complaining about a missing package
  - added `ember-power-calendar-utils` in-repo-addon that is a copy of `ember-power-calendar-moment` but without the build-time renaming of the tree for better compatibility with embroider
2022-09-24 13:28:23 +02:00
Rishabh
6dbc42bf55 Updated api endpoint for referrer stats in admin
refs https://github.com/TryGhost/Team/issues/1939
2022-09-22 17:48:46 +05:30
Rishabh Garg
98fc808e6e
Wired referrers API data to admin dashboard (#15454)
closes https://github.com/TryGhost/Team/issues/1939

- adds real source data counts to attribution table and chart on dashboard
2022-09-22 16:51:41 +05:30
Simon Backx
7cadaa6378 Implemented referrers stats API on posts' analytics page
refs https://github.com/TryGhost/Team/issues/1921
2022-09-21 18:20:03 +02:00
Simon Backx
ad79d45926 Added source attribution table to posts' analytics page
refs https://github.com/TryGhost/Team/issues/1921
2022-09-21 15:01:31 +02:00
Simon Backx
ae6761c08b Updated filledSubscriptionCountStats implementation in dashboard stats
refs https://ghost.slack.com/archives/C02G9E68C/p1663674928386639
2022-09-20 15:06:09 +02:00
Djordje Vlaisavljevic
99f119a1f4
Source attribution design (#15431)
- Updated subscription box design
- Added Source attribution widget to the dashboard

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-09-19 10:48:24 +02:00
Rishabh
048055bb51 Updated mock data format for source attribution
refs https://github.com/TryGhost/Team/issues/1891

- cleans up mock stats data from hardcoded values for each period to instead have the global stats format with date
- the value for each period is calculated dynamically based on selected option
- is in line with how API data is expected to be returned, allowing it to easily fit in when added
2022-09-13 20:14:17 +05:30
Rishabh
e151791fe2 Added admin mock stats for source attribution
refs https://github.com/TryGhost/Team/issues/1891

- adds basic mock stats data for member source attribution on dashboard
2022-09-13 15:48:50 +05:30
Simon Backx
5f63060f78 🐛 Excluded plan changes from paid subscribers graph in dashboard
refs https://github.com/TryGhost/Team/issues/1673

When a user switches plan, the paid subscribers delta chart on the dashboard displays the change as a cancellation plus a new subscription. This display is misleading and confusing - instead, plan changes should be excluded from the paid subscribers delta chart.
2022-07-13 13:46:45 +02:00
Simon Backx
bc1aa493fa 🐛 Fixed unreliable paid members enabled checks (#2405)
refs https://github.com/TryGhost/Team/issues/1650

- Some places only checked for Stripe being connected via the 'connect' method and ignored the 'direct' method
- Updated (where possible) admin to use the new calculated `paid_members_enabled` setting
2022-05-24 16:53:03 +02:00
Simon Backx
bafbe9b6b0 Fixed paid subscribers graph not counting all items
refs https://ghost.slack.com/archives/C02G9E68C/p1652971697862399?thread_ts=1652893154.768669&cid=C02G9E68C

mergeDates skips a value when the date of the next item is different than the currently aggregating entry
2022-05-19 17:20:03 +02:00
Simon Backx
0cddb3ccb9 Fixed archived paid tiers causing dashboard errors 2022-05-19 11:19:28 +02:00
Simon Backx
6ba9f6a3be Fixed tiers without members not shown in paid mix chart 2022-05-18 14:17:59 +02:00
Simon Backx
4f52acd433 Fixed usage of nullish coalescing in dashboard mocking 2022-05-18 10:51:38 +02:00
Hannah Wolfe
affe6743e5 Renamed products to tiers (#2372)
refs: https://github.com/TryGhost/Team/issues/1145

- this should allow us to remove the /products endpoint in v5

It avoids:

- `kg-product-card`, that really is meant to say product
- `product-cadence` on offers

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-11 22:41:54 +05:30
Peter Zimon
c2b49028f1 Updated dashboard totals chart ticks
- set 30 days to show every other gridline
- set 90 days to show every 3rd gridline

Note that this required to add an extra day to the displayed number of days.
2022-05-11 12:16:31 +02:00
Simon Backx
c36a5bbaeb Fixed paidMembersByCadence always having keys
refs https://github.com/TryGhost/Team/issues/1601

When there is no data in the backend, no keys are added.
2022-05-10 18:06:24 +02:00
Simon Backx
8a303fe411 Fixed paid visible on dashboard when stripe is not connected
refs https://ghost.slack.com/archives/C02G9E68C/p1652090614031099
2022-05-09 17:56:05 +02:00
Simon Backx
dd901c6790 Fixed paid subscribers chart reloading when toggling fake data
refs https://ghost.slack.com/archives/C02G9E68C/p1651773627838629?thread_ts=1651771893.729649&cid=C02G9E68C

The chart was not reloading when the fake data toggle was changed. This code is only used when using mocked data. So if you loaded the page without mocked data, everything was working fine and the chart did show the right data. If you then enabled fake data, the chart just won’t reload and would keep showing the initial data (so it wasn’t always showing mocked data, just the initial data).
2022-05-06 14:35:13 +02:00
James Morris
983d37253a Changed new Dashboard to default to 30 days rather than 7
refs: https://github.com/TryGhost/Team/issues/1531
2022-05-04 17:02:08 +01:00
Fabien 'egg' O'Carroll
94ae33858d Fixed mergeDates zero and one item in list (#2360)
The exit clause of the mergeDates function should return an array rather
than an object, to ensure that an array is always returned. Because we
are using the concat method when recursing, this continues to work for
longer lists.

We want to return an empty array if list is empty, this protects against
returning [undefined]
2022-05-03 12:01:23 +01:00
Fabien 'egg' O'Carroll
b0a875f733 Wired up subscription stats api (#2350)
refs https://github.com/TryGhost/Team/issues/1512

Adds the new endpoint `/stats/subscriptions/` which provides data for
the paid mix and paid breakdown charts.

Made the filledMissingDates function more generic by passing in a
`copyData` function which is used to populate a date from the previous
days data, if the data for that date is missing.
2022-04-27 15:11:01 +01:00
Simon Backx
0b45de28be Updated subscriber count used in dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1538
2022-04-26 13:10:16 +01:00
Simon Backx
a1b9ec830a Moved comped members into paid members counts
no issue

In dashboard 5.0, comped members should be included in paid members and are not considered free members.
2022-04-20 14:45:34 +02:00
James Morris
a06003e7b5 Introduced new layout to bring new Dashboard closer to release (#2342)
refs: https://github.com/TryGhost/Team/issues/1531

- broke apart the combined chart
- added back in the paid mix chart
- separated out the mini charts into separate components
- made top chart work with total, paid and free
- added in an overview section back at the top for total, paid, free
- made metric labels and values larger and easier to parse

Co-authored-by: Simon Backx <simon@ghost.org>
2022-04-20 14:43:11 +02:00
Simon Backx
960536dcda Improved anchor chart and reloading of charts
refs https://github.com/TryGhost/Team/issues/1510

- Fixes site status not loading (https://github.com/TryGhost/Team/issues/1510) for mocked data because of tasks were already pending (reloadAll now cancels them first)
- Reload no longer required when switching anchor chart type
- Removed paidOptionSelected (fixes bug when swiching)
- Moved did-insert of anchor chart to topmost element
- Renamed chartDisplay values
2022-04-13 14:56:34 +02:00
Simon Backx
7b12785c30 Synced the start date of members and MRR 'all time' charts (dashboard 5.0)
no issue

- When using 'all time' in the past, the start date of the total members/paid members chart would differ from the MRR chart. They are now synced.
- The start date is always the earliest date we have data for (MRR or member counts)
- The all time chart is minimum 90 days long
2022-04-08 10:04:42 +02:00
Simon Backx
0d7ada66b3 Replaced usage of older MRR stats endpoint with new endpoint
refs https://github.com/TryGhost/Team/issues/1470

- Correctly uses the highest value currency in the MRR graph
2022-04-08 09:51:30 +02:00
James Morris
8fe18d7e30 Dashboard consolidated graph (#2323)
* Basic work to combine the three line graphs for the new dashboard

refs: https://github.com/TryGhost/Team/issues/1467

- combined three line graphs into one main one at the top
- still working on this, so some code is a little rough

* Tidying up a few bits of consolidated graph in new dashboard

refs: https://github.com/TryGhost/Team/issues/1467

* Updated chart anchor component for removed member counts

no issue

* Updated chart paid members to not reload on days change

no refs

* Moved did-insert to top element in chart-anchor

* Fixed chart anchor to use filled member data

* Replaced chart anchor divs with buttons

* Tweaking up the paid graphs below anchor to improve visuals

refs: https://github.com/TryGhost/Team/issues/1467

* Fixed missing type attributes on buttons in chart anchor

* Updated MMR to MRR for the new consolidated graph

refs: https://github.com/TryGhost/Team/issues/1467

* Added real MRR to chart anchor

* Added open rate percentage data to chart email

Co-authored-by: Simon Backx <simon@ghost.org>
2022-04-01 14:53:55 +01:00
Simon Backx
0023695a29 Implemented loadSiteStatus in dashboard 5.0 stats service
refs https://github.com/TryGhost/Team/issues/1468

- Implemented loadSiteStatus with real data
- Replaced unused stripeEnabled with hasMultipleTiers
- hasMultipleTiers=false hides the tiers paid mix chart
- Improved loading and updating fake state
- Removed deprecated loadMembersCounts method in dashboard stats service
2022-04-01 10:51:15 +02:00
Simon Backx
37ee53bb4a Renamed stats endpoint member again
refs 759e362a30
2022-03-31 17:11:36 +02:00
Simon Backx
09f4d9b373 Changed member count stats endpoint URL
refs https://ghost.slack.com/archives/C02G9E68C/p1648737467414789?thread_ts=1648644801.253699&cid=C02G9E68C
2022-03-31 17:06:48 +02:00
Simon Backx
01b411de85 Added paid mix chart implementation for dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1443

- Includes support for 'all' data in member count charts
- Fixed reloading of MRR data when switching between days
- Loading data now always returns a 'promise' instead of just dropping it
- Tiers and cadence paid mix chart added
- Defaults to mocked data = off (required to prevent loading paid mix tiers on page load)
- Note that there is still some discussion about the correctness of the tiers paid mix data, refs Slack https://ghost.slack.com/archives/C02G9E68C/p1648717224956659
2022-03-31 16:22:49 +02:00
Simon Backx
4cae27f5e2 Replaced custom member counting queries with MembersCountCacheService
no issue

- Replaced custom member counting queries with the MembersCountCacheService
- Results are reused if they were already fetched less then 60 seconds ago
- Fixed logic in MembersCountCacheService to only return old results (> 60) instead of new results (<= 60)
2022-03-31 16:09:41 +02:00
Simon Backx
5b120d5574 Updated member count charts to use the new Stats API
refs https://github.com/TryGhost/Team/issues/1443
refs https://github.com/TryGhost/Team/issues/1458
refs https://github.com/TryGhost/Team/issues/1459

- Includes the new paid members chart (deltas)
- Reused the counts from the stats endpoint, instead of doing separate calls to the members api browse endpoint.
2022-03-31 16:09:41 +02:00
Simon Backx
8d3c1dacc2 Added member count trends in dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1443

- Fetch member counts from 30 days ago
- Added Percentage component to show +1%, -1% or = changes
- Fixed: emails sent number was not formatted
- Fixed: wrong dates were used for some stats
2022-03-28 16:28:09 +02:00
Simon Backx
7d104b2b44 Improved email open rate chart in dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1443

- Now fetches email models instead of posts
- Fetches up to 8 emails
- Autofills missing emails, so we always have 8 emails
- Changed data structure of emailOpenRateStats variable in dashboard stats service
2022-03-28 14:20:07 +02:00
Simon Backx
6e8bf040a9 Added emails sent in past 30 days from real endpoints to dashboard 5
refs https://github.com/TryGhost/Team/issues/1443

- Also fixed the open rate that was used in the email open rate chart
- Calculate the total emails sent in the last 30 days
2022-03-28 13:49:44 +02:00
Simon Backx
801a910f7d Added newsletter subscribers count from real endpoints to dashboard 5
refs https://github.com/TryGhost/Team/issues/1443
2022-03-28 13:19:56 +02:00
Simon Backx
5505500fc0 Added MRR data to dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1443

Will still require some optimizations in the future.
2022-03-28 11:12:01 +02:00
Simon Backx
cc478dcb53 Added basic member counts chart implementation for dashboard 5
refs https://github.com/TryGhost/Team/issues/1443

A real API endpoint is now used to power the member counts chart. But it sill requires some optimizations.
2022-03-28 10:47:09 +02:00
Simon Backx
16d0629de3 Added last seen and member count stats from real API in dashboard 5
refs https://github.com/TryGhost/Team/issues/1443
2022-03-28 09:55:37 +02:00
Simon Backx
9213e590ad Added recent posts and email open rate data to dashboard 5
refs https://github.com/TryGhost/Team/issues/1448
refs https://github.com/TryGhost/Team/issues/1443

- Toggle to switch between fake and real data
- Email open rate can now use real data (still problem with posts that don't have email data)
- Recent posts data
2022-03-24 18:17:02 +01:00
Simon Backx
a41785ae95 Added async loading to dashboard 5 prototype charts
refs https://github.com/TryGhost/Team/issues/1443

- Also moved loading of charts outside of constructors to avoid infinite update loops in Ember
- Random loading delay when using fake states
2022-03-24 15:40:48 +01:00
Simon Backx
7fdf3c7433 Added mechansim to save prototype state for dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1444

- Moved control panel to separate component
- Moved storage of amount of graph days to load to dashboard stats service
- Moved storage of engagement filtered status to dashboard stats service
- Dropdown state selector
- Save state in localstorage
- SiteStatus object and loadStatus methods in dashboard stats service and mock service
2022-03-24 12:09:09 +01:00
Simon Backx
59c22cc3dc Fixed wrong date labels in graphs
no issue

fillMissingDates in the dashboard service did reuse the same object instead of creating new ones for dates without data.
2022-03-24 09:46:16 +01:00
Simon Backx
d918be7acf Added initial mocked state to dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1432

Earlier, no data was shown when opening the new dashboard. Now some data is being mocked when opening the dashboard.
2022-03-24 09:11:53 +01:00