Commit Graph

1277 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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