Commit Graph

313 Commits

Author SHA1 Message Date
Naz
55785d0958 Added toggle for the emailOnlyPosts flag
closes https://github.com/TryGhost/Team/issues/902

- Toggle will control the `emailOnlyPosts` labs flag enabling "email-only posts" feature
2021-08-02 13:32:03 +04:00
Kevin Ansfield
45d4036faf Fixed incorrect text color for accent-color backgrounds for some accent colors
refs https://github.com/TryGhost/Team/issues/928

- text color was being selected based on original rather than adjusted accent color
2021-07-29 15:41:36 +01:00
Kevin Ansfield
0d092c2e32 Switched to extracted @tryghost/color-utils package
refs https://github.com/TryGhost/Team/issues/928

- we want to make use of the same color adjustments and contrast selection for accent colors we use in Admin on the server-side for emails so utility functions have been extracted to an external package
2021-07-29 11:35:15 +01:00
Kevin Ansfield
eed299d1f6 Matched Portal's contrast threshold for white/black text on background color
refs https://github.com/TryGhost/Team/issues/928

- switched to using `color` for color conversion and adjustments rather than maintaining our own limited utils (preparation to extract our own utils to separate library)
- changed contrast threshold for yiq-based contrast adjustment from `128` to `186` to match Portal's current behaviour
2021-07-28 17:14:33 +01:00
Kevin Ansfield
4e0473a93e Added CTA button and URL input to email-cta card
refs https://github.com/TryGhost/Team/issues/927

- added CTA `button and url inputs to email-cta card
- added `textColorForBackgroundColor` color util and used it to add a white/black text color variable that can be used when the accent color is used as a background color
- added `{{hex-adjust}}` helper for modifying lightness and saturation of a hex color
- adjusted inline power-select dropdown styling
2021-07-26 17:03:17 +01:00
Kevin Ansfield
9cfb024a5f Moved adjusted accent color properties to ui service
refs https://github.com/TryGhost/Team/issues/927

- we'll soon need access to adjusted accent colours outside of the application controller so they're now available on the `ui` service
2021-07-26 17:03:17 +01:00
Naz
75f0589fab Added toggle for the email check flag
refs https://github.com/TryGhost/Team/issues/912

- The toggle is needed to experiment with email verification
2021-07-23 20:00:27 +04:00
Rishabh
ad3126b632 Added alpha feature flag for members filtering feature
refs https://github.com/TryGhost/Team/issues/925
2021-07-21 21:21:50 +05:30
Thibaut Patel
a7f47b30b7 Added a feature flag to the oauth login feature
issue https://github.com/TryGhost/Team/issues/614

- Makes the feature confiration more similar to other feature flags
2021-07-20 23:18:45 +02:00
Kevin Ansfield
876c2b6cdd Added first pass at feature image drag+drop uploading
refs https://github.com/TryGhost/Team/issues/884

- add `[data-user-is-dragging]` to `body` element when any drag is occurring so that we can make drop zones active
- added dropzone and drop handling to feature image component
2021-07-16 15:01:00 +01:00
Kevin Ansfield
9bc799258d Fixed more tests
refs 8630be5a87

- referenced commit skipped current user and proxy service population when `skipAuthSuccessHandler` was set but the population is needed during setup
- `skipAuthSuccessHandler` is used for skipping the post-authentication transition rather than skipping all post-auth behaviour so the the post-auth behaviour was reintroduced but put in a guard so we don't try to do it again when it's already been run
2021-07-14 13:15:59 +01:00
Kevin Ansfield
a7dc63cfab Fixed tests
refs 8630be5a87

- referenced commit introduced an early return when invalidating session on a failed ajax request so that error alerts weren't shown when re-authenticating. This had an unintended side-effect of breaking invalidation when not re-authenticating and redirecting to signin screen
2021-07-14 12:55:23 +01:00
Kevin Ansfield
8630be5a87 🐛 Fixed re-authenticate modal not showing when saving in editor
closes https://github.com/TryGhost/Team/issues/865

Ghost now returns a forbidden error rather than an unauthorized error when saving whilst logged out so the session invalidation was not being triggered.

- added forbidden check to ajax service to trigger session invalidation
- added automatic retry of save in editor when re-authenticating
- fixed re-population of user and proxy services when re-authenticating, it's not needed at that point because nothing has been cleared
2021-07-14 12:28:09 +01:00
Kevin Ansfield
c646e78fff Made session.user a synchronous property rather than a promise
no issue

Having `session.user` return a promise made dealing with it in components difficult because you always had to remember it returned a promise rather than a model and had to handle the async behaviour. It also meant that you couldn't use any current user properties directly inside getters which made refactors to Glimmer/Octane idioms harder to reason about.

`session.user` was a cached computed property so it really made no sense for it to be a promise - it was loaded on first access and then always returned instantly but with a fulfilled promise rather than the  underlying model.

Refactoring to a synchronous property that is loaded as part of the authentication flows (we load the current user to check that we're logged in - we may as well make use of that!) means one less thing to be aware of/remember and provides a nicer migration process to Glimmer components. As part of the refactor, the auth flows and pre-load of required data across other services was also simplified to make it easier to find and follow.

- refactored app setup and `session.user`
  - added `session.populateUser()` that fetches a user model from the current user endpoint and sets it on `session.user`
  - removed knowledge of app setup from the `cookie` authenticator and moved it into = `session.postAuthPreparation()`, this means we have the same post-authentication setup no matter which authenticator is used so we have more consistent behaviour in tests which don't use the `cookie` authenticator
  - switched `session` service to native class syntax to get the expected `super()` behaviour
  - updated `handleAuthentication()` so it populate's `session.user` and performs post-auth setup before transitioning (handles sign-in after app load)
  - updated `application` route to remove duplicated knowledge of app preload behaviour that now lives in `session.postAuthPreparation()` (handles already-authed app load)
  - removed out-of-date attempt at pre-loading data from setup controller as that's now handled automatically via `session.handleAuthentication`
- updated app code to not treat `session.user` as a promise
  - predominant usage was router `beforeModel` hooks that transitioned users without valid permissions, this sets us up for an easier removal of the `current-user-settings` mixin in the future
2021-07-08 14:54:31 +01:00
Kevin Ansfield
1cfa0ae58e Added saved post status indicator behind labs flag
refs https://github.com/TryGhost/Team/issues/779

- add "- Saved" to status text in editor when a post has no unsaved changes
- uses `savedIndicator` labs flag so we can test and tweak behaviour before go-live
2021-07-07 11:37:52 +01:00
Kevin Ansfield
3d16b95e0f 🎨 Adjusted post settings menu design so it can stay open whilst editing
refs https://github.com/TryGhost/Team/issues/840

We wanted to switch to a settings menu that stays open to the right of the editor rather than a popover that blocks all other interaction with the post to solve two use-cases:

1.  when editing it's fairly common to select some text from the post contents when setting excerpt and meta data text, with the previous design not letting you scroll or select whilst the menu got in the way of that
2. having the menu open with meta data visible before publishing can help you see everything is set as you want and help you feel confident when publishing/sending content

---

- removed `psmRedesign` labs flag
- swapped labs component/css for main component and deleted labs component
- cleaned up now-unused `ui.showSettingsMenu` property and related actions/classes
2021-07-02 19:04:57 +01:00
Thibaut Patel
a07b40440d Moved the gated email card feature behing an alpha flag
issue https://github.com/TryGhost/Team/issues/842
2021-07-02 12:14:55 +02:00
Kevin Ansfield
f752e24f7a Added post feature image alt and caption support to editor (#2026)
refs https://github.com/TryGhost/Team/issues/839

The feature image uploader in the post settings menu did not lend itself well to having additional fields so we've moved it into the main editor canvas. This allowed us to use the familiar caption/alt fields from image cards and to let the feature image feel more connected to the post's contents and part of the editing workflow.

---

- removed `featureImageMeta` labs flag
2021-07-01 17:56:39 +01:00
Kevin Ansfield
14b31ae5a1 Migrated ui service to native class syntax
no issue

- switched to class syntax, tracked properties, getters, and dropped actions object for top-level action functions
2021-07-01 10:11:08 +01:00
Kevin Ansfield
73d4ac8a26 Made server unreachable and maintenance error request retries application-wide
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
2021-06-30 14:51:40 +01:00
Rishabh
cef44533d9 Moved portal_products in preview behind feature flag
no refs

- only uses `portalProducts` value in portal preview url if the multiple products flag is turned on
2021-06-29 12:19:20 +05:30
Rishabh Garg
274044e253 Added UI for portal products (#2010)
refs https://github.com/TryGhost/Team/issues/768

- adds portal products selection UI behind flag on portal settings screen
2021-06-21 14:21:48 +05:30
Kevin Ansfield
4482aa5395 Added alpha labs flag for PSM redesign
refs https://github.com/TryGhost/Team/issues/786

- adds flag checkbox to labs page
- duplicates psm component ready for changes
2021-06-17 14:10:32 +01:00
Kevin Ansfield
1b85b9244b Updated email previews to show full from email address
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
2021-06-11 16:42:27 +01:00
Kevin Ansfield
645fd18a80 Fixed syntax error 2021-06-11 12:22:12 +01:00
Kevin Ansfield
9adfad67d2 Added <GhMembersFilterCount @filter="..." />
no issue

- added generic members filter component
- updated `<GhRecipientFilterCount />` to use the new generic component with `subscribed:true` added to the filter
2021-06-11 12:19:44 +01:00
Kevin Ansfield
bd60c8089b 🐛 Fixed confusing member count shown in save notification and editor header
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
2021-06-11 11:44:50 +01:00
Kevin Ansfield
ceb16b5e9f Added first version of feature image with caption inside editor (#1999)
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
2021-06-10 20:42:32 +01:00
Rishabh
afa06a08b0 Updated multiple products UI behind feature flag
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
2021-06-09 16:14:48 +05:30
Rishabh
ab069c5b81 Added UI for multiple products labs 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
2021-06-09 15:45:37 +05:30
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
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
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
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
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
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
da49dc4922 Added default newsletter recipients setting (#1946)
refs https://github.com/TryGhost/Team/issues/496
reqs https://github.com/TryGhost/Ghost/pull/12925

The publish menu was meant to default to matching post visibility but that wasn't working consistently and didn't make sense for sites which don't email every post to their members.

A "Default newsletter recipients" option has been added to the "Email newsletter" settings screen and the publish menu updated to reflect the option. The free/paid toggles in the publish menu have also been swapped out for a multi-select style component that will cater to more complex member segmentation.
2021-05-07 10:02:19 +01:00
Rishabh
5d2e456f61 Handled custom prices in portal settings
refs https://github.com/TryGhost/Team/issues/637

Updates Portal settings to use list of custom prices for default product instead of hardcoded Monthly/Yearly
2021-05-04 21:42:48 +05:30
Naz
abfbaa8d9b Added upgrade moal when unsuspending staff user
refs https://github.com/TryGhost/Team/issues/587

- Previous behavior wa showing a generic API error in the top banner which wasn't ideal UX
- With these changes user is informed about the limitation before performing any action with clear call to upgrade through the billing page
2021-04-28 18:07:18 +04:00
Kevin Ansfield
b7d7cbb269 Updated portal preview to pass allowSelfSignup as query param
refs https://github.com/TryGhost/Team/issues/579

- portal reads `allowSelfSignup` from config at startup and so won't show the free plan if it was not selected when preview is first opened
- updated `membersUtils.getPortalPreviewUrl()` to duplicate the `allowSelfSignup` logic from the server so it can be passed through to portal dynamically
2021-04-27 18:35:05 +01:00
Thibaut Patel
8c874904d6 Added UI for setting OAuth settings
issue https://github.com/TryGhost/Team/issues/614
2021-04-22 19:41:41 +02:00
Thibaut Patel
53d77d82df Added an upgrade modal to the custom theme activation failure scenario
no issue

- The modal only appears when the user hits a limitation trying to activate a custom theme not part of the allowlist (if the custom theme allowlist is configured)
- Changed the upgrade button to green to match the design
2021-04-20 19:15:33 +02:00
Kevin Ansfield
cf7a763199 Removed usage of deprecated EmberSimpleAuth mixins (#1910)
refs https://github.com/TryGhost/Admin/pull/1901

Ember has deprecated mixins in preparation for 4.0 and `ember-simple-auth` has now done the same in 3.1.0.

- removed all imports of Ember Simple Auth mixins
- moved authenticated and invalidated handling from application route to session service
- moved server-notification loading from application route to session service
- updated `AuthenticatedRoute` to use the session service directly rather than authenticated route mixin
- added `UnauthenticatedRoute` that incorporates the behaviour from our overridden `UnauthenticatedRouteMixin` and switches to using the session service directly
2021-04-12 13:21:57 +01:00
Thibaut Patel
7b99c555c5 Fix the limit service when querying an empty config
commit d350a58769
2021-04-09 11:16:37 +02:00
Naz
8756ddac53 Fixed staff limit check to filter out "Contributors"
refs https://github.com/TryGhost/Team/issues/587

- Invites and users with "Contributor" roles should not be counted towards the limit
2021-04-08 21:11:16 +12:00
Naz
de97328c42 Fixed staff limit check query to take into account inactive users
refs https://github.com/TryGhost/Team/issues/587

- Users with 'inactive' status should not be counted towards the "staff" limit
2021-04-08 20:07:24 +12:00
Naz
40cedb84ff Added integration with limit service
refs https://github.com/TryGhost/Team/issues/587

- This is first pass on the frontend limit-service integration. Max count queries are substituted with HTTP requests to mimick backend checks. Note, they are not meant to substitute backend checks only to suplment them.
2021-04-08 16:59:56 +12:00
Rish
803523c31d 🐛 Fixed incorrect member count on dashboard
closes https://github.com/TryGhost/Team/issues/561

In case the last event for a new member on site was before 30 day period, the count for members was showing 0 instead of the actual value. The change fixes the count to show the correct value even if there is no new recent member activity.
2021-03-24 21:56:35 +05:30
Aileen Nowak
d2dd33411a Changed /billing route to /pro (#1871)
no issue

The current `/billing` route needs to be renamed into `/pro`, so we can use sub-routes like `/pro/billing` and `/pro/domain` in the billing app.
2021-03-23 11:59:52 +00:00
Rishabh Garg
74e2d3ef8c 🐛 Fixed MRR start date value in chart (#1865)
no refs

MRR start date value for charts was being calculated with start value as 0, assuming we have the data for first date in our range to use as start value. Since the events data returned only has data on dates where any MRR event happened, in case the first date in our range didn't have any. data we started from 0 instead of value on previous date. This fix

- updates calculation to pick the start value for chart based on value on last date in our range(30 days)
- adds unit tests for stats
2021-03-15 15:23:55 +05:30
Kevin Ansfield
287c98c707 Fixed membersStats service stale-data logic
no issue

- the stale data checks would always return false because the calculation was reversed
  - `old date - new date` will always result in a negative number so it would never be greater than 60000
  - switched to `new date - old date` to get a positive number so the `>` comparison works
  - moved `1 * 60 * 1000` into a constant so it's easier to the intended behaviour at a glance
2021-03-10 10:06:06 +00:00
Hannah Wolfe
32599caa90 Updated to handle new Config API response
refs: https://github.com/TryGhost/Team/issues/510

- The config API has been changed to return the full hostSettings key, not just the billing URL
- This has been done because we are adding more config, and it's easier to reason about if Admin has the same config as server
- Proxying each value also requires multiple updates to the API each time
- This updates all the places where the old values were used
2021-03-04 21:26:24 +00:00
Kevin Ansfield
e66bb4feac Removed tour feature
refs 10b48b1d6d
refs 1531712d92

- the tour feature is no longer used so all associated code can be removed
- removes `liquid-tether` dependency as it was only used by the tour throbbers/popovers
2021-03-02 14:29:26 +00:00
Rish
137071500f Cleaned calculation for total/paid member count
refs https://github.com/TryGhost/Team/issues/469

- Fixed calculation for total/paid member count to use last value from outside range
- Fixed stats data override in dashboard
2021-02-25 21:19:10 +05:30
Rish
ee1bb32113 Cleaned newsletter open rate stats
refs https://github.com/TryGhost/Team/issues/469

- Cleaned up newsletter open rate stats and summary data
- Fixed incorrect cached value for open rate charts
2021-02-25 13:34:34 +05:30
Peter Zimon
92dbc288ec Updated open rate chart
- changed to bar chart
- added handling of empty dataset
2021-02-23 13:54:23 +01:00
Fabien O'Carroll
110335c7ac Updated fetching event timeline to accept limit
refs https://github.com/TryGhost/Team/issues/469

We want to allow the consumer of the data to be able to specify how much
data to fetch.
2021-02-23 12:44:17 +00:00
Rish
670d20bda5 Fixed newsletter charts data format
refs https://github.com/TryGhost/Team/issues/469

Uses updated data structure for newsletter charts, also updates to calculated openRate value
2021-02-23 03:16:10 +05:30
Rish
f1ea66fb5f Filled defaults for newsletter open stats
refs https://github.com/TryGhost/Team/issues/469

Pads newsletter stats in case of insufficient data with empty values for line chart
2021-02-23 02:48:47 +05:30
Rish
624001b15e Cleaned up mrr and count stats
refs https://github.com/TryGhost/Team/issues/469

- Cleans up incorrect values for mrr and count stats
2021-02-22 14:01:08 +05:30
Rish
e554e26b02 Added newsletter open rate stats
refs https://github.com/TryGhost/Team/issues/469

- Adds new chart to track newsletter open rates on dashboard
2021-02-22 14:01:08 +05:30
Peter Zimon
c83e54f21b Updated MRR chart style 2021-02-19 13:09:01 +01:00
Rishabh Garg
b7ae1233bf Updated MRR and count dashboard charts (#1846)
refs https://github.com/TryGhost/Team/issues/469

- Cleaned MRR stats data and label formatting
- Cleaned member counts stats - total and paid
2021-02-19 11:18:01 +05:30
Rish
d7cf0b4042 Fixed empty data handling for mrr chart
refs https://github.com/TryGhost/Team/issues/469
2021-02-19 00:49:59 +05:30
Rish
05df2bbad4 Added initial charts for dashboard
refs https://github.com/TryGhost/Team/issues/469

- Added MRR chart for last 30 days
- Added initial chart for Total member count
2021-02-18 22:20:58 +05:30
Fabien 'egg' O'Carroll
c56ba0c71e Added initial event timeline to dashboard (#1840)
refs https://github.com/TryGhost/Team/issues/469

* Updated stats service to fetch event timeline
* Updated dashboard controller to load events
* Added currency utils
* Added GhEventTimeline component
* Updated dashboard to render GhEventTimeline
2021-02-18 14:17:10 +00:00
Rish
9794fb4268 Fixed portal plan params in preview mode
refs 7687571b12

While extracting the portal preview url setup to member-utils, the util incorrectly referenced values for free/monthly/yearly plans and so stopped reacting to selected plans in Portal preview. This change fixes the `isFreeChecked`, `isMonthlyChecked` and `isYearlyChecked` references in util.
2021-02-11 00:10:37 +05:30
Kevin Ansfield
b4e750466d Hid tour throbbers when opening launch wizard
refs https://github.com/TryGhost/Team/issues/460

- add `showTour` property to `ui` service
- updated `<GhTourItem>` to not render anything if `ui.showTour` is `false`
- updated launch wizard template to hide tour when open and re-enable when closed
2021-02-09 11:43:44 +00:00
Kevin Ansfield
fc317cd75d Fixed yearly price showing monthly price in portal preview
refs https://github.com/TryGhost/Team/issues/460

- fixed copy/paste issue with wrong variable name being used for `yearlyPrice` query param
2021-02-09 08:52:14 +00:00
Kevin Ansfield
f470549e80 Hid launch-site link on dashboard once wizard is completed
refs https://github.com/TryGhost/Team/issues/460

- use the `user.accessibility` field via the `feature` service to add a `launchComplete` property
  - this is the best place we have currently for UI-specific concerns
- toggle the property to `true` when the "Launch!" button is clicked in the final wizard step
- hide the launch site wizard link on the dashboard if launch has been completed
2021-02-04 18:35:19 +00:00
Kevin Ansfield
7687571b12 Updated launch wizard pricing step to show portal preview
refs

- dropped the portal service in favour of using the existing `membersUtils` service
    - renamed `getPreviewUrl()` to `getPortalPreviewUrl()`
- update the iframe src to point to the portal preview url when on the pricing step
- added free/monthly/yearly checkboxes to pricing step
- update iframe src with regenerated portal preview params when making changes
2021-02-02 16:08:07 +00:00
Kevin Ansfield
d520e2b079 Extracted portal preview url generation into service
no issue

- allows for preview url generation to be shared across the portal design settings screen and the payment setup step of the launch wizard
2021-02-02 16:08:07 +00:00
Peter Zimon
04d9caefed Updated navigation (#1832)
no issue

Updated settings navigation to a completely redesigned flow for Ghost 4.0 🎉

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
Co-authored-by: Fabien O'Carroll <fabien@allou.is>
Co-authored-by: Rish <zrishabhgarg@gmail.com>
2021-02-02 16:08:06 +00:00
Kevin Ansfield
63c1f2060c Added stripe connection to launch site wizard
refs https://github.com/TryGhost/Team/issues/450

- duplicated and refactored/updated direct and connect settings UI from labs to the "connect stripe" step of the launch site wizard
- updated wizard buttons to be right-aligned
2021-01-19 22:31:59 +00:00
Aileen Nowak
abc38ab375 Updated links to ghost.org sites
no issue

Follow-up task of the updated Ghost Docs structure. Updated links reflecting the new structure to prevent unnecessary 404s and redirects.
2021-01-19 13:18:59 +13:00
Rishabh Garg
464e601c4d Added new FirstPromoter integration (#1825)
no issue

Adds new FirstPromoter integration on the integrations page. FirstPromoter enables sites to launch their own members referral program, and integration allows Site admins to directly add their FirstPromoter tracking ID in the settings to enable FirstPromoter script on their site.
2021-01-15 20:01:40 +05:30
Harsh Maur
78513b7998 🐛 Fixed flash of unstyled content appearing when toggling night mode (#1818)
closes https://github.com/TryGhost/Ghost/issues/12396

We use two stylesheets ghost-light.css and ghost-dark.css for light mode and night mode respectively. The problem occurs when we disable the light stylesheet when we enable dark stylesheet, as there is a moment when there is no style applied. This causes flash of unstyled content (or a big logo when users flip the night mode switch)

Since the ghost-dark style is loaded after the ghost-light stylesheet, we only need to enable or disable the dark stylesheet. When the dark stylesheet is enabled, the light stylesheet will be overridden automatically by the browser. I could not find any performance implications on overriding styles. The only performance implication is around loading a new stylesheet which we already do.
2021-01-12 09:45:33 +00:00
Rishabh Garg
f068e40723 Added new members CSV importer (#1797)
no refs
depends on https://github.com/TryGhost/Ghost/pull/12472

The members CSV importer gets an overhaul and works with new importer module in members service, performing the import in a background job when the import will take too long to complete in a reasonable time and send an email with data on completion. Also includes updated CSV mapping UI and error handling to allow easier import from different type of exports.

Co-authored-by: Fabien O'Carroll <fabien@allou.is>
Co-authored-by: Peter Zimon <zimo@ghost.org>
2020-12-10 01:02:31 +05:30
Kevin Ansfield
ca97f84cad Added emailAnalytics feature flag
no issue

- email analytics feature has a potential to be resource-intensive so it may be switched off via config, when this is the case we don't want to show stats in the admin that are out of date or won't be added/updated
- fixed page link titles saying "Edit this post" instead of "Edit this page"
2020-12-02 11:47:34 +00:00
Peter Zimon
94581a87f8 Added newsletter customisation options (#1756)
no-issue

This adds three initial customisation options for newsletters:
  1. Show/Hide site title and logo
  2. Set font to serif/sans serif
  3. Display a publish with Ghost badge

This is the first step in allowing customisation of the look and feel of newsletters.

Co-authored-by: Rish <zrishabhgarg@gmail.com>
Co-authored-by: Peter Zimon <zimo@ghost.org>
2020-11-12 14:45:22 +00:00
Nazar Gargol
240edf89aa Added automatic 'first_name' column mapping for members CSV importer
no issue

- When columns which match /name/ patter are present in imported CSV they should detect the mapping to 'name' column automatically
2020-08-20 15:04:35 +12:00
Kevin Ansfield
45a857c951 Fixed {{gh-pluralize}} errors
refs fd91b593a5

- fixed incorrect call `pluralize(undefined, {withoutCount: true})` when number is undefined - `pluralize()` expects only one argument when no number is provided
- fixed destructuring in ghPluralize
- fixed linting error for undefined method after removal of `formatNumber` import
- fixed typo of import path in members controller
2020-08-10 11:37:21 +01:00
Kevin Ansfield
fd91b593a5 Added number formatting to all pluralized counts
closes https://github.com/TryGhost/Ghost/issues/12110

- adds `{{gh-pluralize}}` helper that wraps the `{{pluralize}}` helper from `ember-inflector` but formats the number using our `{{format-number}}` helper
- updates all uses of `{{pluralize}}` to `{{gh-pluralize}}`
2020-08-10 11:16:03 +01:00
Rish
59ce29e19a Added custom error message handling for newsletter email failures
refs https://github.com/TryGhost/Ghost/issues/11971

- Newsletter preview email request has been using hardcoded fixed error message
- Reads custom error message from server's API response to show when available
2020-07-17 13:54:31 +05:30
Peter Zimon
c611f65f53 Refined members import modal
no refs.
- fixed title logic
- fixed stripe validation message
2020-07-09 12:12:53 +02:00
Nazar Gargol
4f56e77db5 Updated members uploader mapper logic to map all known types 2020-07-09 20:52:12 +12:00
Nazar Gargol
bcfc3792cd Removed invalid and duplicate email validations in members importer 2020-07-09 17:55:40 +12:00
Peter Zimon
36613212bb Fixed test for member import validation
no refs.
- fixed copy for member import validation test
2020-07-08 16:05:44 +02:00
Peter Zimon
3f0f3f1b68 Added number formatting to members import
no refs.
- added number formatting to all the screens of members import
2020-07-08 15:51:12 +02:00
Peter Zimon
5d261bfde8 Added pluralisation to members import
no refs.
- added correct pluralisation to pre- and post-validation copy of members import
2020-07-08 13:09:23 +02:00
Peter Zimon
6511a47524 Fixed tests
no refs.
2020-07-07 18:18:00 +02:00
Peter Zimon
1dd2a3db07 Updated styles for members import
no refs.
- added spinner to validation state
- applied styles to pre-validation step
- applied styles to import results
2020-07-07 17:53:59 +02:00
Nazar Gargol
39c4fec9ea Improved validation process for members CSV import
no issue

- A new validation stage has been introduced as a second step after CSV file has been dropped. It is meant to catch any obvious validation errors and output detailed statistics about
- These improvements also improve sampling logic which increases sample size to 30 non-empty cells which are used to validate stripe_customer_ids when there's such need.
- New sampling logic also introduces improved automatic field type detection which allows to better map email and stripe_customer_id fields to CSV columns
2020-07-07 00:28:30 +12:00
Peter Zimon
09f4a48bc5 Refined styles and copy for member import dialog
no refs.
- refined copy for Stripe warnings for members import pre-validation
- updated styles for data preview for dark mode
2020-07-01 07:24:10 +02:00
Fabien 'egg' O'Carroll
5d22b788c8 Refactored to use updated members and stripe settings (#1621)
refs #10318

* Updated settings model with new settings

* Removed parseSubscriptionSettings from settings service

* Updated members-utils to use new settings

* Updated labs controller to use new settings

* Fixed dependency for member-settings-form

* Updated members-lab-setting component to use new settings

* Updated disconnect modal to use new settings

* Updated members portal modal to use new settings

* Removed Direct from settings

* Renamed members_allow_signup -> members_allow_free_signup

* Allowed for null fromAddress
2020-06-29 19:37:11 +02:00
Kevin Ansfield
99dbcdb3b0 Renamed defaultLocale setting to lang
refs https://github.com/TryGhost/Ghost/issues/10318

- API has been updated to still work with `default_locale` for backwards compatibility but it makes sense for the client to match the underlying settings keys
2020-06-24 15:27:17 +01:00
Kevin Ansfield
8984c0ae32 Updated to fetch settings using /settings/?group= instead of ?type=
refs https://github.com/TryGhost/Ghost/issues/10318

- primary change is in the settings service which is the only place we fetch the settings endpoint
- mocked APIs and fixture data updated to expect and to filter on `?group` rather than `?type`
2020-06-24 14:23:51 +01:00
Kevin Ansfield
6d83c30f01 Updated settings service with new types list
refs https://github.com/TryGhost/Ghost/issues/10318, https://github.com/TryGhost/Ghost/pull/11952

- precursor for moving from `?type` to `?group`
- matches the new settings groups list
2020-06-23 20:49:29 +01:00
Rishabh Garg
c6d12cbe5b Added new modal settings behind dev flag (#1615)
no issue

depends on 77e1ada6c6

- reverts commit 6760527 with modifications for naming
- Adds new portal settings UI in Labs -> Members setting
- Allows customization of new portal-* settings upstream
- Updates settings service to include portal group
- Updates settings modal to include new portal-* settings
2020-06-19 21:36:49 +05:30