Commit Graph

2910 Commits

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