Commit Graph

70 Commits

Author SHA1 Message Date
Sanne de Vries
4795343cdb Updated newsletter count in newsletter selection dropdown
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-12 15:03:17 +01:00
Sanne de Vries
07628be22b Fixed alignment of preview modes in editor
Refs https://github.com/TryGhost/Team/issues/1621
2022-05-12 14:43:21 +01:00
Sanne de Vries
6f498035ea Updated post preview navigation
Refs https://github.com/TryGhost/Team/issues/1621
2022-05-12 14:27:06 +01:00
Kevin Ansfield
f137aaea5c Added auto-reset of time input if invalid time was entered
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
2022-05-12 14:23:56 +01:00
Sanne de Vries
288ba328d7 Updated navigation between editor, publish, preview and update states
Refs https://github.com/TryGhost/Team/issues/1621
2022-05-12 14:03:21 +01:00
Kevin Ansfield
2e6b219030 Fixed recipient select becoming disabled when all filters are turned off
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
2022-05-12 13:21:57 +01:00
Sanne de Vries
f6b06ef9bf Updated email recipient filter design
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-12 12:56:43 +01:00
Kevin Ansfield
dd551acf91 Fixed schedule time changing after setting if local and site tz don't match
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
2022-05-12 12:13:06 +01:00
Sanne de Vries
513c8655e4 Updated error and info boxes in publishing flow
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-12 11:47:49 +01:00
Kevin Ansfield
cc8dd9dedf Added newsletter name to publish update flow copy
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
2022-05-12 11:44:10 +01:00
Sanne de Vries
af55c71a9e Updated publishing flow copy
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-12 11:14:45 +01:00
Kevin Ansfield
cf8b372fed Added fullscreen preview with toggle to publish flow
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
2022-05-11 23:46:01 +01:00
Kevin Ansfield
e852c29699 Extracted PublishOptions class into separate file
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
2022-05-11 17:51:53 +01:00
Kevin Ansfield
bea1ffe665 Updated copy for recipients option when post has already been emailed
refs https://github.com/TryGhost/Team/issues/1605

- added number and type of members/subscribers the post has been sent to
2022-05-11 17:45:22 +01:00
Sanne de Vries
221d520d11 Updated copy for published and scheduled posts
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-11 17:09:22 +01:00
Kevin Ansfield
1c2ae5348d Fixed forced-error for email limit
refs f559170a39

- hangover from testing
2022-05-11 17:02:23 +01:00
Kevin Ansfield
f559170a39 Added email limit checks and email disabled messaging to publish flow
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
2022-05-11 17:00:30 +01:00
Sanne de Vries
dc14b9943f Updated publishing flow copy
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-11 16:04:42 +01:00
Kevin Ansfield
37aec66e83 Fixed linter error 2022-05-11 12:56:19 +01:00
Kevin Ansfield
627b6f259a Added error handling to publish flow confirm step
closes https://github.com/TryGhost/Team/issues/1555
closes https://github.com/TryGhost/Team/issues/1588

- added task to the confirm component's backing class so it can be wrapped in step-specific error handling
- added display of general/email error message above the confirm button
- fixed error state of the confirm button showing as green and having incorrect spacing due to the icon being hidden in CSS rather than not displayed
2022-05-11 12:48:31 +01:00
Kevin Ansfield
e87e564462 Fixed published posts count in publish flow
no issue

- the count fetch was including all posts rather than just published ones so it never matched the expected count
2022-05-11 10:37:32 +01:00
Kevin Ansfield
ebcf4c7c16 Added member count to publish flow newsletter dropdown
no issue

- it's useful to see an indication of how many overall members are subscribed to each newsletter when selecting which newsletter to send to
- added `?include=count.members` to the newsletter fetch query so the counts are available to show in the dropdown
2022-05-11 10:24:55 +01:00
Kevin Ansfield
28919eb057 Fixed "Already sent" showing in publish options when email disabled in settings
refs 46f01c2d8f

- if you had previously had emails enabled and you had sent a post as an email, when disabling members/emails all email related UI was hidden except for the "Already sent as email" message when publishing which was confusing as there is no other indication anywhere about emails and no way to view it
- added `emailDisabledInSettings` getter to PublishOptions
  - used in `emailUnavailable` getter in place of a duplicate read of the settings
  - used in the `<PublishFlow::Options>` component to conditionally hide the "Already sent" message
2022-05-11 09:43:55 +01:00
Kevin Ansfield
46f01c2d8f Removed email publish options when email is disabled, added message if already emailed
no issue

- when email is unavailable (members/email disabled, already emailed, publishing a page) don't show any email options in the publish flow so there's no confusion and a cleaner options list
- if a post has already been emailed indicate that with a "Already sent as email" when only one newsletter exists or "Already sent to {newlsetter name}" when multiple exist
2022-05-11 09:33:32 +01:00
Kevin Ansfield
8652f16005 Fixed publish confirmation button text
no issue

- the button text would still say "Publish & send" when no members were selected
- changed from comparing `publishOptions.publishType` directly to using the `willPublish` and `willEmail` convenience getters so the button text better matches the action being taken
2022-05-11 09:33:32 +01:00
Sanne de Vries
e134e5b365 Updated publishing flow header
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-10 21:10:17 +01:00
Kevin Ansfield
cf3f872fa6 Added client-side validation check for post before opening publish/update flows
refs https://github.com/orgs/TryGhost/projects/59/views/20

- before the publish/update flow modals are opened, perform a `post.validate()` call, if it fails show the red error bar and don't open the modal
- shows validation errors early rather than being hidden until a save occurs at the end of the publish flow
2022-05-10 19:24:54 +01:00
Sanne de Vries
d364116948 Updated publishing flow
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-10 17:57:48 +01:00
Kevin Ansfield
59e7b720a2 Added <GhPostBookmark> and displayed on publish flow complete step
refs https://github.com/TryGhost/Team/issues/1598

- added `<GhPostBookmark>` card for displaying a bookmark card style representation of a post
  - updated designsandbox route to include it for easier styling without needing to constantly go through the publish flow to see changes whilst styling
- updated publish flow complete step to render a bookmark card if a post/page was published
- added `{{post-author-names}}` helper so the author name concatenation logic can be re-used across the posts list and bookmark component
2022-05-10 13:26:13 +01:00
Simon Backx
bf098cc730 Updated member counts for post newsletter
refs https://github.com/TryGhost/Team/issues/1576

- Recipient counts in scheduled post status at top of editor fixed for selected newsletter
- Added `fullRecipientFilter` getter on post model which includes the newsletter's recipientFilter
- Updated scheduled notification (used in old publishing flow or via preview)
2022-05-10 14:13:39 +02:00
Simon Backx
98e80cb6f8 Replaced newsletterId usage with newsletter
refs https://github.com/TryGhost/Team/issues/1569
refs https://github.com/TryGhost/Team/issues/1596
refs https://github.com/TryGhost/Team/issues/1576

- Removed some usages of post.newsletterId with post.newsletter
- Renamed newsletterId adapterOption from newsletterId to newsletter, in preparation of https://github.com/TryGhost/Team/issues/1596 (still sending newsletter_id)
- Removed newsletterId property of post model
2022-05-10 13:56:30 +02:00
Kevin Ansfield
a5fe1fa48c Updated publish complete step copy
refs https://github.com/TryGhost/Team/issues/1598

- pre-fetch post count when reaching the confirm step so it's available once save is complete
- updated copy on complete step to reflect the action that occurred, including the number of published posts when a post was published
- added `{{is-moment-today someDate}}` helper so we can switch between "today" and another date format
2022-05-10 12:51:05 +01:00
Kevin Ansfield
a1d26a575c Fixed flash of copy change when confirming an email-sending publish
no issue

- `@publishOptions.willEmail` is derived state that changes when the model status changes, this was causing the text to momentarily change when confirming because saving requires the post status to be changed from `draft` to `published/scheduled`
- added static `willPublish` and `willEmail` properties to the confirm step component's backing class that are set from the data passed in during construction so we don't end up with changing copy due to underlying model updates
2022-05-10 11:58:59 +01:00
Sanne de Vries
2e18aaaf2c Updated scheduled and published modals
Refs https://github.com/TryGhost/Team/issues/1597
2022-05-10 11:53:10 +01:00
Kevin Ansfield
967249ff6a Fully fixed flash of "draft" text when reverting to draft
refs 713e2b5ecc

- added a timeout to wait for the modal animation to finish before changing the post status and saving so we're not causing copy changes whilst the modal is still visible
2022-05-10 11:51:55 +01:00
Kevin Ansfield
607378580b Fixed email-only publish flow
no issue

- we were comparing the wrong `publishType` value
- we were accessing `this.willEmail` _after_ setting model properties that would change it's value so we grab the value before making any changes
2022-05-10 11:43:20 +01:00
Kevin Ansfield
b0038d71b6 Fixed linting error
refs 713e2b5ecc
2022-05-10 11:33:17 +01:00
Kevin Ansfield
f8084f69dc Fixed flash of "Save" button after save has completed
refs https://github.com/TryGhost/Team/issues/1597

- disabled automatic reset of the `<GhTaskButton>` used for saving so we don't have conflicting timeouts (button state auto reset is 2.5sec, display of save button before it's removed is 3sec)
2022-05-10 11:32:06 +01:00
Kevin Ansfield
713e2b5ecc Fixed flash of "Draft" when reverting a post to a draft
no issue

When reverting a post/page to a draft we were applying the model changes, saving, then closing the modal. This had the unwanted effect of updating the modal's copy whilst the save was in progress because it's all derived state and we're changing that state.

- changed revert button behaviour to instantly close the modal with a return value that lets the publish management know to run the revert task once the modal has closed
- added a popup notification to confirm successful revert
2022-05-10 11:22:46 +01:00
Simon Backx
95fa290fa8 Fixed button type on div causing button appearance in Safari
no issue

In Safari, the second dropdown looked a bit weird when you select 'publish only' because of type=button being used on a div.
2022-05-10 12:12:27 +02:00
Kevin Ansfield
e12ab83bed Fixed "Revert to draft" button
refs 756f5094b4

- `saveTask` was renamed to `publishTask` then repurposed as a general `saveTask` but the `revertToDraftTask` wasn't updated to reflect the rename
2022-05-10 10:19:29 +01:00
Kevin Ansfield
756f5094b4 Added "Save" button to editor for scheduled and published posts
refs https://github.com/TryGhost/Team/issues/1597

- added "Save" button to editor for scheduled and published posts when any edits have been made
- shows "Saving..." then "Saved" for 3 seconds before disappearing
  - replaces "Saving..." indicator shown in status bar on the left
- added `showIcon` argument to `<GhTaskButton>` so it can be used for text style buttons
- changed editor status behaviour to only show "Scheduled" by default with the full text shown on hover
2022-05-10 10:04:21 +01:00
Kevin Ansfield
e74b042d18 Fixed undefined member count for scheduled posts in publish update flow
no issue

- in the update flow we were always using `post.email.emailCount` but scheduled posts won't yet have a `post.email` record
- switched to showing a count of members based on the post's newsletter slug and `emailRecipientFilter`
2022-05-09 14:11:17 +01:00
Kevin Ansfield
2768dc74ad Fixed emails not being sent when using new publish flow
no issue

- `this.willEmail` was changed to include the post status as we only allow sending an email for draft posts but that meant the order of operations in the save task was wrong because we checked `willEmail` _after_ changing the status on a post meaning the newsletter/recipient filter query params were never attached when publishing
2022-05-09 14:11:17 +01:00
Kevin Ansfield
fc25bf5713 Added ability to set classes for parts of <GhDateTimePicker>
no issue

- adds additional class arguments:
  - `@datePickerTriggerClass`
  - `@datePickerClass`
  - `@timeInputClass`
2022-05-09 10:31:14 +01:00
Sanne de Vries
7356933d12 Made copy changes to publishing flow
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-06 17:10:08 +01:00
Kevin Ansfield
f9ce41620a Updated confirm publish button text
no issue

- button text changed to include the post type and time of publish
- the button text has become more complex than a static string so the logic was moved into a getter on the confirm component backing class
2022-05-06 15:12:38 +01:00
Sanne de Vries
a4c1f2f7e0 Added animation to publish confirmation button
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-06 14:56:11 +01:00
Sanne de Vries
f4405927ee Updated publish settings forms
Refs https://github.com/TryGhost/Team/issues/1544
2022-05-06 13:54:15 +01:00
Kevin Ansfield
b39fc7dba5 Changed recipient wording in publish flow to be more specific
no issue

- highlight all/free/paid/specific in the recipient overview wording in the options and confirmation stages of the publish flow
- fix "change settings" button on confirm step closing instead of going back to the options stage
2022-05-06 10:23:37 +01:00