Commit Graph

668 Commits

Author SHA1 Message Date
Sanne de Vries
21b4b15a1c Improved Email newsletter settings page (#2207)
Updated email newsletter settings

- Added toggle to disable email newsletters
- Hides email related UI when email is completely turned off
- Rearranged email newsletter settings
- Added publish-menu preview in 
- Changed default-recipients setting
- Updated publish-menu to show Publish as default action
- Removed the confirmation modal during publishing when no emails are intended to be sent
2022-01-27 12:40:11 +01:00
Sanne de Vries
beca9b13dd Updated Author user profile page and sidebar
No issue

- Authors don't need access to staff page and don't need to see breadcrumbs on their profile page
- There's enough space in the side navigation for the post views to be visible by default
2022-01-26 14:49:55 +00:00
Kevin Ansfield
7376167d0a Fixed errors thrown in integration tests
no issue

- errors were due to test setup rather than anything being broken
- cleans logged errors in test output
2022-01-21 23:45:47 +00:00
Kevin Ansfield
57b1ab4800 Ran ember-cli-update --run-codemods (#2219)
no issue

- part of ember upgrades
- removed all unnecessary usage of `.get`
- cleaned up imports where we had imports from the same module across multiple lines
- standardized on importing specific computed helpers rather than using `computed.foo`
- switched tests from using `wait()` to `settled()`
2022-01-21 19:25:47 +00:00
Kevin Ansfield
92ece7b373 Refactored member activity list components
refs https://github.com/TryGhost/Team/issues/1277

- renamed `<GhActivityTimeline>` to `<GhMemberActivityEventParser>` and modified so that it yields parsed events rather than directly renders them
  - makes the component re-usable as it can be used to decorate raw events ready for use in context-specific templates
  - switches to using a getter to yield the parsed events so that they will update automatically when the `@events` argument changes
- updated `<Dashboard::LatestMemberActivity>` to use `<GhMemberActivityEventParser>` and keep the member activity box output local to itself
- added integration tests for `<Dashboard::LatestMemberActivity>`
  - added Mirage setup for member activity event models/serializers/route
2022-01-19 12:58:09 +00:00
Kevin Ansfield
eb2109499a Added initial setup of members activity feed
refs https://github.com/TryGhost/Team/issues/1277

- added `/members-activity` route with associated controller, template, and components behind labs flag
  - table component currently renders some dummy rows
- added navigation item to main menu
  - will use the currently set `?filter` query param unless clicked whilst already on the `/members-activity` screen in which case it will reset the query
- added link to dashboard members activity panel
- added link to member details activity panel
  - sets the filter param to `?filter=member:{member.id}` in preparation for the feed to be filtered to the member's activity
- updated the labs-flag test helper file to export both `enableLabsFlag()` and the new `disableLabsFlag()` so it's easier to test for flag-disabled functionality
2022-01-17 18:06:12 +00:00
Kevin Ansfield
683a8584ce Refactored away CurrentUserSettings mixin (#2200)
no issue

Mixins are deprecated in Ember so we want to remove their usage. The `CurrentUserSettings` mixin was used in Route files to provide `transitionAuthor()` (that also transitions contributors) and `transitionEditor()` methods so the the consuming route could use them to prevent access to authors/editors. In practice the only reason this was used was to prevent access to admin-only routes.

- added an `AdminRoute` class that inherits from our `AuthenticatedRoute` class
  - when any route inherits from this class it will only allow access to admins and owners, any other user will be redirected to the home screen (dashboard or site depending on permissions)
- updated all of our admin-only routes to use the new `AdminRoute`
  - allowed for removal of `CurrentUserSettings` mixin usage
  - allowed for `beforeModel()` hooks to be removed from consuming routes in many cases
  - some admin-only routes were extending/inheriting directly from Ember's `Route` based on the assumption that the router hierarchy would have a parent route perform the redirect. Those have also been switched to `AdminRoute` for consistency and to prevent accidentally making them available if the router hierarchy changes
  - `/#/settings` does not use the `AdminRoute` so that it can redirect to the current user's setting page for non-admin users
- removed `CurrentUserSettings` mixin file
- cleaned up unnecessary computed property and function used for redirect-when-disabled in the Zapier route
2022-01-17 10:05:27 +00:00
Kevin Ansfield
05373e7ac2 Fixed editor test failing when run within 10mins of midday
closes https://github.com/TryGhost/Team/issues/854

- when testing the scheduling of a post we were grabbing a time 10 mins in the future and using that to set only the _date_ for the scheduled publish time. That causes problems because 10 mins in the future from just before midday with site set to a +12hr timezone as in the tests will move into tomorrow but without the associated change in scheduled time we've jumped forward 24hrs meaning the tests that were expecting the default +5min change when switching to a scheduled post would fail
2022-01-06 13:02:43 +00:00
Kevin Ansfield
cdbba8530f Fixed ?search= empty param after members bulk delete
no issue

- the members query reset was using `""` rather than `null` due to a bug in an old version of search/filtering but that meant we could end up with an empty param
- switched to `null` as it no longer appears necessary to use a blank string, this matches behaviour of other params
2022-01-05 12:52:12 +00:00
Kevin Ansfield
f1bcb073a3 🐛 Fixed incorrect automatic CSV download when bulk-deleting members
closes https://github.com/TryGhost/Team/issues/1265

- we were generating the correct query params for the export endpoint but those query params weren't applied to the export URL before fetching it meaning the default GET behaviour of listing first 15 members was always being used when generating the backup CSV
2022-01-05 12:21:52 +00:00
Kevin Ansfield
dae210daa5 Fixed linter error
refs 6cafae86d7

- all uses of `sinon` were removed in the updated tests but the import was missed
2022-01-03 15:32:42 +00:00
Kevin Ansfield
6cafae86d7 Updated <GhThemeTable> test
refs https://github.com/TryGhost/Team/issues/1164

- component integration tests were failing after `<GhThemeTable>` was replaced with `<GhThemeTableLabs>`
- updated tests to match new table component behaviour
2022-01-03 15:27:32 +00:00
Kevin Ansfield
40a48c1e99 Cleaned up customThemeSettings feature flag
refs https://github.com/TryGhost/Team/issues/1164

- removed flag and labs screen toggle
- removed all conditionals
- removed all old/unused route/controller/component files
- renamed labs components and classes to non-labs naming
2022-01-03 14:09:27 +00:00
Kevin Ansfield
98b5506d64 🎨 Added confirmation dialog any time a post/page will be published
refs https://github.com/TryGhost/Team/issues/1169

Previously we were only showing a confirmation dialog if a publish action would trigger an email which was inconsistent and did not instil confidence when publishing.

- replaced old `modal-confirm-email-send` modal with the newer-style `modals/editor/confirm-publish` component
  - updated to handle standard publish in addition to email publish
  - updated copy
  - added "error" state when attempting to send email-only post to no members
- updated publish menu `save` task to open the confirm modal when going from `draft` to `published` or `scheduled`
  - underlying save with email polling moved to `_saveTask` so it can be re-used across `save` task (when not publishing) and when confirming from the modal
2021-12-07 00:18:24 +00:00
Kevin Ansfield
7bbe83786d Removed empty card test files 2021-11-29 09:42:14 +00:00
Rishabh
0f460a646b Fixed lint 2021-11-19 19:41:02 +05:30
Rishabh
3b49732cbb Added first pass of upload cards
refs https://github.com/TryGhost/Team/issues/1229
refs https://github.com/TryGhost/Team/issues/1230
refs https://github.com/TryGhost/Team/issues/1231
2021-11-19 19:34:17 +05:30
Kevin Ansfield
f253e2523d Fixed tests expecting old theme settings screen
refs https://github.com/TryGhost/Team/issues/1164

- removed conditional logic for links on settings index now that the old theme settings routes do not exist
- updated error handling test to use new design settings screens
  - modified templates' test attributes to work with new design
- fixed `enableLabsFlag()` test helper error when fixtures have already been loaded
2021-11-10 12:45:26 +00:00
Peter Zimon
e5b6db173c Removed obsolete integration files
- removed unused integration files (was restructured under Settings / integrations)
- removed unused routes
2021-11-05 13:42:38 +01:00
Peter Zimon
9568f703c3 Fixed staff tests
- fixed all staff related tests after Admin route restructure
2021-11-04 09:40:24 +01:00
Fabien 'egg' O'Carroll
6bd93a88ef Removed Offers related usage of labs flag (#2134)
refs https://github.com/TryGhost/Team/issues/1115

This removes all the usages of the Offers labs flag which do not modify routing.
The routing changes have been left for @peterzimon
2021-11-03 16:55:45 +02:00
Kevin Ansfield
396b99ecb0 Fixed upgrade modal not showing when theme uploads are not allowed
closes https://github.com/TryGhost/Team/issues/1193

- there was a typo in the limits modal component name that is shown when the limits service check fails when opening the upload theme modal
- added acceptance test with associated fix of modal name test selector in the template
2021-11-01 18:35:21 +00:00
Kevin Ansfield
7251b1acac Added acceptance tests for new design screen
no issue

- moved navigation settings tests from old settings/design tests to a separate file and unskipped them
- added happy-path acceptance tests for
  - rendering design screen
  - installing an official theme from the themes list
  - uploading a custom theme
2021-11-01 17:48:49 +00:00
Kevin Ansfield
f2e8cc3926 Fixed tests
refs b474e00cf8

- the editor test state has no email setup so the publish button will show "Publish" rather than "Publish & send"
2021-10-21 13:16:20 +01:00
Rishabh
b55ff582b8 Fixed offer tests
no refs

- adds new product fixtures
- allows loading of products data for offers page
2021-10-11 13:52:42 +05:30
Rishabh
dd0ecf75b9 Added basic acceptance tests for offers
refs https://github.com/TryGhost/Team/issues/1084
refs https://github.com/TryGhost/Team/issues/1085
2021-10-08 19:45:48 +05:30
Rishabh
1107465398 Added new enable labs flag helper for tests
no refs

- allows easily enabling alpha features for tests
2021-10-08 19:45:07 +05:30
Naz
afbe24796a Removed stray only statement 2021-10-07 13:10:20 +02:00
Naz
843b810d1c Fixed failing test
refs https://github.com/TryGhost/Team/issues/1125
refs 4f3e340c03
refs 40269466f2

- The 'Publish & send' copy is now a default when publishing a post and has been missed to change in the refed commit
2021-10-07 13:09:55 +02:00
Naz
40269466f2 Fixed failing test
refs https://github.com/TryGhost/Team/issues/1125
refs 4f3e340c03

- The 'Publish & send' copy is now a default when publishing a post and has been missed to change in the refed commit
2021-10-07 12:55:18 +02:00
Kevin Ansfield
463a1ea763 Fixed Slack integration test
refs 63b1e1d385

- test was using an old `/settings/design` route as something to navigate away to but the behaviour no longer matched the test expectations
- switched to using `/settings` as a more stable route
2021-10-04 16:46:37 +01:00
Rishabh
bee3dd8bcd Fixed bulk delete members list test
no refs

- removes temporary comment on bulk delete member test as its updated to work with filtering in GA
2021-10-01 19:27:31 +05:30
Fabien O'Carroll
592e3df794 Added Members Filtering feature
no-issue

This adds the ability to apply complex filters to members, as well as to
perform bulk actions on the filtered set, including unsubscribing,
adding & removing labels.
2021-10-01 14:16:28 +02:00
Kevin Ansfield
2ded68f845 Updated tests for draft "Saved" indicator
refs e7501ece33

- save status indicator now shows "Draft - Saved" so tests needed to match
2021-08-31 10:11:40 +01:00
Sanne de Vries
a83830db7a Styled publishing action dropdown in publish menu 2021-08-26 13:01:45 +02:00
Naz
9e84441e75 Added publishing action dropdown to publish menu
refs https://github.com/TryGhost/Team/issues/947

- Added a "distribution" dropdown component to the post publish menu allowing to select from one of three available types of distribution: publish, poblush&send, and send
2021-08-25 22:20:11 +12:00
Rishabh
948934da2d 🐛 Fixed incorrect MRR value on dashboard
closes https://github.com/TryGhost/Team/issues/950

- fixes the mrr value/chart on dashboard when a site has no new mrr events in more than 30 days shown as 0
- adds tests to cover more mrr event scenarios
2021-08-09 17:47:09 +05:30
Kevin Ansfield
1ad2c05d37 Bumped eslint-plugin-ghost and fixed linter errors
no issue

- new linting rules that needed fixing:
   - calling `super` in lifecycle hooks
   - no usage of String prototype extensions
2021-07-15 15:27:29 +01:00
Thibaut Patel
dc9c812d9c Renamed isAdmin/isOwner/isAdminOrOwner to reduce confusion
issue https://github.com/TryGhost/Team/issues/857

- The goal is to avoid testing for the owner role only is cases where we should be testing for the owner or admin role
- `isOwner` => `isOwnerOnly`
- `isAdmin` => `isAdminOnly`
- `isOwnerOrAdmin` => `isAdmin` (concerns now both Owner and Admins)
2021-07-12 14:55:56 +02: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
Peter Zimon
e36f0a42d3 Updated character counter color 2021-07-08 15:15:49 +02:00
Rishabh
64819714a7 Added custom segment option to post settings access option
refs https://github.com/TryGhost/Team/issues/822

With multiple products flag we are re-enabling segmentation by product for posts. This change adds new segment option for post access option in post-settings menu, which allows option to choose specific products for post access.

- updates post settings and post settings labs menu to add new option for segment
- handles visibility filter changes for API based on selected segment
- the new behavior is behind the alpha flag for multiple products
2021-07-05 17:14:26 +05:30
Kevin Ansfield
456bfd3dff Fixed editor tests
refs 3d16b95e0f

- fixed linting errors
- fixed automatic clearing of invalid publish date when PSM is closed
  - previously the PSM was always rendered so it had a `showSettingsMenu` argument that told it whether it was being shown
  - automatic error clearing was tied to `showSettingsMenu` so it was switched to `willDestroyElement` because now the menu is re-rendered each time it's shown
- fixed tests
  - tests assumed the menu was always rendered so they were manipulating inputs even though they weren't visible on screen
2021-07-02 19:57:58 +01:00
Kevin Ansfield
2770c73bab Fixed tests
refs 37a6197f81

- fixed find/replace whoopsie with `slugGenerator.generateSlug()`
- updated editor controller unit tests to match rename
2021-06-21 15:18:11 +01:00
Kevin Ansfield
0d30077325 Switched to new component for labs feature image redesign
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
2021-06-16 17:56:25 +01:00
Kevin Ansfield
ba47b710cb 🎨 Moved default focus in editor from body to title for new posts
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
2021-06-14 15:35:59 +01:00
Kevin Ansfield
937eac51ad Fixed "and sent to..." text appearing in scheduled header when not sending
refs bd60c8089b

- added conditional for displaying the recipient text
- fixed tests not expecting newlines in html
2021-06-11 12:10:28 +01:00
Kevin Ansfield
fb17b41c05 Fixed tests expecting '(Untitled') in editor title input
refs a5dd92f1b8

- updated to reflect changed behaviour
2021-05-27 18:52:35 +01:00
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
3e4b9a6865 🎨 Updated post settings menu visibility option to support member segments
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
2021-05-10 20:34:23 +01:00