Commit Graph

2278 Commits

Author SHA1 Message Date
Simon Backx
552800bde7 Fixed dashboard recent posts not showing email only posts
refs https://ghost.slack.com/archives/C02G9E68C/p1652982196273769
2022-05-20 09:34:25 +02:00
Kevin Ansfield
7a5f15414b Fixed scheduled publishedAt validation being triggered unexpectedly
no issue

Problem:
- the server stores time with second-level precision but we send milliseconds
- when scheduling a post we were storing the selected publish-at time in the PublishOptions instance with non-zero milliseconds as the initial date was based on now+5mins
- when we were saving after the initial schedule that millisecond-containing time was still being used resulting in a perceived time difference in our client-side and server-side validations indicating that the published_at value should be updated, but when that time was <2 mins in the future the published_at change validation was triggered resulting in errors

Solution:
- ensure we only set times on PublishOptions with 0 milliseconds
- update client-side validations so we only trigger published_at validation when it's dirty

Also fixed:
- client-side validation errors were not shown on the confirm step due to a missing `.args`
2022-05-19 23:11:01 +01:00
Kevin Ansfield
802a3c6187 Skipped animation when switching between preview modal tabs
refs 2c9998be69

- animation should only show when opening the preview modal directly from the editor
2022-05-19 13:33:23 +01:00
Sanne de Vries
2c9998be69 Added animation to post preview modes and publish button
No ref
2022-05-19 14:13:12 +02:00
Sanne de Vries
2941065eb7 Added back button to completed publishing flow
No ref
2022-05-19 13:39:40 +02:00
Kevin Ansfield
b03aa5f255 Added reverse animation to publish/preview modal contents when closing modal
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
2022-05-19 12:19:55 +01:00
Kevin Ansfield
08aa2d91ba Skipped publish flow modal animations when swapping between publish/preview
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
2022-05-19 12:02:23 +01:00
Djordje Vlaisavljevic
5d0e3d2536 Fixed icon color in dark mode 2022-05-19 13:01:26 +02:00
Kevin Ansfield
dce531cf1c Standardized on "subscriber" for default & multiple newsletters in publish flow
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
2022-05-19 11:37:01 +01:00
Sanne de Vries
2fb62708a8 Added fade-in effect when opening publish and preview modals in editor
No ref
2022-05-19 11:58:51 +02:00
Simon Backx
f9cd8b1f66 Removed zero tiers from paid mix charts (unless all zero)
no issue

When the last tier in the paid mix chart is zero, the border radius is broken.
2022-05-19 11:41:54 +02:00
Kevin Ansfield
0549ffd4b5 Removed unused component argument with typo
no issue

- spotted the typo and thought there was a bug somewhere but post count isn't used in the complete-with-email-error state of the publish flow
2022-05-19 10:25:05 +01:00
Sanne de Vries
e09f41716b Fixed subscriber count not showing for scheduled email-only posts
No ref
2022-05-19 11:23:50 +02:00
Sanne de Vries
df15dcb8d5 Added confirmation message to email-only post being sent
No ref
2022-05-19 10:54:44 +02:00
Sanne de Vries
8468994014 Added spinner icon to running publish button
No ref
2022-05-18 20:48:36 +02:00
Sanne de Vries
2835d0a6a4 Fixed publish button pulsating when running
No ref
2022-05-18 20:32:10 +02:00
Kevin Ansfield
473831ac2b Added image fallback and site icon/title to <GhPostBookmark> (#2401)
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>
2022-05-18 19:05:27 +01:00
Kevin Ansfield
f2b9fa544f Fixed published post count shown on publish complete step
no issue

- API query was using `?status=published` instead of `?filter=status:published` so was counting all posts rather than just published ones
2022-05-18 18:01:28 +01:00
Simon Backx
fdece55480 Added auto save to newsletters toggle
refs https://github.com/TryGhost/Team/issues/1639

- When enabling/disabling newsletters, the change is saved automatically
2022-05-18 17:26:03 +02:00
Rishabh Garg
1dc3026aba Fixed subscribe count on adding new newsletter (#2402)
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
2022-05-18 20:44:42 +05:30
Simon Backx
857a8e5ae0 Added tests for unsaved newsletter changes
refs https://github.com/TryGhost/Team/issues/1477
2022-05-18 15:57:02 +02:00
Sanne de Vries
02a3f4d784 Changed running and success copy for publish button when scheduled
No ref
2022-05-18 15:14:43 +02:00
Simon Backx
d87aef7e0a Removed some multipleNewslettersUI feature checks 2022-05-18 15:00:29 +02:00
Kevin Ansfield
6c960704b9 Hid total member counts in newsletter selection for authors/editors
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
2022-05-18 13:58:25 +01:00
Simon Backx
59a1b8a31f Added tests for editing newsletters
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
2022-05-18 13:14:38 +02:00
Kevin Ansfield
a6dcd936bc Hooked up "revert to draft" button on complete step after scheduling
refs a19d5c7df3

- added handling of the `afterTask` return value provided when closing the publish flow modal via the revert-to-draft button
2022-05-18 10:49:08 +01:00
Kevin Ansfield
ea98469e6e Cleaned up improvedOnboarding labs flag
no issue

- the feature has been GA for a while now so the conditionals are no longer required
2022-05-18 10:13:06 +01:00
Kevin Ansfield
07fde0ee48 Fixed double capitalisation in publish options recipients text
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
2022-05-18 10:00:18 +01:00
Kevin Ansfield
89f089e439 Fixed incorrect member count and capitalisation in publish options for editors/authors
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
2022-05-18 09:42:44 +01:00
Djordje Vlaisavljevic
a19d5c7df3 Added static unschedule-and-revert button 2022-05-17 17:49:13 +02:00
Djordje Vlaisavljevic
a021553203 Updated button label logic to match different states 2022-05-17 17:49:13 +02:00
James Morris
bcef562206 Moved all the dropdowns to be right aligned on the new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531
2022-05-17 15:04:55 +01:00
James Morris
b2a6c01cdf Working out the Safari layout issue when changing dropdowns on new Dashboard
refs: https://github.com/TryGhost/Team/issues/1531
2022-05-17 14:44:19 +01:00
Peter Zimon
980f45719d Fixed sent email preview alignment bug 2022-05-17 15:20:58 +02:00
James Morris
1d25f6d494 Added in additional check for avatar which will depend on where the data source comes from
refs: https://github.com/TryGhost/Team/issues/1531
2022-05-17 11:18:44 +01:00
Peter Zimon
da9a2c6b8a Added curve to line charts 2022-05-17 11:45:18 +02:00
Peter Zimon
a9da3b13fc Updated anchor chart background color 2022-05-17 11:41:11 +02:00
Simon Backx
8502ebb96a Moving over the new Dashboard to replace the old (#2389)
refs: https://github.com/TryGhost/Team/issues/1631

Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
2022-05-17 09:34:34 +02:00
Rishabh Garg
8b5b3aa734 Updated usage of the Tiers API (#2388)
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>
2022-05-16 19:51:49 +01:00
Kevin Ansfield
77484210ee Cleaned up old publish menu code
no issue

- the new publishing flow is GA making the old publish menu unused
- removed all related code
2022-05-16 18:07:53 +01:00
Simon Backx
eee3a9aa90 🔥 Removed multipleProducts, tierWelcomePages, and tierName flags
refs https://github.com/TryGhost/Team/issues/1616
2022-05-16 17:25:03 +02:00
Sanne de Vries
5a6066d064 Fixed publishing flow responsive issues
No ref
2022-05-16 16:13:24 +02:00
Kevin Ansfield
3b088cbd77 Removed usage of old publish menu for contributors
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
2022-05-16 14:18:04 +01:00
Sanne de Vries
025fe3e6ae Fixed editor dark-mode issues
No ref
2022-05-16 13:50:58 +02:00
Kevin Ansfield
5415fb6e01 Updated post email preview to render with the selected newsletter (#2382)
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
2022-05-16 12:16:12 +01:00
Kevin Ansfield
de2d3977ed Fixed Cmd+P shortcut not toggling preview in new publish flow
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
2022-05-16 09:39:33 +01:00
Simon Backx
3a11faf0b6 Updated publishing with renamed newsletter and email_segment options (#2380)
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.
2022-05-16 10:18:46 +02:00
Sanne de Vries
3e8c5403b6 Updated error message for published post with failed email sending
Refs https://github.com/TryGhost/Team/issues/1587
2022-05-16 10:09:42 +02:00
Kevin Ansfield
150f4fda2d Remember post preview tab when switching between preview/publish
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
2022-05-13 17:43:34 +01:00
Sanne de Vries
d3e188fb3a Updated email and social post previews
Refs https://github.com/TryGhost/Team/issues/1621
2022-05-13 15:36:56 +01:00