Commit Graph

3296 Commits

Author SHA1 Message Date
Kevin Ansfield
f09af344ed Switched PSM to popover on smaller screens
refs https://github.com/TryGhost/Team/issues/840

- first pass at CSS-only PSM popover behaviour on screens <1024px
2021-07-01 09:30:16 +01:00
Kevin Ansfield
73d4ac8a26 Made server unreachable and maintenance error request retries application-wide
closes https://github.com/TryGhost/Team/issues/837

We previously added automatic retries to the editor controller for post saves; reviewing the resulting logs in Sentry we can see this stopped the "Server unreachable" error alerts showing to users because the requests typically succeeded on the first retry that was made 5 seconds later. However the problem is not limited to post saves and we can see other requests hitting the same issue, including when working in the editor such as adding embed cards, uploading images, or fetching member counts before publishing.

All of the API network requests we make in Admin run through an `ajax` service that makes and handles the request/response. By moving the retry logic for specific errors out of the editor controller and into the ajax service we can make temporary connection handling more graceful across the app.

- move retry behaviour from the editor controller to the `ajax` service so we can retry any request rather than just post save requests
- speed up retries so we reconnect as soon as possible
  - first retry at 500ms, then every 1000ms (previous was every 5s which meant overly long waits)
- reduce total retry time from >30s to 15s
- improve reporting to Sentry
  - report when a retry was required
  - report when a retry failed
  - include the total time taken for both success and failure reports
  - include the `server` header value from requests to distinguish between CDNs
  - include type of error so we can distinguish "server unreachable" from "maintenance" retries
2021-06-30 14:51:40 +01:00
Kevin Ansfield
91ec4435b5 Fixed accidental re-introduction of labs email design settings modal
no issue

- looks like we had an accidental merge of labs files and CSS back in after it was moved out of labs
- fixes odd font sizes in the settings modal
2021-06-30 12:38:43 +01:00
Sanne de Vries
0d01065dcf Refined feature image hover state and spacing 2021-06-30 12:42:48 +02:00
Rishabh
f65bb737c3 Refined product benefits section
refs https://github.com/TryGhost/Team/issues/838

- fixed reordering not saving
- fixed last benefit item not saving without plus
- fixed cancel not removing unsaved benefits
2021-06-30 15:51:34 +05:30
Peter Zimon
5f346fbf6b Fixed currency selector for product settings 2021-06-30 11:32:09 +02:00
Peter Zimon
8b306bcca4 Multiple products settings refinements
- fixed dark mode product card color bug
- fixed no. of benefits counter on product card
- removed "Available in Portal" badge (all products are available)
2021-06-30 11:09:18 +02:00
Peter Zimon
d5d9bb634d Refined link builder for multiple products 2021-06-30 10:29:29 +02:00
Rishabh
42691c5cc9 Added multiple product option to Portal links
refs https://github.com/TryGhost/Team/issues/825

With multiple products, it's possible to link to any products from themes.

- updates links area in Portal to be able to handle multiple products
- the new product selector for links is behind the alpha flag
2021-06-30 13:18:40 +05:30
Daniel Lockyer
1bfee18cbe Merged v4.8.4 into main
v4.8.4
2021-06-29 18:07:38 +01:00
Kevin Ansfield
84d3643e9f 🐛 Fixed error when removing Facebook/Twitter social images on general settings screen
refs https://github.com/TryGhost/Team/issues/836
refs ceb16b5e9f

Problem:
- `<GhImageUploaderWithPreview>` was updated to swap deprecated `{{action}}` usage to `{{on "click"}}` but that came with a missed behaviour change because the click event will now be passed as the argument to `@remove`
- the `<GhImageUploaderWithPreview>` usage on the general settings screen for social images had a syntax error in it's usage of the `mut` helper that meant the supplied argument was being used as the value rather than a forced `""` value. Result was that we were replacing the image urls with a text representation of the click event when attempting to remove images, leaving a broken image in place and no way to upload a new image

Fix:
- fixed incorrect `mut` usage to correctly force `""` as the value when removing social icons
- updated `<GhImageUploaderWithPreview>` to force `""` as the argument passed to `@remove` to avoid any other issues due to the behaviour change
2021-06-29 17:54:09 +01:00
Rishabh
cef44533d9 Moved portal_products in preview behind feature flag
no refs

- only uses `portalProducts` value in portal preview url if the multiple products flag is turned on
2021-06-29 12:19:20 +05:30
Kevin Ansfield
917c86db3b Changed mailgun API key wording to explicitly state "Private API key"
no issue

- Mailgun now also provides per-domain Sending API Keys which has caused some confusion because they will allow sending emails but won't allow for analytics to be fetched unlike the Private API Key
2021-06-28 17:26:32 +01:00
Kevin Ansfield
6f0955d232 Fixed validation errors not showing after failed save in editor
refs a6c6def7e1

- we weren't checking if an error was a validation error by examining the number of errors on the post model, this meant we weren't falling through to the generic error handling/display logic that shows an alert for validation errors when a save isn't a background/silent save
2021-06-28 15:52:36 +01:00
Kevin Ansfield
766de0d475 Added automatic retry of failed editor saves when Ghost is in maintenance mode
no issue

- when Ghost is in maintenance mode after an upgrade we know it will come back shortly so automatically retrying the save in the same way we do for "server unreachable" errors provides a smoother experience compared to halting and showing a red alert bar
2021-06-28 15:33:40 +01:00
Kevin Ansfield
53dbbf33a5 Fixed confusing editor state after a failed status change
no issue

- post status was not being reset after certain types of failure to publish/unpublish/schedule which meant that the editor could be left in an odd in-between state where the displayed status did not reflect reality
- fixed "saving/publish/schedule failed:" wording in error message when a server unreachable error was detected, the "saving/publish/schedule" did not reflect the actual status change because we were passing through only the current status rather than previous+new status'
2021-06-28 15:29:07 +01:00
Kevin Ansfield
a6c6def7e1 Fixed "Saving failed: undefined" error message in editor
no issue

- if a ServerUnreachable error is triggered by a non-background-save then we'd show the expected custom alert and then immediately overwrite it because `savePost`'s catch was not expecting an `undefined` error
2021-06-28 15:29:07 +01:00
Sanne de Vries
9105afe97c Fixed publish-menu position when settings menu is open 2021-06-28 16:27:58 +02:00
Rishabh
59367d418b Added option to hide labels for post acces
refs https://github.com/TryGhost/Team/issues/800

- makes labels option in members segment select
- hides label options in segment select for post access
2021-06-28 17:46:24 +05:30
Rishabh
c97be22854 Added segmented post access setting to labs menu
refs https://github.com/TryGhost/Team/issues/801

- adds the renewed product specific post access setting to new labs post settings sidebar
2021-06-28 17:46:24 +05:30
Rishabh
f9a25d4e41 Enabled product options for email recipient segment
refs https://github.com/TryGhost/Team/issues/801
refs 0caa539330

- adds back product options to email recipient segment filter in publish menu
2021-06-28 17:46:24 +05:30
Rishabh
3c5e334041 Added ability to set post access to segments
refs https://github.com/TryGhost/Team/issues/801

- This reverts commit de560733c5
- brings back members segment select component to post access, which allows setting access to specific labels/products
- only works behind the alpha feature flag - `multipleProducts`
2021-06-28 17:46:24 +05:30
Rishabh
3ac531be31 Added product options to members segment select
refs https://github.com/TryGhost/Team/issues/800
refs https://github.com/TryGhost/Team/issues/802

- adds product segments to segment select component behind the feature flag
- This reverts commit 27a2bc7722
2021-06-28 17:46:24 +05:30
Peter Zimon
0acf9b1d9b Refined benefits 2021-06-28 12:39:31 +02:00
Sanne de Vries
c1d3d8e4f2 styled reset passwords modal 2021-06-28 11:54:45 +02:00
Thibaut Patel
da9990db27 Added the "reset all passwords" user interface
issue https://github.com/TryGhost/Team/issues/750
pr https://github.com/TryGhost/Ghost/pull/13005
2021-06-28 11:54:45 +02:00
Rishabh Garg
46b311b561 Wired benefits section to API (#2023)
refs https://github.com/TryGhost/Team/issues/792

- updates product benefit to use `name` instead of `label` attribute for benefit text
- updates model/serializer/validator to correctly handle benefit attributes
- added `+` button for adding new labels as the enter behavior is closing the popup(needs fix)
2021-06-28 15:19:54 +05:30
Kevin Ansfield
386d59d709 Fixed editor save retry attempts data not making it to Sentry
no issue

- the options passed to `captureMessage` have specific top-level keys, arbitrary data needs to be supplied by the `extra` key rather
2021-06-28 10:34:21 +01:00
Sanne de Vries
637b50956e Adjusted padding in post settings menu 2021-06-28 10:11:40 +02:00
Sanne de Vries
d676473bb1 Updated post settings menu icon 2021-06-24 14:51:10 +02:00
Daniel Lockyer
023820eddd Merged v4.8.1 into main
v4.8.1
2021-06-24 11:20:17 +01:00
Rishabh
38a499a531 🐛 Fixed stripe connect modal not closing
closes https://github.com/TryGhost/Ghost/issues/13090

The `X` on stripe connect modal is not closing the popup as the updated modal changes was not wiring the close method.

Note: Clicking outside the popup to close it was still working
2021-06-24 14:52:06 +05:30
Rishabh
4665e64103 🐛 Fixed default currency for MRR stats on dashboard
closes https://github.com/TryGhost/Team/issues/799

- previous logic was still using `stripe_plans` for MRR currency, which is not used anymore
- updates first product's currency as default mrr currency
2021-06-24 14:51:39 +05:30
Peter Zimon
81ae1afcaa Added inner scrolling for benefits list (alpha) 2021-06-23 15:12:08 +02:00
Kevin Ansfield
1206889b0d Fixed editor flex breakouts squashing sidebar in settings menu redesign
no issue

- added `--editor-sidebar-width` CSS variable directly in `index.html` so it doesn't get removed by `postcss-custom-properties` (we use `preserve: false` to avoid problems with `postcss-color-mod-function`)
- adjusted editor CSS
  - added max-width calc on container element to prevent browser from increasing the element's width beyond what would allow the sidebar to display at it's desired width
  - adjusted the editor flex breakout styles to work with a non-100vw width by using the sidebar width variable
- updated labs post settings menu component to set the `--editor-sidebar-width` variable to the actual width of the sidebar element
  - avoids need to have multiple classes with fixed widths to adjust editor and breakout sizes
2021-06-23 13:54:40 +01:00
Peter Zimon
516825e41f Fixed Multiple products alpha feature name case style 2021-06-23 11:58:59 +02:00
Sanne de Vries
f15bce5c2d Updated design for new fixed post settings menu 2021-06-22 20:51:31 +02:00
Peter Zimon
c078b639c2 Benefit list width refinement (alpha) 2021-06-22 16:59:58 +02:00
Peter Zimon
a02711c2a2 Refined benefits list (alpha) 2021-06-22 16:44:16 +02:00
Sanne de Vries
3fc538eb4a Fixed feature image indicator alignment 2021-06-22 13:45:45 +02:00
Sanne de Vries
223a7f35c3 Added feature image indicator 2021-06-22 13:12:41 +02:00
Kevin Ansfield
1c9b7bba9d Fixed number of post save retry attempts
refs ac094821c8

- 2 attempts were used to speed up development, should have been 6 to match the 30seconds total retry period
2021-06-22 12:11:35 +01:00
Rishabh
1df55f76f7 Fixed product save handling on membership settings
no refs

- the settings save on memberships was incorrectly relying on developerExperiments flag instead of multipleProducts feature flag
2021-06-22 14:19:08 +05:30
Kevin Ansfield
bc950e655f Fixed error when editing settings
no issue

- the `newsletter_show_header` setting has been removed on the server side but was still being included by the client when saving the settings model resulting in a `Resource not found error, cannot edit setting. Problem finding setting: newsletter_show_header` error
2021-06-22 09:06:39 +01:00
Kevin Ansfield
a8c05f4be7 Fixed linting errors
refs ac094821c8

- stray console.logs
2021-06-21 18:15:17 +01:00
Kevin Ansfield
ac094821c8 Improved "Server unreachable" error handling in editor
refs https://github.com/TryGhost/Team/issues/788

- automatically retry any failed save attempts every 5 seconds for up to 30 seconds
- only show error bar after when we completely give up
- clear error bar if a later save is successful
- update error message to specify there's a connection problem and to retry with Cmd+S
- notify Sentry of a successful save after an initial failure including the number of attempts that were made and the total time for save to succeed in seconds
2021-06-21 18:13:45 +01:00
Sanne de Vries
81bfc3c6f6 Updated feature image button in editor 2021-06-21 16:27:13 +02:00
Kevin Ansfield
2770c73bab Fixed tests
refs 37a6197f81

- fixed find/replace whoopsie with `slugGenerator.generateSlug()`
- updated editor controller unit tests to match rename
2021-06-21 15:18:11 +01:00
Kevin Ansfield
37a6197f81 Renamed editor tasks to use xTask naming
no issue

- helps indicate that you're dealing with an ember-concurrency task object rather than a function/action so you know to use `perform` and that you have access to derived state
2021-06-21 15:05:41 +01:00
Sanne de Vries
0744119299 Fixed feature image caption vs alt text spacing issue 2021-06-21 16:00:49 +02:00
Kevin Ansfield
e322709f95 Updated newsletter design settings modal for new settings (#2013)
refs https://github.com/TryGhost/Team/issues/793
requires https://github.com/TryGhost/Ghost/pull/13074

- replaced main email design settings modal component with labs component and removed conditional
- removed `labs-newsletter-settings` class and cleaned up CSS
2021-06-21 13:40:54 +01:00
Peter Zimon
6011142428 Portal settings spacing refinement 2021-06-21 14:32:35 +02:00
Sanne de Vries
33d86c5dd5 Updated feature image design in editor 2021-06-21 12:03:40 +02:00
Rishabh Garg
274044e253 Added UI for portal products (#2010)
refs https://github.com/TryGhost/Team/issues/768

- adds portal products selection UI behind flag on portal settings screen
2021-06-21 14:21:48 +05:30
Rishabh
cde942f5bc Updated product benefits handling
refs https://github.com/TryGhost/Team/issues/792

- adds list of product benefits, if available, to main memebrship screen
- updates benefits management on product detail screen
2021-06-21 14:06:17 +05:30
Rishabh
dc6b2884f1 Added model and validator for product's benefit item
refs https://github.com/TryGhost/Team/issues/792

- updates product model to read product's list of benefits
- adds transformer to return emberArray with list of product benefits
- adds new model for each product benefit
- adds validator for new product benefit
2021-06-21 14:05:01 +05:30
Rishabh
e5a24c8bb3 Wired removing complimentary product action to API
refs https://github.com/TryGhost/Team/issues/769

- wired removing comp product action button to API, allowing removing comped subscription for member
2021-06-21 12:32:20 +05:30
Kevin Ansfield
fc21cd836a 🎨 Opened member email settings up to Administrator staff users
no issue

- previously only Owner staff users could access the email settings screens despite Administrators having server-side permissions to change the related settings
2021-06-18 18:43:38 +01:00
Sanne de Vries
4961b35692 Added feature image caption to newsletter template preview 2021-06-18 18:50:20 +02:00
Sanne de Vries
e2a136609a Updated email design settings layout 2021-06-18 17:22:23 +02:00
Peter Zimon
821c087871 Refined complimentary for multiple products (alpha) 2021-06-18 16:58:00 +02:00
Rishabh
9b228659da Added dummy benefits section to products
refs https://github.com/TryGhost/Team/issues/792

- adds new hardcoded benefits section as prototype in Products modal
2021-06-18 19:09:14 +05:30
Kevin Ansfield
d96046cf1b Handled SecurityError when accessing iframe in <GhSiteIframe>
no issue

- when a site has a separate front-end and admin URL the `site` screen could throw errors due to cross-origin access to the iframe content
- detect the error and fall back to a less efficient forced refresh on guid change
2021-06-18 13:08:19 +01:00
Rishabh
176ed4a260 Fixed member product modal not closing
no refs

- Added missing close handling for member product modal
2021-06-18 16:28:53 +05:30
Rishabh
bc25dbdefa Fixed modal errors in stripe connect and member product
refs 909bd60db3

- The modal actions for glimmer modal components need to define `actions.confirm` separately and add confirmAction to handle both enter and manual confirmation
2021-06-18 16:24:18 +05:30
Kevin Ansfield
922e4e6b32 Fixed unhandled errors from billing app for non-owner users
no issue

- if the identities endpoint returned an expected 403 for non-owner/admin users we weren't handling it resulting in an error that could bubble up into error reporting services
2021-06-18 10:34:30 +01:00
Kevin Ansfield
909bd60db3 Fixed errors when enter key is pressed in modals
no issue

- enter key when a modal is displayed will always trigger the `confirm` action, if it's not provided then the base modal will throw a `You must override the "confirm" action ...` error
2021-06-18 10:12:46 +01:00
Peter Zimon
178733a521 Added benefits container to add/edit product (alpha) 2021-06-18 10:51:10 +02:00
Kevin Ansfield
c1841fd58b Removed unused from address confirmation modal component
no issue

- email send confirmation and instructions are shown inline rather than a modal meaning this component wasn't being used
2021-06-18 09:46:38 +01:00
Kevin Ansfield
1447a57aa8 Fixed enter key in brand accent form triggering error
no issue

- pressing enter in the accent field would attempt to submit the form and trigger the confirm action
- no confirm action was present on the modal component meaning the base modal confirm action would trigger a invalid usage error
- we don't want enter in the accent field to save, instead we want to blur the element and trigger a preview update
2021-06-18 09:42:32 +01:00
Kevin Ansfield
a41cb42a87 First pass at fixed rather than popover post settings sidebar
refs https://github.com/TryGhost/Team/issues/786

Enabled through labs `psmRedesign` flag, rough implementation to help design direction.

- fixed rather than popover when opened by putting editor and sidebar inside a flex container
- settings toggle fixed in top right rather than separate close button
2021-06-17 19:00:59 +01:00
Kevin Ansfield
dc1caf0b29 Removed usage of SettingsMenuMixin in post settings menu
no issue

- the post settings menu is the only component that uses the mixin so it makes sense to inline it, especially as mixins are deprecated and the mixin's utility is minimal and already overridden in places
2021-06-17 16:45:13 +01:00
Kevin Ansfield
4482aa5395 Added alpha labs flag for PSM redesign
refs https://github.com/TryGhost/Team/issues/786

- adds flag checkbox to labs page
- duplicates psm component ready for changes
2021-06-17 14:10:32 +01:00
Kevin Ansfield
18c9da0bf0 Fixed capitalisation inconsistency for Post Title
no issue

- out title standard is to only capitalise the first word rather than every word
2021-06-17 12:12:31 +01:00
Peter Zimon
d5a4be4ea1 Small UI refinement for benefits alpha 2021-06-17 11:18:26 +02:00
Peter Zimon
b82ab6b2f6 Added static benefits list to products card 2021-06-17 11:11:17 +02:00
Rishabh Garg
aa35d99de4 Add UI for complimentary products with multiple products feature (#2008)
* Added v1 comped subscription handling

* Cleanup

* Added cancellation for existing subscriptions

* Added loader for fetching products

* Refined complimentary popup

* Added default product selection

* Updated add complimentary for multiple products

* Updated products add comped button

Co-authored-by: Peter Zimon <zimo@ghost.org>
2021-06-17 13:09:43 +05:30
Kevin Ansfield
182cd106e5 Added retry button to feature image uploader
refs https://github.com/TryGhost/Team/issues/771

- allows for getting out of the error state so an upload can be re-attempted
2021-06-16 18:08:22 +01:00
Kevin Ansfield
0d30077325 Switched to new component for labs feature image redesign
refs https://github.com/TryGhost/Team/issues/771

- added `<GhEditorFeatureImage>` for more flexibility than offered by `<GhImageUploaderWithPreview>`
  - updated to more closely match intended designs
- removed alt/caption support from `<GhImageUploaderWithPreview>` as it's no longer used
- fixed upload/delete/upload not working due to file input references getting out of sync
2021-06-16 17:56:25 +01:00
Peter Zimon
628a482c3a Added cancellation reason to Members details
refs. https://github.com/TryGhost/Team/issues/780
2021-06-15 13:30:56 +02:00
Kevin Ansfield
ba47b710cb 🎨 Moved default focus in editor from body to title for new posts
refs https://github.com/TryGhost/Team/issues/707

Placing focus in the title aligns better with typical editorial process.

- switched `autofocus` attribute from body to title for new posts
- added a default value to the `mobiledoc` attr on the Post model, without it the autosave when moving from title to editor creates a forced re-render and clears the focus whilst you're typing
2021-06-14 15:35:59 +01:00
Peter Zimon
71e347b72c Updated product price styles 2021-06-14 14:05:49 +02:00
Kevin Ansfield
1b85b9244b Updated email previews to show full from email address
no issue

- moved duplicated email domain generation from `members-email` controller and `<GhMembersEmailSetting>` to `config.emailDomain`
- added `{{from-email-address emailStr}}` helper that will output the passed in emailStr value if it contains an `@` or concat `emailStr@emailDomain` if it doesn't - lets us use `settings.membersFromAddress` to always get a full email address when it could be just a name (`noreply`) or a full address
- updated customise email and post email preview templates to use the new helper
2021-06-11 16:42:27 +01:00
Sanne de Vries
f837eb5630 Updated email template settings and preview 2021-06-11 16:40:56 +02:00
Kevin Ansfield
645fd18a80 Fixed syntax error 2021-06-11 12:22:12 +01:00
Kevin Ansfield
9adfad67d2 Added <GhMembersFilterCount @filter="..." />
no issue

- added generic members filter component
- updated `<GhRecipientFilterCount />` to use the new generic component with `subscribed:true` added to the filter
2021-06-11 12:19:44 +01:00
Kevin Ansfield
937eac51ad Fixed "and sent to..." text appearing in scheduled header when not sending
refs bd60c8089b

- added conditional for displaying the recipient text
- fixed tests not expecting newlines in html
2021-06-11 12:10:28 +01:00
Kevin Ansfield
bd60c8089b 🐛 Fixed confusing member count shown in save notification and editor header
closes https://github.com/TryGhost/Team/issues/776

Since switching to using a real NQL filter in the `posts.email_recipient_filter` field where we used to show `free members`, `paid members`, or `all members` we were showing `status:free`, `status:-free`, and `status:free,status:-free` respectively. If labels are used in a filter the text became even longer.

- added a `membersCountCache` service
  - `.count(filter)` fetches a numeric count from the members API, if the filter has been counted in the last minute it returns the count directly from a cache instead to avoid hammering the members API when we show counts in multiple places across the UI
  - `.countString(filter)` fetches a count but returns a humanized string with the logic extracted from what we displayed in the confirm email sending modal
- added a `<GhRecipientFilterCount @filter="" />` component that acts as a wrapper around the async count from `membersCountCache`
- updated confirm email send modal, plus save notification and editor status displays for scheduled posts to use the new service and component
2021-06-11 11:44:50 +01:00
Peter Zimon
505eee29ef Fixed settings description line-height 2021-06-11 11:20:49 +02:00
Daniel Lockyer
b284e2e4da 🐛 Fixed sticky "unsaved settings" modal
fixes https://github.com/TryGhost/Team/issues/777

- the unsaved settings modal would come back if you left a settings
  sub-page with unsaved changes and then came back to the page
- if you then clicked on "Leave", Admin would crash with a Sentry error
  of `Cannot read property 'finally' of undefined`
- we had a similar bug in
  39c850f4fe
  and the fix was to remove the `.finally` because it assumed the
  confirm action returned a promise
- this commit performs a similar fix and seems to resolve the problem
2021-06-11 09:15:27 +01:00
Kevin Ansfield
ceb16b5e9f Added first version of feature image with caption inside editor (#1999)
refs https://github.com/TryGhost/Team/issues/771

- updated `<GhImageUploaderWithPreview>` to take an `@includeMetadata` argument that shows a basic html supporting caption field underneath (ready for toggle between caption/alt but not fully implemented)
- added feature image alt/caption properties to post model
- updated UI behind "featureImageMeta" labs flag
  - added the feature image uploader to the top of `<GhKoenigEditor>` for display above the editor title
  - removed feature image uploader from post settings menu
- added labs flag checkbox
2021-06-10 20:42:32 +01:00
Hannah Wolfe
75e573568c Swapped to American English spellings
- Traditionally all of Ghost's public-facing text was written in British English
- We're changing that to US English because that's more common
- This PR mostly just fixes up the words customise/customisation and favourite
2021-06-09 16:32:14 +01:00
Rishabh
afa06a08b0 Updated multiple products UI behind feature flag
refs https://github.com/TryGhost/Team/issues/763

- Added dev experiments requirement for multiple product feature as its alpha
- Puts new multiple products UI in membership settings behind the feature flag
- Puts add comp sub popup prototype behind the feature flag
2021-06-09 16:14:48 +05:30
Rishabh
ab069c5b81 Added UI for multiple products labs flag
refs https://github.com/TryGhost/Team/issues/763

- Ensure the feature flag is available in the feature service so that it knows where to pull the setting from (labs)
- Added a toggle UI to the alpha features list in labs for switching multiple products
2021-06-09 15:45:37 +05:30
Kevin Ansfield
8f5e305721 🐛 Fixed member count not showing in send email confirmation modal
closes https://github.com/TryGhost/Team/issues/738
refs https://github.com/TryGhost/Admin/pull/1972

- when we switched from the segment select back to checkboxes and label select we lost the automatic member counting which meant other parts of the publishing workflow had no counts
- fixed subscribed status counts shown in publish menu
- added the async count back to the confirm modal, taking full free/paid/specific query into account
- added total subscribed member count back to the draft publish menu so the email options can be disabled when no subscribed members exist
  - fixed missing disabled styling inside `<GhMembersRecipientSelect>`
2021-06-08 13:07:16 +01:00
Kevin Ansfield
e44f18a412 🐛 Fixed member count in publish menu not matching subscription status
no issue

- the `subscribed:true` filter was missed in the member count queries when we switched from `<GhMembersSegmentSelect>` to `<GhMembersRecipientSelect>` (https://github.com/TryGhost/Admin/pull/1972)
2021-06-08 12:27:30 +01:00
Kevin Ansfield
4ad305534a 🐛 Fixed links in email preview not being clickable
no issue

- browsers blocked links from opening in a new window due to the iframe sandbox permissions
- allowed popups so that it's possible to check links go where you expect them to before sending an email
- our email rendering adds `target="_blank"` to all links so they'll open in a new tab rather than clearing navigating away from the admin area
2021-06-08 10:36:17 +01:00
Sanne de Vries
dab8f44499 Added spacing and center aligned email header image in preview 2021-06-08 10:33:20 +02:00
Sanne de Vries
b933a5e82f Updated header img uploader and disabled states in email design settings 2021-06-08 09:38:38 +02:00
Sanne de Vries
e1ce503e72 Updated email font selector dropdowns 2021-06-07 23:06:05 +02:00
Hannah Wolfe
f5f37e822f Added UI for match helper labs flag
- Ensure the feature flag is available in the feature service so that it knows where to pull the setting from (labs)
- Added a toggle UI to the alpha features list in labs as this is a new feature and is therefore alpha
- Changed the old gh-feature-flag helper to use the switch class instead of checkbox as that's a new pattern since we used this helper
2021-06-07 20:49:32 +01:00
Hannah Wolfe
b3ed4b81f9 Adding new alpha feature labs section with oauth
- Adding a new section to the labs page for alpha features
- Alpha features require both the dev experiments config var AND a labs flag
- Moving oauth into this section as it's dev experiments + it's own setting atm
2021-06-07 19:56:47 +01:00
Kevin Ansfield
cbb353f34d Switched newsletter body/title font selectors to dropdowns
refs https://github.com/TryGhost/Team/issues/755

- added new `<GhFontSelector>` component that wraps PowerSelect to create a quick option for offering a serif/sans-serif dropdown
- replaced radio buttons in labs email customisation modal with the new font selector
2021-06-07 18:52:37 +01:00
Sam Lord
579b89c6be Merged 4.6.6 into main 2021-06-07 18:04:33 +01:00
Rishabh
1bfd37d24c 🐛 Fixed missing complimentary subscription add button
refs 81de2fe223
refs https://github.com/TryGhost/Team/issues/758

The "Add complimentary" subscription button in members does not show up when members already have an existing zero amount subscription. But this was incorrectly not taking into account active subscriptions and was applying the rule to canceled subscriptions. Since the `comped` behaviour changed in 4.6 which caused member's existing comp subscription to be canceled, this bug did not allow the comped subscription to be added back.
2021-06-07 22:24:49 +05:30
Kevin Ansfield
b2b66490b7 Added settings for newsletter header, title style, and feature image (#1993)
refs https://github.com/TryGhost/Team/issues/755
reqs https://github.com/TryGhost/Ghost/pull/13006

- updated settings model to match new server-side settings
- updated email customisation modal behind the dev experiments flag
  - adjusted layout to move to a fixed top bar and scrollable sidebar
  - added image upload, toggles and selections for new settings
  - updated preview to match selected settings

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2021-06-07 16:36:21 +01:00
Peter Zimon
c1cb738b52 Display Portal badge on product card condition 2021-06-04 15:36:18 +02:00
Peter Zimon
258c9439a6 Updated product badge color 2021-06-04 15:18:39 +02:00
Peter Zimon
49655fa451 Updated 'Add product' modal styles 2021-06-04 14:27:33 +02:00
Rishabh
e9486a8e87 Removed unused prices method in portal links
no refs

The `getAvailablePrices` method was removed from portal links as we no longer loop over prices for links but use monthly/yearly directly instead.
2021-06-04 17:43:46 +05:30
Rishabh
25a1e52391 Fixed incorrect existing product check in modal
refs https://github.com/TryGhost/Team/issues/715
2021-06-04 16:55:33 +05:30
Peter Zimon
db1cc85882 Adding 'Available in Portal' badge to product card 2021-06-04 13:02:16 +02:00
Rishabh
72ca4ded76 Removed portal option for default product for tiers UI
no refs

This change reverts the last commit to add portal option to product as it breaks the model that is passed to popup.

This reverts commit 5f538b5036.
2021-06-04 16:14:05 +05:30
Rishabh
5f538b5036 Added portal option to default product for tiers UI
refs https://github.com/TryGhost/Team/issues/715

By default, the first product/tier is available in Portal at the moment, this adds an attribute that can be used to denote which product is active in Portal in UI
2021-06-04 15:34:27 +05:30
Peter Zimon
ba149afcc3 Updated add product UI style 2021-06-04 11:35:28 +02:00
Peter Zimon
a82b31353f Updated product card styles (alpha) 2021-06-04 10:59:42 +02:00
Rishabh
d4cb7f9d1d Updated setup wizard pricing to use new product API
refs https://github.com/TryGhost/Team/issues/721

The setup wizard in Admin handles creating default prices as well as handling new price changes on default Product. This change updates the handling to use updated Products API with support for `monthly/yearly_price` values that offloads price handling to backend and makes the logic simpler. Also updates the stripe connect flow to use new API for creating default prices.
2021-06-04 13:30:11 +05:30
Rishabh
2b13bfea98 🐛 Fixed visible add complimentary button without Stripe enabled
closes https://github.com/TryGhost/Team/issues/742

The button to add a complimentary subscription for a member was visible even if Stripe was not connected on the site, and errored out with nasty red banner. This hides the `Add complimentary` button for member if stripe is not enabled on the site.
2021-06-04 13:30:11 +05:30
Rishabh
404a86b9d7 Cleaned unused methods in portal links
refs https://github.com/TryGhost/Team/issues/684

Removes now unused methods for fetching list of prices to show in Portal links, since it was reverted back to showing monthly/yearly prices only.
2021-06-04 13:30:11 +05:30
Rishabh
64393ab197 Updated portal settings to use names in portal_plans setting
refs https://github.com/TryGhost/Team/issues/753

The portal_plans setting was previously storing price ids for active monthly/yearly prices for the default product, which was done to allow multiple prices in Portal. Since the portal_plans setting is now reverted to use `monthly`/`yearly` named values to denote the availability of active monthly/yearly pricing on a product, this change updates the handling in portal settings modal to work with new settings.
2021-06-04 13:30:11 +05:30
Rishabh
46e281241e Wired new membership tiers UI to API
refs https://github.com/TryGhost/Team/issues/712
closes https://github.com/TryGhost/Team/issues/717

The product API is updated to support `monthly/yearly_price` on each product instead of using list of stripe prices. This change updates the handling of membership settings to use the updated API instead of `stripe_prices` property.
2021-06-04 13:30:11 +05:30
Rishabh
6165441c30 Added UI for handling multiple tiers in membership settings
refs https://github.com/TryGhost/Team/issues/715

Adds new modal and component to handle managing a list of products(tiers) in Admin behind the developer experiments flag. Also adds a new helper for stripe prices to convert amount from decimal value.
2021-06-04 13:30:11 +05:30
Kevin Ansfield
c10f8d014a Added query param for email design settings modal
no issue

- allows for easier development because modal stays open when refreshing as UI state is stored in the URL
2021-06-03 17:22:59 +01:00
Peter Zimon
bf700c5d98 Added product selector modal for complimentary sub
Developer experiment for multiple products.
- Added modal to choose a product for complimentary subscriptions.
2021-06-03 18:06:42 +02:00
Kevin Ansfield
2f828137ab 🐛 Fixed Enter key not working in send email confirmation modal
no issue

- the modal wasn't overriding the default `confirm` action so an error was thrown and the confirm action not triggered when pressing <kbd>Enter</kbd> whilst the modal is shown
- resolves Sentry error `ADMIN-M`
2021-06-01 17:02:31 +01:00
Kevin Ansfield
194cf296e5 Fixed "this.args is undefined" error when pressing Escape to close roles modal
no issue

- the modal component is using a native class but with the `@classic` decorator so it's still using pre-Glimmer component syntax where `this.args` doesn't exist
- fixes Sentry error `ADMIN-4C`
2021-06-01 16:50:02 +01:00
Kevin Ansfield
66f6d25d4b 🐛 Fixed blank branding preview on split front-end/admin domain setups
no issue

- the POST request made to fetch the preview was going to the non-trailing-slash version of the site URL which was resulting in a redirect to the trailing-slash version which then failed due to CORS
2021-06-01 10:46:28 +01:00
Sanne de Vries
098f5b9d06 Added icon to staff user role dropdown field 2021-06-01 09:29:37 +02:00
Kevin Ansfield
a5dd92f1b8 Changed editor title input to treat '(Untitled)' as blank
refs https://github.com/TryGhost/Team/issues/707

- the switch to a hard `'(Untitled)'` when you start typing is jarring and pulls you away from writing to want to set a title
- by changing the input to treat '(Untitled)' as a blank value the placeholder continues to be shown so flow isn't broken. Post validation and title display elsewhere in the app is unaffected because we're still setting `'(Untitled')` under the hood, it's only the editor display that changes
2021-05-27 18:18:51 +01:00
Kevin Ansfield
6d66c2cc73 Converted <GhKoenigEditor> to glimmer component
no issue

- switched to Ember Octane patterns
  - use native class instead of EmberObject syntax
  - moved container element into template
2021-05-27 18:18:51 +01:00
Kevin Ansfield
3d43964bcd 🐛 Fixed portal preview resize when using split front-end/admin URLs (#1980)
no issue

- switched to listening to Portal's `message` events that now include a height
- removes need to reach into Portal preview iframe contents which is blocked by browser security when working cross-origin
2021-05-27 13:20:37 +01:00
Kevin Ansfield
c8f1fb5b45 🐛 Fixed error on membership screen when using split front-end/admin URLs
no issue

- when the preview iframe origin does not match the admin origin (ie, front-end and admin live on different URLs) we would hit browser security restrictions for accessing contents of a cross-origin iframe
- added a guard around the preview resize code so we abort resizing when we hit a security error
2021-05-27 11:00:10 +01:00
Kevin Ansfield
f45f250a1d Sorted snippets alphabetically in card menus
no issue

- more logical ordering
2021-05-26 20:29:41 +01:00
ceecko
0b31be4c90 🎨 Added error message from limit service to theme upload
no issue

- Addresses 634d2daa13 (r49241896)
- Uses limit service to display the configured error message
2021-05-26 19:05:19 +02:00
Kevin Ansfield
09716646b0 Switched from Sentry.captureMessage to captureException for better logging
no issue

- `Sentry.captureMessage` is used for plain text messages rather than errors or objects
2021-05-26 17:18:02 +01:00
Kevin Ansfield
5b2194d5e8 Added Sentry error tracking for unhandled exceptions and API errors
refs https://github.com/TryGhost/Team/issues/723

- if the `/site/` API returns a `sentry_dsn` then we configure Sentry for error reporting as soon as we've loaded the initial unauthenticated data
- once we're authenticated and we have the full Ghost version available, override the Sentry event processor to use the full release
- updated `notifications.showAlert()` which is our fallback for API errors that shows the red banner at the top - these are the errors we're most interested in getting visibility for and reducing
2021-05-26 17:01:32 +01:00
Rishabh
7630b5f3ae Fixed member details not loading
refs https://github.com/TryGhost/Team/issues/660

We added a guard to not send price object in a subscription when the data is missing from DB. This can cause the member details page to fail with the missing price object, so this change adds a guard against subscriptions with missing price.

Note: This is only a short-term fix till we add a proper fix to cleanup the DB in the subsequent release.
2021-05-26 19:53:41 +05:30
Peter Zimon
efb036f9f1 Refined icon color 2021-05-25 14:00:22 +02:00
Kevin Ansfield
2a4dc849d0 Disabled "Customise portal" button when signup access is disabled
no issue

- when signup access is set to "none" the portal preview will be blank and the settings not available so it doesn't make sense to make the customise portal modal available
2021-05-25 10:09:13 +01:00
Kevin Ansfield
2f39953917 Fixed preview background flash when switching from none -> all/invite
no issue

- flash was occurring because as soon as the setting was changed we switched to showing the portal preview but at that time the preview URL is still set to an old url value. The url doesn't get changed until the settings save completes which gives enough time for a non-portal page to load before being replaced
- added a `switchFromNoneTask` that is triggered when switching away from a saved none value and updated the template to stay on the "disabled" view until the save has completed so we don't trigger multiple page loads
2021-05-25 09:40:17 +01:00
Kevin Ansfield
2bd118eef9 Attempted fix of portal background flash going from nobody->anybody/invite
no issue

- dropped use of `@guid` tracked param in favour of adding query param to URL in `updatePortalPreview()` and making sure we only update it when necessary
2021-05-24 19:29:18 +01:00
Kevin Ansfield
28de12c7eb Added scrolling="no" back in correct position
no issue

- property is specific to the membership portal preview rather than all site iframes
- fixes page-height scrollbar appearing on portal preview height animation
2021-05-24 19:14:47 +01:00
Peter Zimon
5cf7a29d2c Portal preview iframe refinements 2021-05-24 20:06:39 +02:00
Kevin Ansfield
b06a351538 Removed errant scrolling="no" on <GhSiteIframe> 2021-05-24 18:59:21 +01:00
Kevin Ansfield
956ec8f302 Added animation to portal preview height (#1977)
no issue

- add CSS transition for height attribute of portal preview container
- before adjusting height of container, apply styles to portal preview nested iframe to prevent scrollbars from showing
2021-05-24 18:55:18 +01:00
Kevin Ansfield
baafe011a2 Fixed portal preview resize and cached page bugs
no issue

- moved `@onLoad` trigger from `load` event to the `makeVisible()` task so that consumer code isn't called before load has fully finished
  - fixes issue with portal sometimes not being ready when we perform the resize on the membership screen
- added guid as a cache-busting `?v={guid}` query param
  - fixes issue where preview iframe can load stale data after a settings change resulting in a blank preview after going from "nobody" to "invite/anybody" because the loaded homepage is stale and doesn't have the portal script injected
2021-05-24 17:28:01 +01:00
Rishabh
757f061362 Added stripe connect guard for saving product
no refs

While saving on membership screen, we also try and save the product with any prices that have changed. In case Stripe is not connected, saving Product doesn't make sense as we should not edit prices for the default product without Stripe connection.
2021-05-24 21:17:40 +05:30
Rishabh
1b491aa083 Fixed price reset when no monthly/yearly prices
no refs

When we reset the prices on leaving the membership settings screen, its possible we don't have the prices created already and not able to read any monthly/yearly price.
2021-05-24 20:02:49 +05:30
Kevin Ansfield
b8e6107c6a Fixed portal previews flashing background (#1975)
refs https://github.com/TryGhost/Team/issues/701
requires Portal@1.4.2 or later

- changed `<GhSiteIframe @invisibleUntilLoaded>` to accept a string in place of a `true/false` value
    - if a string is passed then we'll set up a message event listener than listens for a `postMessage` from the iframe with data that matches the supplied string
- updated `<GhSiteIframe>` usage for portal previews to use `@invisibleUntilLoaded="portal-ready"` so they listen for a message event rather than displaying as soon as we get a load event
2021-05-24 14:03:08 +01:00
Rishabh
6f9cd593a7 🐛 Fixed retry email not timing out on poll
no refs

Fixes a small bug in email retry logic meant we never timeout on polling for email retry while listening for the email status to see if it failed or submitted.
2021-05-24 18:29:13 +05:30
Rishabh
740a304bf0 Handled product save failure on Stripe connect
refs https://github.com/TryGhost/Team/issues/704

We try and create new default prices soon after Stripe Connect is completed, but it might take couple of seconds for backend to have Stripe config ready and in the meanwhile saving a product with new prices will fail with 409 Conflict error as it will be unable to create prices on Stripe. This change allows re-attempting saving a product with new prices soon after connect in case of a STRIPE_NOT_CONFIGURED error so that the default prices can be created properly.
2021-05-24 18:29:13 +05:30
Kevin Ansfield
2826ebfac4 Added timeout to help prevent site background flashes in portal previews
refs https://github.com/TryGhost/Team/issues/701

- `onload` event fires once the page has loaded but scripts may still be processing that would render an overlay. Wait for 100ms for renders to occur before making the iframe contents visible to allow for renders to occur
2021-05-24 11:02:26 +01:00
Kevin Ansfield
495e435daf Brought checkboxes back to publish menu recipient selection (#1972)
no issue

Free and Paid are by far the two most common options for email recipients so it makes more sense to have them as very clear options which we felt was not the case with the single token/segment select.

- created a new `<GhMembersRecipientSelect>` component that has individual checkboxes for free/paid/segment and when segment is selected an additional token input for specific labels
- updated draft and scheduled publish menu components to use the `<GhMembersRecipientSelect>`

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2021-05-21 18:22:01 +01:00
Kevin Ansfield
77bd0ab6f1 Fixed default email recipients when visibility is members or paid
no issue

- since we reverted the post visibility changes, the visibility filter passed to `<GhMembersSegmentSelect>` was passing through `'members'` or `'paid'` which aren't known values
2021-05-21 17:53:29 +01:00
Sanne de Vries
043f5751ea Fixed responsive issues in membership settings 2021-05-21 14:52:09 +02:00
Sanne de Vries
48d0f123bd Fixed price selector clipping bug in membership settings 2021-05-21 11:25:23 +02:00
Kevin Ansfield
a43cc4a051 Commented out temporarily unused products routes
no issue

- support for multiple products is not ready yet so the routes should not be available whilst we still have a singular monthly/yearly prices on top of the in-progress products work
2021-05-21 08:59:29 +01:00
Kevin Ansfield
29dc178261 Removed unused members-payments route
no issue

- stripe connect/disconnect functionality has moved to a modal as part of the new membership screen
- removed `settings/members-payments` route and related route/controller/template files
- updated link to stripe connect in product screen to show an alert as a reminder to update to use the new modal (products screens are not usable for now, they'll be worked on again later)
2021-05-21 08:57:28 +01:00
Rishabh
9000317acd Fixed incorrect stripe disconnect UI on memberships setting
no refs

When disconnecting Stripe via the stripe connect modal, we were not resetting the `stripeConnectIntegrationToken` which is used by backend to calculate properties of `stripe_connect_*` settings. This resulted in `stripe_connect_*` properties being retained in settings even after Stripe is disconnected as we keep passing the old integration token to settings API which overrides all connect settings. This change resets the stripe integration token to empty again so as its not using the old value even after modal is closed or disconnected.
2021-05-21 13:26:55 +05:30
Peter Zimon
c56be7cd2a Fixed stripe connect modal UI while saving 2021-05-20 18:36:34 +02:00
Kevin Ansfield
3ab0a52f62 Fixed stripe connect modal not adjusting correctly to connected state
no issue

- updated `<GhFullscreenModal>` to pass `@modifier` and `@updateModifier` through to child modal components so they can adjust their own classes
- added an `updateSuccessModifier()` action to `<ModalStripeConnect>` to set the modal size when first opening and on `@onConnected/Disconnected` actions passed to the `<GhMembersPaymentsSetting>` component
- updated `<GhMembersPaymentsSetting>` to call passed in `onConnected/Disconnected` actions when connection or disconnection is finalised
2021-05-20 17:20:49 +01:00
Rishabh
bfd022e760 Cleaned default prices on stripe connect
no refs

Cleans up changes to create prices on stripe connect with increase in timeout to allow stripe migrations to run in backend
2021-05-20 21:37:03 +05:30
Rishabh
02a0063444 Added default price creation on launch wizard
no refs

On Stripe connect in launch wizard, we add the default prices on the new Stripe account in the DB so the site has prices in Portal checked from the start. It behaves the same way as connecting stripe from membership settings.
2021-05-20 21:23:38 +05:30
Rishabh
46ac047772 Added default price creation on stripe connect
no refs

On Stripe connect, we add the default prices on the new Stripe account in the DB so the site has prices in Portal checked from the start
2021-05-20 20:47:23 +05:30
Kevin Ansfield
345cfd6f36 Fixed error when changing subscription access back to saved setting
no issue

- if you switch back to the saved subscription access setting we attempted to use destructuring assignment from an `undefined` value
- switched to using direct assignment and optional chaining
2021-05-20 15:00:46 +01:00
Kevin Ansfield
dee5129edf Fixed portal preview not updating when changing from a saved "Nobody" access
no issue

When members signup access is saved as "none" the front-end won't inject the portal script when rendering meaning changing to "all" or "invite" in Admin will show the preview but there's no portal script injected for the portal to show up.

- detect when we're switching from a saved "none" state and force a save and full refresh of the iframe
2021-05-20 14:43:04 +01:00
Kevin Ansfield
03844d5b97 Fixed portal preview not updating when connecting/disconnecting Stripe
no issue

- store current stripe connection status when opening the stripe connect modal and if it's different when the modal is closed force a save and refresh of the portal preview
2021-05-20 14:31:51 +01:00
Rishabh
430ba2329d Updated pricing setup on launch wizard
no refs

Reworks the set pricing page on the launch wizard to work similar to membership settings, where instead of being disabled when prices exist, it shows existing monthly/yearly prices as well as handles creation of new prices and updating portal settings.
2021-05-20 17:01:12 +05:30
Peter Zimon
1b66938327 Added spinner to creating subscription manually 2021-05-20 12:33:17 +02:00
Rishabh
510e31e6e6 Fixed unsaved change modal on new prices
no refs

When creating new prices on save in membership settings, we were incorrectly calculating if price has changed since the last save and showing the unsaved changes modal incorrectly.
2021-05-20 14:52:21 +05:30
Peter Zimon
5ca0ad0ef6 Replaced membership settings icon 2021-05-20 11:10:15 +02:00
Kevin Ansfield
eebdd4a835 Added radix to parseInt calls in changed-prices check
no issue

- `parseInt` doesn't default to base 10 so the radix argument is required
2021-05-20 09:13:39 +01:00
Aileen Nowak
e20e5775a6 Fixed requesting subscription before sending token
no issue

- The Ghost(Pro) billing app would request a token once mounted to which Ghost sends the response to
- Before, we wouldn't wait for the token to be sent and request subscription information from the Ghost(Pro) app straight away, which resulted in another token request (because it's not there yet)
- This change will wait for the token to be sent before requesting subscription information from the Ghost(Pro) app to avoid duplicated requests to our servers
2021-05-20 17:10:10 +12:00
Kevin Ansfield
3bed117b57 Fixed unsaved changes warning for prices when they've already been saved
no issue

- amount properties on the controller are set to strings rather than numbers so the comparison would still be false even if the "numbers" matched
2021-05-19 20:44:41 +01:00
Kevin Ansfield
6339770a67 Fixed "connect to stripe" button in portal settings modal
no issue

- passed correct action for opening stripe connect modal through to portal settings modal
- updated `<GhTaskButton>` to accept a `@unlinkedTask=true/false` property
  - ember-concurrency will throw warnings about unsafe task cancellation if the initiator of a task is destroyed due to the actions of a task. Eg. the stripe connect button being replaced with the plan checkboxes because stripe connect details are added to settings
  - to avoid warnings ember-concurrency expects the task initiation to be marked as "unlinked" so that the task is allowed to continue even though the initiator is destroyed
- updated `<GhSiteIframe>` to force a refresh when the `@guid` property changes
  - we want the portal preview to fully reload so that it can fetch server data and see that stripe is connected
- updated portal settings modal to initiate a refresh when switching from "connect to stripe" to the plans checkboxes that happens automatically after a successful stripe connection
2021-05-19 20:24:18 +01:00
Peter Zimon
70e57ae7c8 Added spinner for loading manually created subscription 2021-05-19 20:56:29 +02:00
Rishabh
f3e7cf6128 Fixed loading indicator on comped subscription
no refs
2021-05-20 00:15:22 +05:30
Rishabh
d3023e8b52 Added loading for assigning comped subscription to member
no refs

Adds loading indicator when member is being saved with new complimentary price
2021-05-19 23:18:20 +05:30
Kevin Ansfield
f9f925d923 Fixed "confirm leave" modal not showing if prices are unsaved in membership screen
no issue

- added `hasChangedPrices` method to check the controller's price properties against the active product prices
- check `hasChangedPrices` alongside changed settings when deciding if the confirm leave modal needs to be shown
- call a `resetPrices` method if a leave is forced which changes controller properties back to the amounts in the active product prices
2021-05-19 18:32:37 +01:00
Kevin Ansfield
5a3c9a54b1 Re-ordered memberships controller code
no issue

- put setup and leave methods at the beginning so it's clearer what is happening when the screen is navigated to / away from
- move "private" method to the end to keep it out of the way
2021-05-19 18:32:37 +01:00
Kevin Ansfield
32c9ee003f Removed unused portal-settings modal code from settings screen
no issue

- portal settings modal is now initiated from the membership screen so the code for showing/closing it in the settings controller is not needed
2021-05-19 18:32:37 +01:00
Rishabh
942ad319e8 Updated complimentary subscription assignment to member
no refs

With custom products, we added a new modal to add a complimentary price to a member. Since we want to handle the comp prices implicitly with new changes, this change updates the comp subscription assignment to a member directly without opening a modal, by using the old `comped` flag in API. The `comped` flag takes care of creating the right complimentary subscription for member.

In case a member already has a comped subscription, we hide the option to add another subscription.
2021-05-19 22:36:02 +05:30
Peter Zimon
a2e3e0c570 Updated disabled Portal view in Membership settings 2021-05-19 18:58:06 +02:00
Peter Zimon
84efeef8d1 Refined copy 2021-05-19 18:07:25 +02:00
Kevin Ansfield
d72a3ecaf0 Removed unused code from stripe-connect modal
no issue

- hangover from a copy/paste when re-arranging screens
2021-05-19 16:10:14 +01:00
Rishabh
4e6051a5bd Fixed portal plans change not triggering recompute
no refs

Portal plan settings are updated on the membership page when the plans are changed, but its not reflected in Portal settings because we were not updating the array the ember way.
2021-05-19 20:19:54 +05:30
Peter Zimon
d706d9f19b Minor membership related style refinements 2021-05-19 16:40:18 +02:00
Kevin Ansfield
471a3b8c0d Fixed portal settings modal sometimes having stale data
no issue

On the membership screen we save settings before opening the portal settings modal but we weren't waiting for the save to finish which meant that the portal settings modal could load using stale data.

- passed the save settings task in via the portal settings modal's model
- added a `finishPreloading` action that contains all of the dynamic setup tasks that were previously in the component's `init` method
    - if a preload task was passed in and it's currently running (as it would be if the modal is opened via the membership screen button) then it will wait for the task to finish before running the setup tasks
- trigger the `finishPreloading` action when the modal is rendered
- show a loading spinner in place of the modal contents whilst pre-loading
2021-05-19 15:37:06 +01:00
Rishabh Garg
69367de59e Added SSL precondition for Stripe Connect UI (#1967)
refs https://github.com/TryGhost/Team/issues/598

Stripe Webhooks require SSL in production, and so we should not be
allowing connecting to Stripe in production mode unless the site is
running with SSL. This change -

- Updates Setup wizard to skip Stripe Connect steps if site is not on SSL in production
- Adds warning on set subscriptions page

Co-authored-by: Peter Zimon <zimo@ghost.org>
2021-05-19 19:56:45 +05:30
Sanne de Vries
1222260e36 Styled access dropdowns pseudo-classes 2021-05-18 22:17:46 +02:00
Rishabh
e22d54ba3b Updated portal preview to update on price change
no refs

Portal preview on membership settings reflects the currently set monthly/yearly price directly by passing in the updated amount to portal preview URL
2021-05-18 23:00:10 +05:30
Kevin Ansfield
db09b317eb Added auto height adjustment to membership portal preview
no issue

- added `@onDestroyed` argument to `<GhSiteIframe>` so consumers can clean up any references
- used `@onLoaded` and `@onDestroyed` to handle a reference to the preview iframe
- updated portal preview load handler and update method to trigger a resize task
  - add a 100ms delay to allow for portal to re-render itself
  - reach through the two iframes to get the portal container element and use it's height to set the style attribute on the portal preview container element
2021-05-18 18:26:07 +01:00
Rishabh
2a0c2c3f48 Updated portal links UI to fixed values
no refs

We are reverting Portal links to use monthly/yearly for now instead of price ids, this change updates to use old nickname and if mapping.
2021-05-18 22:05:29 +05:30
Rishabh
f9672e7095 Updated portal plans on monthly/yearly price change
no refs

Portal plans setting contains list of prices that are allowed by site owner to use in Portal UI. Since we now switch monthly/yearly prices dynamically, we need to update portal plans on price change to still reflect updated monthly/yearly prices in Portal UI.
2021-05-18 21:50:38 +05:30
Kevin Ansfield
eecd6d03b6 Fixed linting error 2021-05-18 16:38:29 +01:00
Kevin Ansfield
602549097a Fixed flash of site when portal preview is loading
no issue

- added `@invisibleUntilLoaded` boolean argument to `<GhSiteIframe>`
  - when set to true add `.invisible` class until iframe's `load` event is triggered
- removed manual iframe hiding with 1.2sec delay from portal settings modal
- added `@onLoad` argument to `<GhSiteIframe>` for consumers to hook in if needed
2021-05-18 16:36:18 +01:00
Kevin Ansfield
b4a6eb594d Converted <GhSiteIframe> to a glimmer component
no issue

- updated to class syntax and glimmer component behaviour
- tidied up and standardised usage of the component
2021-05-18 16:08:13 +01:00
Rishabh
11be983d99 Filtered active monthly/yearly prices in portal settings
no refs

We only want to show currently active monthly/yearly prices in Portal and Portal settings based on new settings for price ids, and hide all other prices
2021-05-18 20:25:05 +05:30
Sanne de Vries
fcef76cebf Fixed responsive issues for membership settings 2021-05-18 15:59:32 +02:00
Rishabh
d2162f02a0 Added missing action modifier on memberships setup
no refs

Last commit missed the `action` modifier for setup method used in memberships screen insert.
2021-05-18 19:26:50 +05:30
Rishabh
d746265a52 Fixed active prices not read from settings
no refs

Previously, we were fetching product and prices in the constructor of the controller which did not guarantee settings were updated when picking active prices from the price list. This updates the setup to use `did-insert` modifier to correctly fetch and populate product/price data.
2021-05-18 19:17:25 +05:30
Kevin Ansfield
6b287a41c0 Hid button in memberships portal preview
no issue

- added button override to `getPortalPreviewUrl()` and set it to `false` when generating preview URL for memberships preview
2021-05-18 14:34:55 +01:00
Sanne de Vries
dce8d77cf0 Updated access settings dropdowns and icons 2021-05-18 15:10:42 +02:00
Kevin Ansfield
8a1ae88192 Added portal preview to memberships screen
no issue

- fixed styling issues
    - fixed portal preview taking over the screen by adding `position: relative` to the container
    - fixed portal preview being interactive by disabling pointer events
- added portal preview URL generation to memberships controller
    - moved much of the preview params knowledge/calculations from the `<ModalPortalSettings>` component into the `members-utils` service so that a portal preview URL can be generated from anywhere using current settings values rather than the method consumer needing to have knowledge of all params and how to generate them
    - updated actions in controller that modify settings to also update the preview url
    - added `onChange` event to the `<Settings/MembersSubscriptionAccess>` component so the controller can react and update preview
- used `<GhSiteIframe>` with generated portal preview URL for live display of portal changes on memberships screen
2021-05-18 13:59:57 +01:00
Peter Zimon
37de5f957d Updated launch wizard Stripe connect info styles 2021-05-18 14:15:44 +02:00
Peter Zimon
b9ba7045a4 Copy update on Member details 2021-05-18 11:42:16 +02:00
Peter Zimon
97866adb37 Minor spacing refinements on Membership settings 2021-05-18 11:09:42 +02:00
Rishabh
995b102617 Wired premium prices in membership settings
refs 4627d1c26a

- Adds new settings for monthly/yearly price ids in the settings modal
- Updates logic to save product on membership settings - Creates new prices for monthly/yearly when it doesn't exist, updates the monthly/yearly price ids in the settings
- Fixes selected currency value in dropdown
2021-05-18 13:41:36 +05:30
Sanne de Vries
a237dc73d9 Refined membership access settings 2021-05-17 19:36:36 +02:00
Peter Zimon
87e2a3db37 Refined currency dropdown 2021-05-17 18:12:49 +02:00
Peter Zimon
ee7ac5588a Fix tests 2021-05-17 17:39:41 +02:00
Peter Zimon
fa95868c36 Moved Stripe connect settings to modal 2021-05-17 17:28:39 +02:00
Rishabh
35612db851 Wired membership tiers UI in new members setting
no refs

- Wired Premium membership UI to existing monthly/yearly prices in the default product
- Wired free membership UI to redirect URI setting
- Updated save to validate settings/errors
2021-05-17 20:06:03 +05:30
Kevin Ansfield
686dadbeda Fixed errors when closing portal settings modal
no issue

- added actions for handling close/confirm/cancel of portal settings rather than re-using the route-level leave modal because the portal settings modal does not need any knowledge of the route
- added controller reset that is called when the route is exited to ensure no modals are shown when navigating back to the membership screen
- fixed "cannot set on destroyed" error when portal settings are opened and closed quickly
- removed usage of old `{{action}}` helper - this has been replaced with `{{on}}` and `{{fn}}`
2021-05-17 12:41:21 +01:00
Peter Zimon
c3748e4d18 Membership settings UI refinements
- added Portal mock container and background
- updated header behavior
2021-05-17 13:35:31 +02:00
Peter Zimon
bf3349ca0f Applied basic layout for membership settings
- created main blocks
- added tier forms
- added button for Stripe connect modal
2021-05-17 13:01:54 +02:00
Kevin Ansfield
27a2bc7722 Removed products options from members segment select
no issue

- we're currently limited to a single product so it doesn't make sense to show it as an option as it creates two different routes to "paid members" that we'd like to avoid for now
2021-05-17 10:15:37 +01:00
Kevin Ansfield
51536fb2ef Added icons to membership dropdown options
no issue

- add icon + icon color to the subscription access and default post access option lists
- updated templates to use icon in trigger and option display
- fixed ember-power-select styles overriding svgs in trigger
2021-05-17 09:42:44 +01:00
Rishabh
4c736d1c80 Added basic portal settings in new membership area
no refs

Members related settings are being consolidated into a single screen.

- Adds basic portal settings UI
2021-05-17 13:28:15 +05:30
Kevin Ansfield
de560733c5 🎨 Reverted ability to set post access level to labels
refs https://github.com/TryGhost/Team/issues/581

Setting post visibility to a label results in undesirable and confusing behaviour with no good way to manage access long-term. Coupled with products being limited to a single product for now we're reverting the UI back to the "Public", "Members", and "Paid" options.
2021-05-14 16:01:14 +01:00
Kevin Ansfield
42ef8df7ca Switched signup and default post access settings to dropdowns
no issue

- provides clearer indication of current setting without having to expand anything
- has more minimal UI which helps when settings screen has multiple areas
2021-05-14 15:44:10 +01:00
Kevin Ansfield
06ff9dfb10 Fixed unsaved confirmation when leaving membership settings screen
refs bdcbfcb92c

- previous commit missed rename of access route to membership
2021-05-14 15:35:07 +01:00
Kevin Ansfield
cb3b01c020 Extracted individual members setting blocks into components
no issue

- the membership setting screen will be covering a lot of areas, having individual settings as discrete components allows for easier re-organisation and cleaner parent templates and controllers
2021-05-14 15:01:50 +01:00
Kevin Ansfield
bdcbfcb92c Renamed access settings route to membership
no issue

Members related settings are being consolidated into a single screen.

- renamed access to membership as the starting point for redesign and consolidation of other settings screens
2021-05-14 14:33:18 +01:00
Peter Zimon
52d55a311a Fixed account menu positioning bug 2021-05-13 12:06:46 +02:00
Peter Zimon
8fab84418e Fixed button hover state bugs in dark mode 2021-05-13 11:47:14 +02:00
Peter Zimon
ba14318de0 Fix "Add subscription" button dark mode UI bug 2021-05-13 11:38:19 +02:00
Kevin Ansfield
4c9eeddd79 Lock file maintenance with fixes
no issue

- catch `undefined` error when saving posts in editor which is thrown by our validation system and handled elsewhere
- bumped `ember-power-select` and switched `ember-power-datepicker` to a github ref so dependency-update fixes are included (version not released yet, see https://github.com/cibernox/ember-power-datepicker/issues/61)
- added a resolution for `ember-basic-dropdown@3.0.16`, with the latest `3.0.17` nothing is shown for the publish/post-settings menus for the date picker dropdown
2021-05-12 15:47:37 +01:00
Rishabh
052c5f62a9 Fixed checkbox state not persisted in wizard
closes https://github.com/TryGhost/Team/issues/676

The checkbox state for portal plans was not stored between wizard pages and kept switching back to original state.
2021-05-12 17:20:32 +05:30
Kevin Ansfield
e584569914 Switch deprecated htmlSafe imports from @ember/string to @ember/template
no issue

See https://deprecations.emberjs.com/v3.x#toc_ember-string-htmlsafe-ishtmlsafe
2021-05-12 12:33:40 +01:00
Kevin Ansfield
74b08e19b8 Switch deprecated {{hasBlock}} to (has-block)
no issue

See https://github.com/emberjs/rfcs/blob/master/text/0689-deprecate-has-block.md
2021-05-12 12:33:40 +01:00
Rishabh
d776aedda4 Fixed interval for default price
no refs
2021-05-11 17:52:59 +05:30
Kevin Ansfield
b08716a981 Fixed publish menu email recipients not matching post visibility
no issue

- updated to use the NQL query that now exists in `posts.visibility` rather than the older `members` and `paid` values
2021-05-11 13:20:53 +01:00
Kevin Ansfield
92f041713b Removed additional options from visibility select when all members selected
refs https://github.com/TryGhost/Team/issues/581

- when free and paid members are selected it doesn't make sense to offer any other options because they will have no effect
- reduces confusion from showing options that get removed by the API as soon as they are selected
  - `status:free,status:-free,...` is always shortened to `members` (`status:free,status:-free` equivalent)
2021-05-11 12:23:34 +01:00
Kevin Ansfield
0357b984fb Fixed click on "Members-only" radio button in PSM not changing selection
no issue

- moved click handler so it applies to the whole button/field/select element
2021-05-11 12:14:26 +01:00
Sanne de Vries
df835fd4e2 Refined segment selector in post settings menu and email newsletter settings
Refs https://github.com/TryGhost/Team/issues/581
2021-05-11 13:09:52 +02:00
Peter Zimon
8af115aeee Custom product copy refinements 2021-05-11 11:55:24 +02:00
Rishabh
d08264e4f9 Fixed set pricing page default view
no refs

It may take couple of seconds before we fetch product information on set-pricing launch wizard, we don't want to show the subscription is set message till the loading is complete.
2021-05-11 14:12:40 +05:30
Rishabh
ba993686a3 Removed default currency option in payment settings
no refs

The default currency option is not currently mapped to the relevant setting, so its hidden till the new setting is added for default currency.
2021-05-11 14:10:44 +05:30
Kevin Ansfield
95b450d412 Fixed linting 2021-05-10 20:38:07 +01:00
Kevin Ansfield
3e4b9a6865 🎨 Updated post settings menu visibility option to support member segments
https://github.com/TryGhost/Team/issues/581

The API now supports `posts.visibility` being an NQL string as well as the special-case `'members'` and  `'paid'` values so the post settings menu visibility select needs to be updated to reflect that.

- swapped visibility dropdown for two radio buttons, "Public" and "Members-only" which uses the `<GhMembersSegmentSelect>` component
- updated post model to use a `visibility-string` transform
  - converts `members` and `paid` to/from the NQL equivalent for correct display in the segment select
- updated post model with two additional properties `isPublic` and `visibilitySegment`
  - `isPublic` helps with the radio button display
  - `visibilitySegment` allows fallback to the default content visibility setting when set to public
- added validation for `post.visibility` so we can show an error and skip saving when members-only is selected and the segment select is cleared
- deleted the now-unused `<GhPsmVisibilityInput>` component
2021-05-10 20:34:23 +01:00
Peter Zimon
c47be38785 Updated site wizrd copy 2021-05-10 21:16:33 +02:00
Rishabh
2862d68f99 Fixed add price not erroring on empty amount
refs https://github.com/TryGhost/Team/issues/641

Updated error handling for empty amount on price modal
2021-05-11 00:18:45 +05:30
Rishabh
d3ac517056 Updated set pricing wizard if custom price exists
no refs

If a custom price is already set before completing the wizard, the set pricing wizard hides the UI to create default custom prices as it doesn't make sense and instead shows a custom message.
2021-05-11 00:17:28 +05:30
Rishabh
67d0c94c40 Removed dev experiment flag for custom products
closes https://github.com/TryGhost/Team/issues/672

Custom products and prices were behind dev experiment flag as it was under active development over last couple of releases. Now that its coming out of development, this removes the dev flag for custom products changes.
2021-05-10 23:38:47 +05:30
Rishabh
c449e32121 Cleaned add subscription prices for member details
closes https://github.com/TryGhost/Team/issues/678
closes https://github.com/TryGhost/Team/issues/681

The prices in "Add subscription" modal should follow the same ordering as on the product detail screen, ie. currency, amount. Also, we only want to allow adding subscriptions for active prices, so the list is filtered on that. Since a Stripe customer is not allowed to have subscriptions in multiple currencies, this also filters the available currency prices based on any active subscription for a member.
2021-05-10 22:25:01 +05:30
Rishabh
d3efc29f08 Added error handling for price modal
refs https://github.com/TryGhost/Team/issues/678

Covers error handling for missing name/amount/billing period for a price modal when adding a new price or editing existing price.
2021-05-10 20:59:05 +05:30
Rishabh
42463e4fdd Added error handling for product details page
refs https://github.com/TryGhost/Team/issues/678

Product name is a mandatory field for a custom product, this change adds error handling on save and custom error message if product is attempted to save without name.
2021-05-10 19:18:30 +05:30
Rishabh
76319c2717 Updated price description to sentence case
closes https://github.com/TryGhost/Team/issues/680

We use sentence case for labels everywhere, updating price descriptions to use the same.
2021-05-10 18:48:39 +05:30
Naz
a1aa9be287 Fixed hardcoded limit error message
refs https://github.com/TryGhost/Team/issues/588

- When the email limit was reached the hardcoded "members" error message was shown. Have changed implementation of the upgrade modal to take the "message" coming from the server into account
2021-05-10 15:04:10 +04:00