refs 2fb62708a8
- use modal's own `.epm-out` class that's added when closing to trigger the reverse of the fade-in animation
- added `.publish-modal` class to the three publish modals so we can alter the default modal animations/timing if required
no issue
- updated the publish/preview toggle action to pass a `skipAnimation` data attribute to the modals when opening if they are being swapped rather than initially opened
no issue
- "subscriber" makes more sense than "member" in the default-only newsletter state because members still need to be subscribed to the default newsletter
- removed all subscriber/member conditionals and cleaned up template logic where possible
no issue
- adds `{{get-setting "key"}}` helper to make settings available in templates without needing a backing class
- updated `<GhPostBookmark>` component
- if post feature image isn't present, fall back to site cover image
- add site icon (if present) and title to the details line
- removed author image
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
refs https://github.com/TryGhost/Team/issues/1634
- member count on newsletter may not be immediately updated on saving newsletter
- api returns `opted_in_member_count` in response to adding newsletter which admin cannot use atm
- re-fetches newsletters on save so all newsletters get updated member and post counts
no issue
- authors/editors don't yet have a way to fetch member counts for specific filters so the final member count is hidden in the publish options text, however we were still showing the total subscribed members for each newsletter in the dropdown which could lead to incorrect assumptions for how many members would receive the newsletter
refs https://github.com/TryGhost/Team/issues/1477
- Added default test fixture
- Added tests for validation of newsletter when editing
- Added tests for opening and closing tabs
refs 89f089e439
- if "Free" or "Paid" had already been output we were still capitalising "Subscribers" ending up with "Free Subscribers" instead of "Free subscribers"
- adjusted the capitalisation conditionals so we don't capitalize "subscriber(s)" if we've already output the recipient type
no issue
- `{{format-number}}` was showing "0" when passed in an empty/nullish string when it should have been showing nothing
- used `{{if-empty}}` to fix capitalisation when the member count is missing
- previously attempted a CSS-only fix with `:first-letter` and `text-transform: uppercase` but that broke the layout in Safari
refs https://github.com/TryGhost/Team/issues/1575
- Update usage of Tier to read monthly & yearly price & currency from top level
- Updated usage of Tier to read benefit name from benefits[n], not from benefits[n].name
Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
no issue
- updated `<PublishManagement>` and sub-components to handle contributors by replacing publish button with save button in main view and in preview
- removed feature flag gating and usage of `<GhPublishmenu>` in editor template
- updated tests that indirectly used the old publish menu so they work with the new design/behaviour
- skipped editor tests that used the old publish menu
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
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
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
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
closes https://github.com/TryGhost/Team/issues/1622
- we were setting selected hour/minute on a supposedly site-timezone date before converting to UTC but we were using a local timezone date instead meaning the conversion to UTC didn't match resulting in the time being altered incorrectly after the time input loses focus
no issue
- show the newsletter a post was/will be sent to if there's more than just the default newsletter or the newsletter that was emailed is now archived
refs https://github.com/TryGhost/Team/issues/1621
- copied existing preview modal over to `editor-labs/modals` directory
- old modal will be deleted in cleanup
- moved "Preview" button from editor template to the `<PublishManagement>` component
- allows for preview modal to be controlled alongside the publish flow modal
- added `togglePreviewPublish()` action to `<PublishManagement>`
- opens whichever of preview/publish is not currently open, this opens the new modal on top of the old modal
- waits for the modal animation duration to pass then closes the modal that's now underneath, this prevents the flashing that occurs when modals are both opening and closing at the same time because that results in a 50% opacity of both modals during the middle of the animation
- updated preview modal and publish-flow modals to have "Publish" and "Preview" buttons respectively that call the `togglePreviewPublish` action
- updated preview modal to be fullscreen to better match the publish modal
refs https://github.com/TryGhost/Team/issues/1621
- the old publish menu will be fully deleted soon
- removing it from the preview modal is the minimal "fix" for interoperability with the new publish flow
- pre-cursor to tighter preview/publish modal integration
no issue
Only Admins/Owners can browse members to get member counts but Editors/Authors are allowed to send email. This means we need to account for the count figures being missing.
- added guard to the total member count fetch in `PublishOptions`
- guard needed because the failed API request would abort setup
- when the current user isn't an admin, set the total member count to 1 to avoid email options being disabled
- added guard in the `{{members-count-fetcher}}` resource so we're not triggering API errors and the count is kept as `null` so it's handled automatically if passed to `{{gh-pluralize}}`
- updated `<GhMembersRecipientSelect>` to not show counts (or the surrounding `()`) when the count is `null`
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>
no issue
- `PublishOptions` was exported from the `<EditorLabs::PublishManagement>` component as a convenience when development started but both have now grown in size and are easier to read as separate files
closes https://github.com/TryGhost/Team/issues/1584
refs https://github.com/TryGhost/Team/issues/1605
- added email limit check to PublishOptions setup
- moved email disabled messaging from the email recipients option to the publish type option
- it was confusing to have the email publish type options disabled without any indication of why, with the message hidden within the closed email recipients option