Commit Graph

9174 Commits

Author SHA1 Message Date
James Morris b49db57a90 Moved around the delta sub graph to MRR to hopefully make sense contextually
refs: https://github.com/TryGhost/Team/issues/1462

- moved the delta graph into the revenue graph of the main combined graph
- made the secondary dropdown work again
- updated some chart titles
- tidied up the code and styles to make it work well
2022-04-14 15:28:55 +01:00
Kevin Ansfield 4a8dcb9bab 🐛 Fixed close button on "unsaved changes" modal not always behaving like "Stay" button
no issue

The close button in the unsaved changes modal used the `@close` action directly compared to the "Stay" button which used `(fn @close false)`. The close button version without explicit arguments resulted in the first argument being a `PointerEvent` instance which if checked as a modal return value as `if (shouldClose)` would evaluate as truthy therefore matching the "Leave" behaviour instead of the "Stay" behaviour.

- changed modal to explicitly call `(fn @close false)` when the close button is clicked
- updated design settings route to have an explicit `shouldLeave === true` check so default behaviour is always "Stay"
2022-04-14 12:39:10 +01:00
Kevin Ansfield 3ccb00e7f7
Cleaned up call of a removed function - fixes tests (#2335)
refs 07d48c6497

- `resetEmailAddresses()` was called when saving the labs version of members-email settings screen but the function no longer exists, this was throwing an error which broke all following tests in CI
2022-04-14 11:01:09 +01:00
Kevin Ansfield 07d48c6497 Added sender email verification flow for newsletters
refs https://github.com/TryGhost/Team/issues/584
refs https://github.com/TryGhost/Team/issues/1498

- updated newsletter save routine in `edit-newsletter` modal to open an email confirmation modal if the API indicates one was sent
  - modal indicates that the previously set or default email will continue to be used until verified
  - response from API when saving looks like `{newsletters: [{...}], meta: {sent_email_verification: ['sender_name]}}`
  - added custom newsletter serializer and updated model so that the `meta` property returned in the response when saving posts is exposed
    - Ember Data only exposes meta on array-response find/query methods
    - https://github.com/emberjs/data/issues/2905
- added `/settings/members-email-labs/?verifyEmail=xyz` query param handling
  - opens email verification modal if param is set and instantly clears the query param to avoid problems with sticky params
  - when the modal opens it makes a `PUT /newsletters/verify-email/` request with the token in the body params, on the API side this works the same as a newsletter update request returning the fully updated newsletter record which is then pushed into the store
- removed unused from/reply address code from `<Settings::MembersEmailLabs>` component and controller
  - setting the values now handled per-newsletter in the edit-newsletter modal
  - verifying email change is handled in the members-email-labs controller
- fixed mirage not outputting pluralized root for "singular" endpoints such as POST/PUT requests to better match our API behaviour
2022-04-13 19:34:58 +01:00
James Morris 21530371b2 Tiny fix to add transparent border on big metrics so they don't move on selection for new dashboard
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-13 15:30:32 +01:00
James Morris bb707571d6 More layout and chart adjustments to better improve the design
refs: https://github.com/TryGhost/Team/issues/1462

- added back in the main title to the top chart
- brought back the main metric background and centered buttons
- adjusted lots of spacing
- made the chart ticks for main graph dynamic
- improved the look of the breakdown graph
2022-04-13 15:27:42 +01:00
Simon Backx 6a52b0ec98 Cleaned up email chart 2022-04-13 15:36:12 +02:00
Simon Backx e24125ed9d 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
Fabien 'egg' O'Carroll d2f9423fb1
Updated subscription event handling (#2332)
refs https://github.com/TryGhost/Team/issues/1302

* Tweaked the getIcon() function to better support the new event data variable for cancelled
* Added back in info for events across all activity lists

Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
2022-04-13 10:28:13 +01:00
Kevin Ansfield 541d8a1701 Added unsaved changes confirmation modals to new/edit newsletter routes
closes https://github.com/TryGhost/Team/issues/1475

- updated new+edit newsletter routes to open a confirmation modal if the form modal is closed or the route is exited
- added z-index to modal background so the layering behaves as expected when modals are stacked
2022-04-12 21:32:27 +01:00
James Morris c0f4b1bb20 Added in dark mode grid lines for charts and futher style tweaks to the new dashboard
refs: https://github.com/TryGhost/Team/issues/1462

- added in dynamic dark mode grid lines for the charts
- added in some subtle other dark mode tweaks for borders
- limited the recent posts to 3 instead of 5
2022-04-12 17:56:55 +01:00
James Morris a39641bad5 Moved the new dashboard over to a CSS Grid layout and cleaned up a ton of the code
refs: https://github.com/TryGhost/Team/issues/1507

- changed the layout over to use css grids instead of the random flex and divs
- cleaned up the based dashboard-v5 file so its rendering much cleaner components
- refactored and took out a ton of old css that wasn't needed anymore
- moved the dashboard-v5 css into it's own css file to keep things cleaner
- includes a few stylistic changes along the way
2022-04-12 16:04:20 +01:00
James Morris 426a24f9af Moved all the section and boxes to their respective Ember components to massively tidy up the new Dashboard layout
refs: https://github.com/TryGhost/Team/issues/1507
2022-04-12 16:04:20 +01:00
Kevin Ansfield 95d7e3ddf2 Updated newsletter model and form for latest schema
refs https://github.com/TryGhost/Team/issues/1500

- `senderEmail` is now nullable with a fallback to `noreply@{site domain}`
- `senderName` is not nullable and has no fallback
  - updated preview and input placeholder to match real-world behaviour
  - inserted site title as the default value when creating a new newsletter to avoid friction with the sender name needing to be filled in when saving
- switched `senderReplyTo` input field to a select with "newsletter" and "support" options
  - added basic `<Inputs::Select>` component as `<OneWaySelect>` had re-rendering issues causing loss of selected value when the label of the newsletter email changed to reflect a custom newsletter email value
2022-04-12 14:01:41 +01:00
James Morris 3a26f07379 Moved all the new Dashboard files into folders to help with organisation a bit more
refs: https://github.com/TryGhost/Team/issues/1506
2022-04-12 13:09:00 +01:00
James Morris 9de523e742 Moving back the metrics to under the main graph and adding paid breakdown graph to dropdown based on feedback
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-12 11:53:51 +01:00
James Morris ae6c0c3fae More layout tweaks to new dashboard
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-12 11:53:51 +01:00
James Morris 491faa861c Moving the new dashboard layout forward with more ideas
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-12 11:53:51 +01:00
Daniel Lockyer 3a7049948f v4.43.1 2022-04-11 12:16:37 +01:00
Daniel Lockyer 7fda97a0d4 v4.43.0 2022-04-08 16:00:32 +01:00
Simon Backx 8603aeade0 Improved mocked state generator for dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1489

- Apart from newer sites (state with days < 30) the MRR will start to deviate from the paid members graph. This will normally also be the case for real sites.
- All graphs will be zeroed out if state 'no data' is selected.
- The generator is a bit too complex to make this happen. It was some trial and error, but doesn't matter that much since we'll nuke this code once 5.0 is out.
2022-04-08 11:26:59 +02:00
Simon Backx d9324f48ae 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 9c6d4e255a Fixed swapped paid members and MRR chart in anchor chart
no issue

When selecting 'paid members', the MRR chart was shown and vice versa.
2022-04-08 09:54:29 +02:00
Simon Backx 26a760834f 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
Kevin Ansfield 43e7ef7fb4 Fixed moving border when hovering default newsletter
no issue

- when displaying only the default newsletter there's no option to drag/re-order but the border was still moving on hover as it does when displaying the drag handle
- updated the class name to take `displayingDefault` into account when adding the draggable class
2022-04-07 17:04:08 +01:00
Kevin Ansfield 72f8792b75 Added drag-and-drop sorting of newsletters
closes https://github.com/TryGhost/Team/issues/1483

- updated newsletters list to use `<SortableObjects>` and `<DraggableObject>`
- swapped the `filteredNewsletters` reactive getter for a tracked property because `<SortableObjects>` replaces the value with a new array when re-ordering which isn't compatible with a getter
  - required explicit update of the list any time the list should change through filter swap, archive, unarchive
  - required explicit update of the list via router event when leaving the "new newsletter" route so any newly added newsletter can be displayed
- added action for handling update of `sort_order` properties when a re-order occurs
  - updates every newsletter setting `sort_order` of the active newsletters first based on the new order, followed by all archived newsletters following their existing order
- disabled sorting of newsletters in the archived newsletters list
  - hides the grab handle and disables the resize on hover
  - allowing re-order of archived newsletters would complicate the re-order+save algorithm and re-ordering archived newsletters doesn't have a use-case
2022-04-07 16:42:50 +01:00
Simon Backx dea1073640 Added staff picks component to dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1487

- Fetches the staff picks from the RSS feed
- Shows the first 5 staff picks (amount is adjustable)
- Adds utm_source=ghost to external links
- Includes a temporary CSS class to keep it a bit orderly
2022-04-07 15:24:50 +02:00
Kevin Ansfield 16e1fce344 Updated newsletter model - removed `default` and added `slug`
refs https://github.com/TryGhost/Ghost/pull/14428
refs https://github.com/TryGhost/Ghost/pull/14436

- `default` is now represented by the first newsletter when ordered by `sort_order`
- `slug` has been added to match pattern for all resources used in filter queries to have a slug
  - no current use-case so it's not exposed in the UI
2022-04-07 13:50:16 +01:00
Simon Backx d29aa4eb3c Added latest newsletters to dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1488

- Includes a new component that fetches the latest X newsletters.
- Displays these newsletters using design from old dashboard.
- Currently shows 10 newsletters, but we'll want to change that later.
- Temporary CSS class added.
2022-04-07 13:02:58 +02:00
Simon Backx 121b422e41 Fixed loading of paid mix chart
no issue

Moved did-insert to native DOM element.
2022-04-07 10:34:21 +02:00
Kevin Ansfield 272202f89d Reset warning threshold dates on linter errors
refs https://github.com/TryGhost/Ghost/issues/14101

- the Octane-related codemods have not been fully completed yet meaning the linter error list is still too large to effectively manage piecemeal
- reset the `.lint-todo` file to add another 30 days before the warnings show up when running `yarn lint:hbs`
2022-04-06 19:41:12 +01:00
James Morris 1dccc163e4
The big cleanup (#2328)
* Trying out a tooltip alternative for combined graph in new dashboard

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

* Trying out a different type of interaction with the combined graph for the new dashboard that includes different style

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

* Working through the interface and code to majorly clean up for the new Dashboard

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

- lots of moving around css
- trying out some different layouts
- refactoring lots of code
- known bug: paid graphs don't work
- known bug: without newsletters, layout breaks

* Finishing up the basic styling of the new dashboard to be more presentable

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

- add an animation between the top metrics on combined graph
- ensure all graphs are responsive to parent container
- refactor many of the components and tidy up the styles
- tighten up spacing, headers, chart heights and more
- make the tooltip hovers a little more presentable
- balance the colors to be more muted, for the moment
- a million other tiny tweaks
2022-04-06 18:11:46 +01:00
Simon Backx ac0f694745 Added Whats New component to Dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1486

Includes a new component that correctly fetches the changelog and displays them in the old format (still requires some design changes).
2022-04-06 15:43:41 +02:00
Kevin Ansfield b517f7a51b Wired up active/archived newsletter filter
closes https://github.com/TryGhost/Team/issues/1476

- added dropdown for switching between active and archived newsletters
- modified the "default" newsletter display so it's only activated when a single active newsletter is shown
- added ability to un-archive a newsletter with a switch between "archive" and "un-archive" actions based on newsletter status
  - if all archived newsletters are un-archived, automatically switches to "active" filter so you're not left with an empty list
2022-04-06 13:18:07 +01:00
Kevin Ansfield 5a1430f96f Added newsletter dropdown to publish menu
closes https://github.com/TryGhost/Team/issues/1479

- updated post adapter to append `?newsletter_id=xyz` when passed a `newsletterId` adapterOption
- updated editor save task to pass `options.newsletterId` through as `adapterOptions.newsletterId`
- set up `post.newsletter` relationship ready for handling embedded newsletter association from the API
  - explicitly deleted when serializing back to the API as it doesn't yet ignore the attribute
- updated `<GhPublishmenu>` for newsletter support
  - fetches newsletters on first render so they are available in the dropdown
  - sets "default" (first in the ordered list) newsletter as the initially selected newsletter
  - adds newsletter dropdown to draft publish menu
  - passes `newsletterId` option to editor save task when it's set

This is a minimal implementation for testing. Not included:
- correct free/paid member counts based on selected newsletter
- correct member count in confirmation modal
- indication of selected newsletter for scheduled post
2022-04-06 10:22:06 +01:00
Naz a7a1b9db1d Reverted Accept-Version header usage in Admin API communication
closes https://github.com/TryGhost/Toolbox/issues/222
refs https://github.com/TryGhost/Toolbox/issues/227
refs 8fe1eecc27
refs 2550b91675

- The usecases for the Accept-Version header have shown we should not be exposing the users of the clients we control to unnecessary notification about client-API incompatibility. Ghost-Admin is one of those clients that is always expected to be up to date with the version of Ghost it ships with, so the Accept-Version header should not be used here
2022-04-06 10:12:09 +08:00
Daniel Lockyer 5ade50139c
Added `5.0` branch to CI trigger
refs https://github.com/TryGhost/Toolbox/issues/273

- ahead of v5, we need to branch off and run CI on the development
  branch
2022-04-05 09:28:12 +01:00
Kevin Ansfield 1b7769b5d0 Wired up newsletter management with real newsletter model and API
refs https://github.com/TryGhost/Team/issues/1441

- switched "leave settings" confirmation modal on members email settings screen over to modern modal pattern
- removed unused `showEmailDesignSettings` property and `closeEmailDesignSettings()` action on `<Settings::MembersEmailLabs>` component
  - the used property and action live on the controller, looks like it was a copy/paste hangover when functionality was moved to a component
- added newsletter model
  - includes design-related attributes which are not yet supported by the API but are due to be added
  - includes `default` attribute but there is no setting for it, due to be removed from the API but it's needed for save not to error for now
  - set up basic mirage model and endpoints
  - added validation for main settings to match API validation
- added `EditNewsletter` modal
  - separate tabs for general newsletter settings and design-related settings
  - used for both creating and editing newsletters
- added `/settings/members-email/newsletters/new` and `/settings/members-email/newsletters/:id` routes
  - both display the `EditNewsletter` modal on top of the members-email settings screen with the appropriate newsletter model
- updated `<Settings::MembersEmailLabs::NewsletterManagement>` component to work with real newsletter model instances and the new add/edit routes
- removed now-unused `newsletter` service that was providing mocked data for earlier design iteration
2022-04-04 19:30:52 +01:00
Daniel Lockyer 0746ee5972
Merged v4.42.1 into main
v4.42.1
2022-04-04 10:40:22 +01:00
Daniel Lockyer ef66ef1403 v4.42.1 2022-04-04 10:39:50 +01:00
Kevin Ansfield 53cc89ec80
🐛 Fixed incorrect modal heights
closes https://github.com/TryGhost/Ghost/issues/14416
refs ab2fcc39fe

- after switching to a proper package version of our `ember-promise-modals` fork the addon's CSS was injected into the vendor file causing conflicts with our own modal styling
- added `align-items: unset` style override on `.epm-modal-container` so we're not fighting the addon's default `align-items: center;` style
2022-04-04 10:27:40 +01:00
Kevin Ansfield 839025c3d5
🐛 Fixed incorrect modal and theme preview positioning
closes https://github.com/TryGhost/Ghost/issues/14415

- after switching to a proper package version of our `ember-promise-modals` fork the addon's CSS was injected into the vendor file causing conflicts with our own modal styling
- added `transform: none` style override on `.epm-modal` so we're not fighting the addon's default `translate(0, -30vh) scale(1.1);` transform
2022-04-04 10:27:30 +01:00
Kevin Ansfield 3333b44865 🐛 Fixed incorrect modal heights
closes https://github.com/TryGhost/Ghost/issues/14416
refs ab2fcc39fe

- after switching to a proper package version of our `ember-promise-modals` fork the addon's CSS was injected into the vendor file causing conflicts with our own modal styling
- added `align-items: unset` style override on `.epm-modal-container` so we're not fighting the addon's default `align-items: center;` style
2022-04-04 09:55:33 +01:00
Kevin Ansfield ab2fcc39fe 🐛 Fixed incorrect modal and theme preview positioning
closes https://github.com/TryGhost/Ghost/issues/14415

- after switching to a proper package version of our `ember-promise-modals` fork the addon's CSS was injected into the vendor file causing conflicts with our own modal styling
- added `transform: none` style override on `.epm-modal` so we're not fighting the addon's default `translate(0, -30vh) scale(1.1);` transform
2022-04-04 09:43:54 +01:00
Kevin Ansfield 73101da176 Extracted newsletter management section into separate component
refs https://github.com/TryGhost/Team/issues/1441

- pulls newsletter-related functionality into one place to keep higher-level components from knowing about too many concepts and becoming bloated
- updated temporary newsletters service to have fully tracked objects so the `active/archivedNewsletters` properties can be closer to how they will work with full models
2022-04-03 22:14:07 +01:00
Kevin Ansfield 7e4320974f Converted <Settings::MembersEmailLabs> to Glimmer component
refs https://github.com/TryGhost/Team/issues/1441

- bringing code up to more modern style ready for further development
2022-04-03 22:14:07 +01:00
James Morris 33277f56f7 Added little copy tweak to engagement charts to be clearer
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-01 17:09:17 +01:00
James Morris 4290f669cf Further tweaks to the new dashboard to make it feel a little nicer
refs: https://github.com/TryGhost/Team/issues/1462
2022-04-01 17:04:39 +01:00
Daniel Lockyer d3c9862878 v4.42.0 2022-04-01 16:00:40 +01:00
James Morris 9a35f60b40
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