Commit Graph

7390 Commits

Author SHA1 Message Date
Kevin Ansfield
4e30da6c70 Added ability to update snippet contents (#2073)
refs https://github.com/TryGhost/Team/issues/1008

To update a snippet, select the content in the editor that you want as your snippet text and click the snippet icon as per creating a snippet. Once the snippet name input shows, start typing the name of an existing snippet to be able to select it for update.

- replaced main snippet input component with the labs component
- removed the feature flag and associated labs screen toggle
- removed original/labs snippet input conditional in the editor
2021-09-01 09:09:40 +01:00
Naz
f2883c3636 Fixed a routing error when a "sent" post was edited
refs https://github.com/TryGhost/Team/issues/954

- When an email-only post with a "sent" status was edited, it's status changed to "draft", which is an incorrect behavior. This change is causing the "sent" status to persist and removes the transition error.
2021-08-31 20:16:53 +04:00
Naz
c27194efc5 Added a post preview link in PSM for "sent" posts
refs https://github.com/TryGhost/Team/issues/954

- When the post has a "sent" status there needs to be a way similar to the one for "published" posts to preview the post
2021-08-31 20:16:53 +04:00
Kevin Ansfield
06e63d371c 🎨 Added ability to upload a feature image by drag and dropping an image file
refs https://github.com/TryGhost/Team/issues/884

Drop-to-upload functionality was lost in the first version of the new feature image uploader inside the main editor area, this adds it back in.

- fixed dropzone flickering issue by switching the event listeners to the capture rather than bubble phase so we can indicate a drag is occurring on the body without each individual drag/drop handler needing to know about it
- moved the event handler init/cleanup to the `ui` service
- moved the event handler init call to the application service as it no longer requires auth to have occurred for access to the labs flag setting
- removed the `featureImgDragDrop` labs flag
2021-08-31 14:21:25 +01:00
Peter Zimon
2240daec45 Updated active dropdown UI 2021-08-31 13:52:04 +02:00
Peter Zimon
cea6063715 Added hints to Tier modal
- Added hint to tier description field
- Updated benefit field placeholder
- Added global help link to modal footer
2021-08-31 13:40:13 +02:00
Peter Zimon
86bd70d4c1 Update Stripe subscription status filter grouping
Refs:
https://github.com/TryGhost/Team/issues/1017
2021-08-31 13:05:26 +02:00
Kevin Ansfield
2ded68f845 Updated tests for draft "Saved" indicator
refs e7501ece33

- save status indicator now shows "Draft - Saved" so tests needed to match
2021-08-31 10:11:40 +01:00
Kevin Ansfield
e7501ece33 🎨 Added a "saved" indicator for autosaved draft posts
refs https://github.com/TryGhost/Team/issues/779

For draft posts the editor autosaves after each change but if you didn't see the "Saving..." indicator it wasn't clear what the save status of the post was. The editor will now always show "Saved" when there are no unsaved changes.

- removed indicator from published and scheduled posts because there's no autosave there
- removed the labs flag
2021-08-31 09:57:04 +01:00
Kevin Ansfield
3bc226bef0 Removed @classic decorator from member route
no issue

- there was no need for the decorator as the class is up to date with Octane idioms after swapping `init()` for `constructor()`
- added a comment about the need for `member.get('id')`
2021-08-31 09:37:44 +01:00
renovate[bot]
0a698ec41f Update dependency @tryghost/kg-clean-basic-html to v2.0.4 (#2070)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 09:01:23 +01:00
renovate[bot]
db2f91d108 Update dependency @tryghost/kg-parser-plugins to v2.0.4 (#2071)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 08:33:03 +01:00
Rishabh
3cd092f5fe Fixed member deletion UI getting stuck in certain cases
no issues
refs https://github.com/emberjs/ember.js/issues/5566#issuecomment-429389165

Member deletion UI gets stuck in UI when deleted via these steps: View member list, filtered by label. Click on a member, delete them. Admin transitions back to previous screen before action is completed — deletion completes successfully but deletion UI hangs.

This happens due to a niche ember bug which causes transitions to abort when transitioning to a route with query params having `refreshModel:true`. The fix is simple one liner with return being separated from the route transition statement.
2021-08-30 13:11:44 +05:30
Naz
107ed0e1f3 Added post distribution labels to publish menu
refs https://github.com/TryGhost/Team/issues/947

- With email-only posts there's a new "send" status that deserved it's own publishing action in the post publish menu. With with addition the post ended up having few more publishing states: publish, send, and publish&send. In addition to all this there's a "schedule" option. An addition of the "send" only select option there became a need to persist the "email_only" flag when the option was changed in the publish menu. Such persistance was not done before from the publishing menu and led a whole chain of additional methods being passed down from publishmenu component all the way down to distribution-action-select component
- At this moment only a happy path work properly when selecting one of the publishing options and publishing. More states will need to be handled for scheduled, unblished, etc. states of the post
2021-08-26 23:37:51 +04:00
Naz
9d292fd5a1 Hidden the publish menu when the post was "sent"
refs https://github.com/TryGhost/Team/issues/947

- There is no way to "unpublish" the email-only post that has been sent already. For current alpha version the menu is hidden and up for further development when needed
2021-08-26 23:01:52 +04:00
Rishabh
b5bc870a3b Handled dummy subscription for comped members
refs https://github.com/TryGhost/Team/issues/986#issuecomment-900281186

The tiers features updated the "comped" functionality to no longer create a Stripe Subscription for members. Since theme developers expect comped members will have a subscription, we added a dummy subscription object for comped members in API.

Since Admin previously expected comped members to be ones without any subscription but access to product, this change updates Admin behavior to identify comped subscriptions on a product and show them the same way as before.
2021-08-26 22:06:10 +05:30
Kevin Ansfield
23c6547b5b Fixed missing outline on <GhInputWithSelect> when focused
refs https://github.com/TryGhost/Team/issues/993

- added calls to `onFocus()` and `onBlur()` arguments inside the trigger when the input is focused/blurred so that the active class is correctly applied by ember-power-select
- removed unnecessary mousedown propagation cancellation, it was a copied from `<GhTokenInput>` where extra mouse handling is necessary for buttons inside tokens
- updated `.gh-input-with-select` styles to add the border when active
2021-08-26 17:19:00 +01:00
Sanne de Vries
e926591c34 FIxed dark mode for button groups in editor preview 2021-08-26 17:24:58 +02:00
Sanne de Vries
cb6a7bc179 Fixed dark-mode issues in email CTA card
Refs https://github.com/TryGhost/Team/issues/993
2021-08-26 17:13:21 +02:00
Kevin Ansfield
e547ffb466 Fixed accent-color buttons not being colored in dark mode
refs https://github.com/TryGhost/Team/issues/993

- dark mode button style was overriding the `.gh-btn-accent` styles as the `:not` gave it higher precedence
2021-08-26 16:08:26 +01:00
Sanne de Vries
a83830db7a Styled publishing action dropdown in publish menu 2021-08-26 13:01:45 +02:00
Kevin Ansfield
d0ef530df3 Fixed Safari showing contact suggestions when adding/replacing snippet
refs https://github.com/TryGhost/Team/issues/1008

- Safari doesn't respect `autocomplete="off"` and will attempt to show autofill suggestions, in this case it was picking up "name" from the "Snippet name" placeholder and showing suggestions for contacts on top of the snippets dropdown
- having the input name include "search" overrides the autofill behaviour
- https://bytes.grubhub.com/disabling-safari-autofill-for-a-single-line-address-input-b83137b5b1c7
2021-08-26 10:18:25 +01:00
Rishabh
b2616de5d1 Fixed portal preview for tier changes
refs https://github.com/TryGhost/Team/issues/981

- saving a new or existing tier needed a hit on top right save on settings as well or it wasn't showing on the front-end. This change refreshes portal preview once a tier is saved from its modal window so that frontend can correctly reflect the right data immediately.
2021-08-26 13:33:32 +05:30
Kevin Ansfield
ed85901607 Fixed tabbing in and out of <GhInputWithSelect>
refs https://github.com/TryGhost/Team/issues/1009

- setting `tabIndex="-1"` on the trigger prevents the trigger container receiving focus rather than the container input element (fixes general tabbing in and out)
- added extra blur handling to the input element so that it is not left in an open dropdown state when tabbing out
2021-08-25 15:41:30 +01:00
Kevin Ansfield
b5f43a7e9d Added autofocus of button text input in email-cta card after enabling button
refs https://github.com/TryGhost/Team/issues/1009

- added ID generation to the component as an example of good practice to avoid problems with multiple elements having the same ID
- used `afterRender` queue to schedule the focus of the button text input element so the element actually exists (it's added to the DOM only when `showButton` is true so we have to wait for that to complete)
2021-08-25 15:41:30 +01:00
Sanne de Vries
d8c7673a94 Capitalized email preview footer buttons 2021-08-25 13:13:55 +02:00
Naz
f0d2a9c253 Added copy to pre publish modal of email only post
refs https://github.com/TryGhost/Team/issues/947

- The wording makes it clear the post wont be accessible publicly after sending it
2021-08-25 14:56:12 +04:00
Naz
299a557cca Updated component syntax
refs https://github.com/TryGhost/Team/issues/947

- There is no need to use proxy objects in the newest versions of Ember. It's an old patterns that should not be perpetuated
2021-08-25 22:20:11 +12:00
Naz
eef3ee8942 Integrated post distribution dropdown into publish menu
refs https://github.com/TryGhost/Team/issues/947

- Shows the publish option selector based on the "emailOnlyPosts" feature status
2021-08-25 22:20:11 +12:00
Naz
9e84441e75 Added publishing action dropdown to publish menu
refs https://github.com/TryGhost/Team/issues/947

- Added a "distribution" dropdown component to the post publish menu allowing to select from one of three available types of distribution: publish, poblush&send, and send
2021-08-25 22:20:11 +12:00
Naz
2ad745e429 Removed email-only post checkbox from PSM
refs https://github.com/TryGhost/Team/issues/947

- The checkbox will live in the post publish menu instead
2021-08-25 22:20:11 +12:00
Sanne de Vries
debb081c61 Updated email CTA toolbar
Refs https://github.com/TryGhost/Team/issues/1007
2021-08-25 11:55:10 +02:00
Sanne de Vries
43f49da2d5 Fixed styling issue for email CTA card dropdown when positioned above input field 2021-08-25 11:27:31 +02:00
Kevin Ansfield
a6ca133915 Renamed buttonAlignment to alignment in email-cta payload
refs https://github.com/TryGhost/Team/issues/1007

- all contents within an email-cta card are now aligned left/center so it doesn't make sense to keep the payload attribute as `buttonAlignment`
2021-08-24 17:53:34 +01:00
Kevin Ansfield
dff28b3ca6 Removed "Link to this post" option from email-cta suggested URLs
refs https://github.com/TryGhost/Team/issues/1007

- we don't know the URL of a post until after it's published so we were using the preview URL instead as that will always redirect to the current URL
- however, it's not clear in the UI that is how the preview URL works so we're removing it to avoid any confusion
2021-08-24 16:52:13 +01:00
Kevin Ansfield
8309904fcc Fixed clicking on existing snippets in dropdown having no effect
no issue

- mousedown handler in the snippet input component was automatically closing when it was detecting a mousedown event outside of the element
- the new dropdown select is rendered in a wormhole outside of the component's element so the whole component was being destroyed before the mouseup listener on an option was fired
2021-08-24 16:04:49 +01:00
Sanne de Vries
e9f2bfa92b Updated emailed status in posts list and added email icon to scheduled posts
Refs https://github.com/TryGhost/Team/issues/954
2021-08-24 14:11:15 +02:00
Kevin Ansfield
e6e08ab70a Fixed button showing in email-cta rendered mode when it's disabled
refs https://github.com/TryGhost/Team/issues/1007

- added `@payload.showButton` to the conditional for showing the button
- `@payload.buttonText` and `@payload.buttonUrl` both kept in the conditional to match how it would behave in the email
2021-08-24 11:44:53 +01:00
Sanne de Vries
6198019de1 Updated snippet replacement dropdown 2021-08-24 12:28:07 +02:00
Kevin Ansfield
e979e45fdb Linked up divider toggle button in email-cta card toolbar
refs https://github.com/TryGhost/Team/issues/1007

- replaced `hasTopDivider` and `hasBottomDivider` and associated payload properties for a single `showDividers` payload property
- removed divider toggles from non-edit mode card toolbar
- linked edit-mode toolbar divider to a toggle dividers action
2021-08-24 10:50:25 +01:00
Kevin Ansfield
0dab21e604 Linked up email-cta button toggle
refs https://github.com/TryGhost/Team/issues/1007

- updated card payload defaults assignment and set `showButton` to `false`
- linked up button toggle button to toggle `showButton` in card payload and show as green when enabled
- hid button, and associated text/url inputs when `showButton` is false
- added `disabled` attribute to button when there's no text (attempt to simulate "placeholder" styling) and matched the text to the button text placeholder
2021-08-24 10:50:25 +01:00
Sanne de Vries
e21669dfa9 Fixed test 2021-08-24 11:39:04 +02:00
Sanne de Vries
f59fae71eb Updated snippet replacement dropdown 2021-08-24 11:21:47 +02:00
Kevin Ansfield
de480234e9 Fixed snippet creation from email-cta card's toolbar
no issue

- Glimmer components do not have a `.element` property so we need to set it manually because the editor currently reaches into card components to calculate the element's rect for selection when creating snippets
2021-08-24 10:12:52 +01:00
Kevin Ansfield
d45ba1aa78 Updated snippet replacement modal copy and button colour
no issue

- red -> black for button colour, red was a copy pasta from the delete confirmation modal
2021-08-24 09:13:13 +01:00
Sanne de Vries
4d3634a6d5 Updated icons in email CTA toolbar 2021-08-24 09:48:34 +02:00
Kevin Ansfield
29095ffba1 Updated suggested URLs list in the email-cta card
refs https://github.com/TryGhost/Team/issues/992

- added "Link to this post" option that uses the preview URL as it's currently the only guaranteed URL that we know before a post is published
- added "Free email signup" option
- added "Paid subscription" and "Upgrade or change plan" options that are only shown when Stripe is connected
2021-08-23 18:46:00 +01:00
Kevin Ansfield
ddf6360ae2 Passed post as a card option through to editor cards
refs https://github.com/TryGhost/Team/issues/992

- within cards we sometimes want access to the `post` record so that UI or copy can be changed based on what is currently being edited
- added ability to pass `@cardOptions` through to the editor components
- fixed KoenigEditor not correctly assigning the `cardOptions` object to the `options` object that gets passed to every card when they are rendered
2021-08-23 18:42:14 +01:00
Kevin Ansfield
330d264550 Fixed linting error
no issue

- removed unused variable
2021-08-23 17:34:17 +01:00
Kevin Ansfield
4184543307 Added confirmation modal when updating an existing snippet
refs https://github.com/TryGhost/Team/issues/973

- show confirmation modal instead of immediately replacing content of the existing snippet
2021-08-23 17:12:26 +01:00