refs https://github.com/TryGhost/Team/issues/1621
reqs https://github.com/TryGhost/Ghost/pull/14820
We want to allow previewing emails based on the newsletter selected in the publish flow.
- passed the selected newsletter from `<PublishManagement>` through to the preview modal then through to the email preview component
- removed tracked `newsletter` property and fetching of the default newsletter in the email preview component that was in place to allow `senderName` and `senderEmail` to be used in the component
- added `newsletter` getter that uses the `post.newsletter` or the passed in selected newsletter
- updated the email preview fetching to pass `?newsletter=slug` so the email is rendered with the correct newlsetter
refs: TryGhost/Team#1625
- we want to remove backwards compatibility code for slack being a single setting
Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
no issue
- removed "cmd+p" shortcut from the main editor element
- added "cmd+p" shortcut to `<PublishManagement>`
- toggles the preview modal on/off
- closes the publish modal if it's open when switching to the preview modal so we don't end up with both modals open simultaneously
- fixed "Preview" button not showing up for contributors
- this still uses the old preview modal for now
- contributor preview/save should be handled inside the new publish flow later on
refs https://github.com/TryGhost/Team/issues/1596
This commit updates admin to align with the changes in the backend in https://github.com/TryGhost/Ghost/pull/14798
- `post.email_recipient_filter` option and property is renamed to `email_segment`
- `newsletter_id` option is renamed to `newsletter` (and now uses slug instead of id)
- Sending a post via email, means you need to set the `newsletter` option. The `email_segment` option is optional now and defaults to `all`. Not setting `newsletter` means not sending an email, setting `email_segment` is ignored if `newsletter` is missing.
- We can no longer use `email_recipient_filter` (now renamed to `email_segment`) to know whether a post is published/scheduled to be sent as an email. We need to rely on the newsletter relation now. The `email_segment` `none` value has been dropped and will be `all` even if no email will be sent (newsletter will be null).
- `sendEmailWhenPublished` option is no longer supported in the backend.
refs https://github.com/TryGhost/Team/issues/1621
- added `currentTab` and `changeTab()` data arguments to preview modal allowing for the current tab to be remembered across opens in the `<PublishManagement>` component that controls open/close of the preview modal
no issue
- the `post.willEmail` computed property was not taking into account an existing email so when re-scheduling the publish of a post that had previously been emailed the complete step showed "will be published and sent" rather than the correct "will be published"
refs https://github.com/TryGhost/Team/issues/1587
- if post creation succeeds but the email fails to send we want to show a separate state of the publish flow rather than adding an error to the confirm step
- confirm _has_ completed so showing the error there doesn't make sense and causes confusing copy
- added check for email failure to the `<PublishFlow>` save task (which is called by the confirm step) to intercept any email failure errors and switch state
no issue
- CI keeps failing on this test because Firefox is being slow and hitting the 15sec timeout
- skipped for now as it's testing an old flow that no longer exists and the test will be replaced with an updated version soon
refs: https://github.com/TryGhost/Toolbox/issues/327
requires: TryGhost/Ghost#14791
- lang / locale has had a lot of churn, but we decided this setting should always be locale
- Removed test relating to unused editor_is_launch_complete setting
Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
no issue
- it was possible to enter invalid times when scheduling in the publish flow, in which case the underlying schedule date was not updated but the input still showed the invalid time
- added passthrough of the blur event in `<GhDateTimePicker>` to the `setTime` action so we have access to the input field, then updated the `setTime` action to set the time input value back to the currently set schedule time when an invalid time is entered so the UI matches the actually set value
no issue
- `publishOptions.willEmail` doesn't work for the conditional because it will be false when no email will be sent, which is the case when a recipient filter is the equivalent of "none"
- switched to being conditional on the publish type and added a separate "Not sent to any members" conditional for `recipientFilter` being blank so we're not showing an incorrect count of members
no issue
- there are no restrictions on Editor/Author emailing on the API side
- removed `user.canEmail` computed property as it's only contributors that don't have publish/email permissions and they aren't shown the publishing flow anyway
no issue
- used CSS rather than `{{capitalize}}` to avoid multiple conditionals for something that's edge-case and will eventually disappear once member counts are available to all roles that can send email