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
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
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
- fixed dark mode product card color bug
- fixed no. of benefits counter on product card
- removed "Available in Portal" badge (all products are available)
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
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
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
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
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
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'
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
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`
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)
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
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
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
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
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
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
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
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
no issue
- previously only Owner staff users could access the email settings screens despite Administrators having server-side permissions to change the related settings
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
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
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
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
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
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
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
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
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
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
no issue
- added generic members filter component
- updated `<GhRecipientFilterCount />` to use the new generic component with `subscribed:true` added to the filter
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
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
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
- 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
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
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
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>`
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)
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
- 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
- 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
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
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.
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>
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.
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.
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
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.
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.
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.
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.
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.
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`
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`
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
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
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
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
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
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.
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
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
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
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
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
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
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.
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.
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
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.
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.
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
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>
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
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
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)
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.
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
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.
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
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
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
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.
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.
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
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
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
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
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
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
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.
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.
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
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>
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
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
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.
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
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
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.
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
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
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
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}}`
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
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
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.
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
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
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
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
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)
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.
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
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.
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.
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.
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.
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.
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