Commit Graph

11 Commits

Author SHA1 Message Date
Kevin Ansfield
060d791a63 Removed need for .get() with settings service
no issue

The `settings` service has been a source of confusion when writing with modern Ember patterns because it's use of the deprecated `ProxyMixin` forced all property access/setting to go via `.get()` and `.set()` whereas the rest of the system has mostly (there are a few other uses of ProxyObjects remaining) eliminated the use of the non-native get/set methods.

- removed use of `ProxyMixin` in the `settings` service by grabbing the attributes off the setting model after fetching and using `Object.defineProperty()` to add native getters/setters that pass through to the model's getters/setters. Ember's autotracking automatically works across the native getters/setters so we can then use the service as if it was any other native object
- updated all code to use `settings.{attrName}` directly for getting/setting instead of `.get()` and `.set()`
- removed use of observer in the `customViews` service because it was being set up before the native properties had been added on the settings service meaning autotracking wasn't able to set up properly
2022-10-07 16:14:57 +01:00
Simon Backx
bc1aa493fa 🐛 Fixed unreliable paid members enabled checks (#2405)
refs https://github.com/TryGhost/Team/issues/1650

- Some places only checked for Stripe being connected via the 'connect' method and ignored the 'direct' method
- Updated (where possible) admin to use the new calculated `paid_members_enabled` setting
2022-05-24 16:53:03 +02:00
Gabriel Csapo
d51f2bcf23 [chore] migrate to eslint@8 and run --fix (#2256)
closes https://github.com/TryGhost/Admin/pull/2107

- updated related babel dependencies
- bumped eslint
- ran `yarn lint:js --fix`
- added eslint ignore comments for some required non-camel-case properties
2022-02-10 10:41:36 +00: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
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
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
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
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
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
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