Commit Graph

9255 Commits

Author SHA1 Message Date
Simon Backx
26e441d88d Updated members recipient selector counts
refs https://github.com/TryGhost/Team/issues/1576
refs https://github.com/TryGhost/Team/issues/1592

Improved code to use the members count fetcher in the recipient selector.
2022-05-05 18:09:41 +02:00
Simon Backx
a103184c6a Updated newsletter recipientFilter to use slugs instead of instead
refs https://github.com/TryGhost/Team/issues/1576
refs https://ghost.slack.com/archives/C02G9E68C/p1651763933403669?thread_ts=1651763878.116549&cid=C02G9E68C
2022-05-05 17:37:34 +02:00
Simon Backx
1f5f9645e6 Updated members count to use selected newsletter when publishing
refs https://github.com/TryGhost/Team/issues/1576

- Passes the selected newsletter to the recipient selector
- Added a `recipientFilter` getter to the newsletter model to make changes easier in the future
- Updates the `fullRecipientFilter` in the new publishing flow to use the newsletter's recipientFilter
- Already takes future paid only newsletters into account
- The counts in the status message after publishing is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
- The counts in the scheduled notification is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
2022-05-05 17:17:23 +02:00
Kevin Ansfield
03ba0da1a7 Fixed email wording showing on update-flow incorrectly
refs 8fb0d6ebb2

- logic for showing the "sent to x" wording on the published update flow was incorrect meaning it was showing for published posts/pages when nothing had been emailed
2022-05-05 16:08:45 +01:00
Kevin Ansfield
c6fdfab454 Fixed post/page wording on "View published x on site" button 2022-05-05 16:05:20 +01:00
Kevin Ansfield
8fb0d6ebb2 Added scheduled and published states to new publish flow
closes https://github.com/TryGhost/Team/issues/1589
closes https://github.com/TryGhost/Team/issues/1590

When a post is already scheduled or published the "Publish" button changes to "Update" and when clicked shows details about the last publish / upcoming schedule along with buttons to save any changes or revert to a draft.

- added separate `update-flow` modal with the save/revert options to keep the main `publish-flow` cleaner and focused just on the draft->publish flow
2022-05-05 16:02:58 +01:00
James Morris
27cb5a9fec More responsive tweaks so new Dashboard works on mobile
refs: https://github.com/TryGhost/Team/issues/1531

- better resource breakpoints at mobile widths
- also fixed the active mobile button in mobile as it was white in dark mode
2022-05-05 15:53:49 +01:00
James Morris
0fda84d71e Added in a more responsive new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531

- any triple column collapses down to one and sits underneath each other
- the mini charts' legends disappear and they also then go full width underneath each other
- the resources module loses it's thumbnail at smaller widths
- the 2/3 resources column goes to 1/2
- everything worth having has truncation that is only seen at very small sizes
2022-05-05 15:16:03 +01:00
Sanne de Vries
a01ae97801 Updated confirmation and completed pages of publishing flow
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-05 14:26:06 +01:00
Simon Backx
19249bdae5 Renamed members-email-labs to newsletters and removed unused files
no issue

We still had some old components and templates from the `members-email` settings that were only were used when the (now GA) `multipleNewsletters` flag was disabled. I’ve removed them and renamed all routes and components from `members-email` and `members-email-labs` to just `newsletters` because it was sometimes hard to understand if a given components was still used or not when fixing issues.
2022-05-05 13:37:53 +02:00
Kevin Ansfield
67505f838c Added first pass of recipient options to new publish flow
closes https://github.com/TryGhost/Team/issues/1585

- adds newsletter select, free/paid checkboxes, and specific label select to the email recipients area in publish flow
- updated `PublishOptions`
  - `willEmail` getter now takes into account the recipient filter so when free+paid+specific are all unchecked the flow corresponds to email not being sent
  - save task passes through the real recipient filter
  - added `fullRecipientFilter` for use in count fetchers so the selected newsletter is taken into account whilst we use `recipientFilter` as the main filter value
- fixed issues with dropdowns being cut off
  - `{{liquid-if}}` uses `overflow: hidden` to make it's animation work, this means any popups that are larger than the expanded option size are cut off
  - switched away from rendering the selects inline so they aren't limited by parent container size
  - fixed `z-index` issues to they appear on top of the modal
2022-05-05 11:18:49 +01:00
Kevin Ansfield
7c4674507e Switched members-count-fetcher to use members-count-cache
no issue

In the new publish flow we use `{{members-count-fetcher}}` to show member counts as needed in the template without needing to worry about manually fetching counts in the backing classes. However, when switching between states in the flow the count would be re-requested resulting in some glitchy looking async count rendering. By changing `{{members-count-fetcher}}` to use our `members-count-cache` service internally we reduce the likelihood of an async count being triggered when switching between publish flow states.

- updated `members-count-cache` service methods to work with filter strings or full query objects
- switched `members-count-fetcher` resource to use `members-count-cache` in place of directly querying the store
2022-05-05 11:18:49 +01:00
James Morris
1fc436f3e2 Small hack fix to totals chart to keep responsiveness for new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531

- we've had to use a 99% width hack to ensure ChartJS is responsive
- this introduces a small negative margin to fix the container whilst keeping hack
2022-05-05 11:11:55 +01:00
Simon Backx
93632349b9 Fixed newsletter includes when adding or editing (#2365)
refs https://github.com/TryGhost/Team/issues/1571

- When creating a new newsletter, the counts were not loaded
- When updating a newsletter, the counts were not updated
- Requires https://github.com/TryGhost/Ghost/pull/14696
2022-05-05 11:31:45 +02:00
Fabien 'egg' O'Carroll
fe4d2aeb9c Removed usage of hasActiveStripeSubscriptions API (#2364)
refs https://github.com/TryGhost/Team/issues/1147

This endpoint is deprecated
2022-05-04 17:24:56 +01: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
James Morris
d656258273 Fixed the dark mode border for What's New and changed text case for Staff Picks
refs: https://github.com/TryGhost/Team/issues/1531
2022-05-04 16:56:54 +01:00
James Morris
516a7c3701 Recent post and member activity table updates for new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531

- added in published dates if newsletters not enabled
- also tried out a state to remove engagement if members not enabled
2022-05-04 16:45:42 +01:00
Kevin Ansfield
6a28de85b8 Fixed editor error handling
refs adeef741fb

- there's no local `error()` action, we need to use `this.send()` so the route-level error handler is triggered
2022-05-04 16:30:59 +01:00
Simon Backx
bb4b3a7eec Handled duplicate newsletter name errors correctly
refs https://github.com/TryGhost/Team/issues/1564

- Shows the error inline
- Depends on https://github.com/TryGhost/Ghost/pull/14694
2022-05-04 15:58:06 +02:00
James Morris
ae1010ea03 Adding in more hover states and cleaning up what's there
refs: https://github.com/TryGhost/Team/issues/1531

- fixed up the hover states for staff picks and what's new
- matched padding and text baseline alignment for both boxes
- added in some truncation to stop breakage
2022-05-04 14:04:49 +01:00
James Morris
692c7619ef Tweaks to recents box for new Dashboard based on feedback
refs: https://github.com/TryGhost/Team/issues/1531

- made whole row clickable
- added in hover state based on posts table style
- added in event icons for activity
- increased row spacing
- other subtle tweaks based on feedback
2022-05-04 13:29:55 +01:00
Kevin Ansfield
adeef741fb Added first iteration of saving to new publish flow
refs https://github.com/TryGhost/Team/issues/1542

- extracted before/after save routines in the editor controller into separate actions
  - allows saving to occur in the publish flow without it needing any editor-specific knowledge
  - allows for easier cleanup of email related logic from the editor save tasks later on
- added `saveTask` to `PublishOptions`
  - applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state
  - saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options
- added a `saveTask` to the `<PublishManagement>` component
  - passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen
  - runs the before/afterSave arguments passed in from the editor
  - runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails
  - polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented)
- adds "complete" state to publish flow once save has finished
  - confirms what just happened based on saved post data rather than chosen publish options
  - has a link to the view the post
2022-05-04 10:30:45 +01:00
Simon Backx
6adecb5db1 Removed newsletter name from activity feed if no multiple newsletters
refs https://github.com/TryGhost/Team/issues/1563

- Check if we have multiple newsletters in the members-events-fetcher
- Pass the resulting value to the `parse-member-event` helper
- Pass the value to the activity feed table and table-row components
2022-05-04 10:23:32 +02:00
Peter Zimon
300cd79d3e Updated Dashboard spacings 2022-05-03 17:08:30 +02:00
Peter Zimon
3996455aa1 Updated minicharts positions 2022-05-03 16:34:17 +02:00
Peter Zimon
d0a77a48ba Dashboard typography cleanup 2022-05-03 16:26:05 +02:00
Simon Backx
a3218b0a2b Improved newsletter activity feed copy
refs https://github.com/TryGhost/Team/issues/1570
refs https://ghost.slack.com/archives/C02G9E68C/p1651581277636729?thread_ts=1651569897.474819&cid=C02G9E68C

Activity feed now shows 'Subscribed to newsletter – Weekly newsletter" text
2022-05-03 14:37:45 +02:00
Simon Backx
5c6316f051 Fixed linting error 2022-05-03 14:25:50 +02:00
Simon Backx
da3b3850f5 Added the newsletter name to the activity feed
refs https://github.com/TryGhost/Team/issues/1563

- When a member (un)subscribes to a specific newsletter, we should add the name of the newsletter.
- Replaced CSS lowercase/first uppercase transform with a new HBS helper so we can maintain the caps in the newsletter names.
- Copy is still WIP, refs https://ghost.slack.com/archives/C02G9E68C/p1651569897474819
2022-05-03 14:24:18 +02: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
Peter Zimon
c2102477a7 Updated Resources design on Dashboard 2022-05-03 12:21:30 +02:00
Simon Backx
21fd205073 Fixed newsletters limited to 15 items
refs https://github.com/TryGhost/Team/issues/1565

If you had more than 15 newsletters we hit default pagination in the API and Admin didn't show any more.
2022-05-03 09:01:41 +02:00
Simon Backx
7ad8f63b22 Fixed linting errors and removed debug log 2022-05-02 10:52:27 +02:00
Simon Backx
fdf425d95a Added dynamic filter for resources
refs https://github.com/TryGhost/Team/issues/1572

- Depending on the state of the site, other resources are shown.
- Also cleaned up error catching.
2022-05-02 10:45:15 +02:00
Simon Backx
625635c6ed Added tag filter to newsletter resources module
refs https://github.com/TryGhost/Team/issues/1572

When fetching the newsletters, other resources were included. Now we filter
on the newsletter tag so we only include newsletter and not normal resources.
2022-05-02 10:22:01 +02:00
Sanne de Vries
814f9043aa Updated publish settings page
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-02 08:50:48 +01:00
James Morris
8c692b1d73 Fixed linting bugs and tweaked mini chart starting heights
refs: https://github.com/TryGhost/Team/issues/1531
2022-04-28 17:55:36 +01:00
James Morris
fcd11fe471 Fixed the resources section to pull the latest
refs: https://github.com/TryGhost/Team/issues/1531
2022-04-28 17:16:40 +01:00
Sanne de Vries
88e10f2305 Updated publish settings page
Refs https://github.com/TryGhost/Team/issues/1544
2022-04-28 16:46:58 +01:00
James Morris
059ad77939 Tons of tweaks based on feedback for new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531
2022-04-28 16:40:27 +01:00
Peter Zimon
f81801549b Updated copy for Dashboard resources 2022-04-28 17:33:26 +02:00
Peter Zimon
5c71448575 Udpated resources section on dashboard 2022-04-28 17:18:17 +02:00
Peter Zimon
3b3140a002 Updated resources section 2022-04-28 16:48:22 +02:00
Kevin Ansfield
f28320abae Added confirmation step to new publish flow
refs https://github.com/TryGhost/Team/issues/1542

- added `willPublish` and `willEmail` convenience getters to `PublishOptions`
- added confirmation step that is switched to when clicking the Continue button in the publish flow
- separated options and confirmation steps into discrete components used by the `publish-flow` modal
2022-04-28 15:36:01 +01:00
Kevin Ansfield
357bbf56cf Fixed PublishOptions newsletter setup
refs https://github.com/TryGhost/Team/issues/1542

- assigning the result of `peekAll('newsletter').filter()` to `newsletters` doesn't work because the live peekAll array gets transformed to a static array so it was always blank
  - assigned result of `peekAll('newsletter')` to `allNewsletters` and replaced `newsletters` property with a getter that uses `allNewsletters` to return an array of filtered and sorted newsletters
- fixed incorrect sort order for `defaultNewsletter`
- assigned default newsletter to tracked `newsletter` property as part of setup once newsletters have been fetched
- updated publish-flow template to show a real count and newsletter name
2022-04-28 15:36:01 +01:00
Daniel Lockyer
7ea5bdcdf8 Fixed success button state for POST ../email_previews/..
refs https://github.com/TryGhost/Toolbox/issues/308

- this endpoint is being switched to return a 204 with no body upon success
- if we don't change this code, the button will get stuck in a red Retry
  state because it reads the `undefined` body and thinks it's an error
- this commit makes sure we return true if the POST is successful
2022-04-28 15:33:10 +01:00
Daniel Lockyer
e1f05ed126 Renamed reset_all_passwords Authentication API endpoint to /global_password_reset
refs https://github.com/TryGhost/Toolbox/issues/308

- our API has a pattern of using nouns and not verbs for the endpoint
  names, so this changes the endpoint for v5
2022-04-28 15:33:09 +01:00
Daniel Lockyer
1068070bd2 Renamed passwordreset body object to password_reset
refs https://github.com/TryGhost/Toolbox/issues/308

- I've just renamed the endpoint to `password_reset` but we might as
  well change the body object to make the change in v5 too
2022-04-28 15:33:09 +01:00
Daniel Lockyer
5aa5770791 Renamed /passwordreset authentication API endpoint to /password_reset
refs https://github.com/TryGhost/Toolbox/issues/308

- we have a pattern of splitting words via an underscore in the API, so
  v5 splits apart `passwordreset` to `password_reset`
- I'll follow up whether we want to fixup the `passwordreset` body
  object
2022-04-28 15:33:09 +01:00