Commit Graph

7018 Commits

Author SHA1 Message Date
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
Daniel Lockyer
987a6d9c29 v4.6.2 2021-05-27 08:17:23 +01:00
Kevin Ansfield
f45f250a1d Sorted snippets alphabetically in card menus
no issue

- more logical ordering
2021-05-26 20:29:41 +01:00
Daniel Lockyer
28d9a4e6c4 v4.6.1 2021-05-26 18:46:08 +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
Daniel Lockyer
7714431d39 v4.6.0 2021-05-25 15:11:56 +01:00
Peter Zimon
efb036f9f1 Refined icon color 2021-05-25 14:00:22 +02:00
renovate[bot]
c2ebf91365 Update dependency ember-test-selectors to v5.3.0 (#1978)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-25 11:08:14 +01:00
renovate[bot]
e28fc4255c Update dependency grunt to v1.4.1 (#1976)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-25 11:07:17 +01: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
renovate[bot]
8862960974 Fixed indescribable error in theme limit
refs f51c640fb0

- This should not affect any of the current code but should improve edge case errors related to "allowlist" types of limits
2021-05-24 22:07:48 +12:00
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
Renovate Bot
eb5536d8a4 Update dependency eslint to v7.27.0 2021-05-24 01:11:19 +00:00
renovate[bot]
e1f1732db3 Pin dependency tracked-built-ins to 1.1.1 (#1973)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-21 18:23:08 +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