Commit Graph

941 Commits

Author SHA1 Message Date
Kevin Ansfield
3ee0c3ff53 Fixed duplicate top-level properties after native class codemod
refs https://github.com/TryGhost/Ghost/issues/14101
refs https://github.com/TryGhost/Admin/pull/2256

Before migrating to native classes we had a number of controllers/components that had an `.actions.foo` action and a `.foo` task. The automated migration to native classes didn't take that into account and we've ended up with duplicate top-level property names. These duplicates are confusing and can potentially lead to errors or unexpected behaviour, they'll also be flagged as linter errors when we bump our eslint version.

- switched tasks with matching action names to `.actionTask` naming scheme
2022-02-10 10:20:03 +00:00
Kevin Ansfield
f1c8af662f Refactored modal for bulk unsubscribing members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full bulk unsubscribing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 22:04:02 +00:00
Kevin Ansfield
8052166cbe Refactored modal for bulk deleting members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-removing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 22:04:02 +00:00
Kevin Ansfield
efb7bc4c3b Refactored modal for bulk removing a label to members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-removing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 21:58:59 +00:00
Kevin Ansfield
925751c678 Removed unused addLabel() action on members controller
no issue

- left-over from earlier iterations
- adding a new label whilst filtering will be added back in so we don't want to confuse things with similar-but-unused code
2022-02-09 21:58:59 +00:00
Kevin Ansfield
24b222e927 Refactored modal for bulk adding a label to members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-adding logic out of the members controller and into the modal so logic is contained in one place
- added `{{members-count-fetcher}}` resource that allows for member counts to be fetched directly from templates avoiding duplicated code
2022-02-09 21:58:59 +00:00
Kevin Ansfield
8cc4c6c4a1 Dropped ember-concurrency-decorators dependency
no issue

- since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
2022-02-09 10:49:38 +00:00
Gabriel Csapo
4a6e175615 [chore] migrate app/controllers/settings/navigation.js to use native classes (#2254)
refs https://github.com/TryGhost/Ghost/issues/14101
refs https://github.com/TryGhost/Admin/pull/2245

- continuing migration to native classes with use of `@classic` decorator
- required as a part of https://github.com/TryGhost/Admin/pull/2245
2022-02-09 09:53:38 +00:00
Gabriel Csapo
a8dbc1ab7e [chore] updates app/controllers/editor.js to use native classes (#2253)
refs https://github.com/TryGhost/Ghost/issues/14101

- continuing migration to native classes with use of `@classic` decorator
2022-02-09 09:50:46 +00:00
Fabien "egg" O'Carroll
047f28177f 🐛 Fixed sending non-integer prices to Tiers API
refs https://github.com/TryGhost/Team/issues/1319

Due to how JS implements numbers, it's possible that when we multiple a
number with 2 decimal places by 100 that we do not end up with an
integer e.g. 9.95 * 100 = 994.999...

This is not a valid price for the API and so we must round it to the
nearest integer. Rounding is safe here, because the errors involved in
floating point operations are very small.
2022-02-09 10:41:16 +02:00
Fabien "egg" O'Carroll
b287c881eb Revert "Rounded monthly/yearly Price"
This reverts commit 55af726402.
2022-02-08 16:46:00 +02:00
Fabien "egg" O'Carroll
55af726402 Rounded monthly/yearly Price
refs https://github.com/TryGhost/Team/issues/1319
2022-02-08 16:43:57 +02:00
Kevin Ansfield
bf9bbc3aa6 Fixed members search input losing focus whilst typing
closes https://github.com/TryGhost/Team/issues/1318

The `{{if this.members.length "" "hidden"}}` class meant that whenever loading occurred the search input was briefly changed to `display: none` which caused focus to be lost making searching rather painful. It also meant the search input disappeared completely when no members matched a search.

- switched to a standard `<input>` element to get better event handling ergonomics
- added `searchIsFocused` tracked property that is set to `true` any time the search input has focus - works around an unexpected re-render when clearing the search input whilst it has focus
- switched the "hide" conditional to a getter that takes members length, search param text, and search input focus into account so there are no unexpected hides of the search bar
2022-02-08 11:44:08 +00:00
Kevin Ansfield
f111a23031 🐛 Fixed "Show all members" button not clearing search field when no results match
no issue

- the reset button was only clearing the `filter` param rather than resetting all query params
- removed unnecessary `searchText` indirection, the search input can work directly with the query param
2022-02-08 11:36:49 +00:00
Rishabh
f341edb02d Updated welcome page location for free membership
refs https://github.com/TryGhost/Team/issues/1168

- moved free tier welcome page url from product card to main screen
2022-02-08 09:31:40 +05:30
Kevin Ansfield
7e95890a99 Added saving spinner to finishing-touches screen
refs https://github.com/TryGhost/Team/issues/1310

- switched to a task and `<GhTaskButton>` to show a saving indicator whilst waiting for API to return
2022-02-04 17:32:43 +00:00
Kevin Ansfield
2525a43156 Changed firstStart flow to show a streamlined settings screen
closes https://github.com/TryGhost/Team/issues/1310

- added `/setup/finishing-touches` route
  - refreshes theme preview on access
  - uses existing setting form components to build a reduced settings menu
- updated `/?firstStart=true` handling to transition to `/setup/finishing-touches` instead of showing the get-started modal
- updated standard setup flow to show the get-started modal upon completion
  - `/?firstStart=true` flow for now will only be used when a theme has been chosen before site creation
2022-02-04 17:06:40 +00:00
Kevin Ansfield
c44766e8d3 Collapsed @service injection definitions to single-line style
no issue

- find+replace to make service injection style consistent and take up much less space at the top of files that used multi-line syntax
2022-02-03 19:04:43 +00:00
Rishabh
9b0ba5968e Fixed broken offer screen for tiers missing price
no refs

- in an edge-case scenario, if an offer is using a tier with missing price, it will not throw an error because of lack of price
- this case will be auto-handled once we delete all existing offers in future on stripe disconnect
2022-02-02 16:24:20 +05:30
Kevin Ansfield
8bc4309deb Added display of get-started modal after completing setup flow
refs https://github.com/TryGhost/Team/issues/1295

- moved `?firstStart` query param handling into `'home'` route as it seemed like a preferable location
  - switched to using `resetController` hook to manage removal of query param which seemed more reliable than the transition approach
- added `firstStart` query param to the transitions when completing step 3 of the setup flow
2022-02-01 18:20:26 +00:00
Peter Zimon
6fa8dafa79 Contributors updates (#2235)
Updates Admin UX for Contributors

When logged in as a Contributor:

- removes sidebar, added floating account menu and dark-mode switch to right side. Updated mobile menu accordingly
- all post by the given user is listed in the Post list
- changed post filtering
- hides email columns in post list
- removes publishmenu for Contributors in Post preview modal
- visual tweaks
2022-02-01 18:59:20 +01:00
Kevin Ansfield
9760e67b3d Added "Get started" modal for first-load onboarding
refs https://github.com/TryGhost/Team/issues/1295

- modal is triggered by the query param `?firstStart=true`, eg https://localhost:2368/ghost/#/?firstStart=true
- clears the query param after triggering the modal so it doesn't get re-triggered after leaving and re-entering the dashboard route
2022-02-01 17:47:50 +00:00
Kevin Ansfield
f07940f0e7 Collapsed @service injection definitions to single-line style
no issue

- find+replace to make service injection style consistent and take up much less space at the top of files that used multi-line syntax
2022-02-01 17:03:54 +00:00
Gabriel Csapo
8d01fb5556 Switched majority of files from EmberObject to native class syntax using @classic decorator (#2227)
no issue

- ran [ember-native-class-codemod](https://github.com/ember-codemods/ember-native-class-codemod) to convert the majority of remaining EmberObject based controllers and components to native class syntax using the `@classic` decorator
- skipped older style modal components (`components/modal-*.js`) due to observed incompatibilities in some cases
2022-02-01 09:34:03 +00:00
Rishabh Garg
7c5b14d050 Updated specific tier visibility handling for posts/pages (#2233)
refs TryGhost/Team#1071

Specific tier visibility for a post was previously stored in `visibility` column directly, which had a limitation of 50 charts. Going forward, for the specific tiers visibility of post/page, we use `tiers` array in API that contains list of tiers with access for post. This change -

- replaces `filter` type to `tiers` for visibility
- adds new visibility filter segment component in post settings menu which stores array of tiers instead of nql string for visibility
- updates serializer and model for post/page
- updates tests
2022-02-01 12:24:06 +05:30
Kevin Ansfield
ed48cd6e3a Refactored custom-view-form modal
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Admin/pull/2227

- updated modal component to use newer ember-promise-modals modals implementation
  - removed use of "delayedColor" properties as the workaround for liquid-fire based animation is no longer required
  - added `validate` action to remove need for `{{action}}` - we can't call the `validate()` method directly from the template because it's not bound correctly with `@action` and binding it breaks other code that expects `_super()` for the validate method to work via the mixin (eg, staff invite modal)
- removed `customViews.toggleFormModal()`` and changed `customViews.editView()` to open the modal directly
  - updated templates to use `{{on "click" this.customViews.editView}}` in place of toggling the "showFormModal" property
2022-01-31 10:41:57 +00:00
Kevin Ansfield
d3447315ee Excluded all email related events from feeds when newsletter is disabled
refs https://github.com/TryGhost/Team/issues/1290

- added `{{members-event-filter}}` helper that can be used to build an event filter string that will always exclude email events when the newsletter is disabled
  - useful when used in conjunction with `{{members-event-fetcher}}` because the filter is automatically adjusted for you without needing additional logic or JS backing files for components
- updated dashboard and member screen activity widgets to use `{{members-event-filter}}`
- updated members-activity screen
  - updated to use `{{members-activity-filter}}` helper in the template which allowed for removal of filter generation in the controller
  - changed `@hideMemberOnlyEvents` to `@hiddenEvents` on `<MembersActivity::EventTypeFilter>` so that we can control which events are available in the filter based on newsletter enable/disable and presence of a filtered member
2022-01-27 19:19:15 +00:00
Kevin Ansfield
073cdc7078 Replaced dashboard "Top members" widget with longer activity feed
refs https://github.com/TryGhost/Team/issues/1290

- when the activity feed labs flag is enabled
  - hide top members widget
  - increase number of events in activity widget from 5 to 10
2022-01-27 16:53:39 +00:00
Kevin Ansfield
98eb75ef06 Added member search/filter UI to the members-activity screen
refs https://github.com/TryGhost/Team/issues/1290

- renamed `@updateExcludedEvents` to `@onChange` and updated associated action name so we have consistent naming for our select-like components
- added `<MembersActivity::MemberFilter>` component
  - utilises `<PowerSelect>` with a custom trigger component and  and a debounced search via the member's API
  - does not use `<PowerSelect>`'s default "selected" behaviour in favor of replacing the select with a button to provide a clearer "reset filter" UX that's easier to build/style outside of the power-select components
  - added `.ember-power-select-trigger-reset` class to reset margins, paddings, borders, and heights so that it's easier for a custom trigger's contents to control the display
2022-01-27 15:00:40 +00:00
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
69e7bad5d1 Added member details and hid member column on activity feed when filtered by member
refs https://github.com/TryGhost/Team/issues/1277

- extracted member details display into a `<GhMemberDetails>` component for re-use in the member details and members-activity screens
- added loading of member record from the member id query param and displayed the member details above the table when a member filter is present
- hid the member column in the events table when a member filter is present
  - it's useless/repeated info at that point
2022-01-25 16:40:51 +00:00
Kevin Ansfield
21f2a58a8a Refactored post email preview modal
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Team/issues/1277

- switched modal implementation to the newer promise-modal style
- added `<GhEmailPreviewLink>` component that renders a link that when clicked opens the modal
  - removes the need for templates/controllers to manually handle modal opening/closing and to pass actions down from parents
  - updated all places we were triggering an email preview modal to use `<GhEmailPreviewLink>`
2022-01-25 13:17:05 +00:00
Kevin Ansfield
de93c691cd Added member query param support to members-activity screen
refs https://github.com/TryGhost/Team/issues/1277

- added `member` query param that expects a member ID
  - using an ID as it makes the filtering simpler than using an email because there is no async member fetching required
- updated `filter` generation to build `type` and `member` parts and combine them in an AND query
- updated link in member screen to use a `member` param rather than a `filter` param
  - resets any `excludedEvents` param so all events for the member will be shown when following link from member->members-activity
2022-01-25 12:13:13 +00:00
Kevin Ansfield
05b1d85398 Fixed invalid filter query for members events
refs https://github.com/TryGhost/Team/issues/1277

- we were inadvertently adding an empty string to the excluded events set resulting in a trailing comma in the filter string (`type:-[x,y,z,]`)
2022-01-25 10:12:24 +00:00
Kevin Ansfield
ae8cb00300 Added event filtering UI to members activity screen
refs https://github.com/TryGhost/Team/issues/1290

- changed query param from `filter` to `excludedEvents`
  - exposing filter directly creates problems converting back to NQL after parsing+modifying the query
  - removes suggestion that raw NQL can be manipulated by editing the URL
  - allows us to use a set of well-defined query params to build the underlying filter string from scratch each time a query param changes
- added `<MemberActivity::EventTypeFilter>` that renders a filter button with a dropdown containing a checkbox for each event type
- if no `member` property is set on the members-activity controller (soon to be another query param) any email event types are hidden because the API can't currently paginate those correctly and in any case they would drown out any other type of event
2022-01-24 17:31:32 +00:00
Kevin Ansfield
5f51310714 Removed unused membersActivity service
refs https://github.com/TryGhost/Team/issues/1277

- fetching member event data is now handled by the `members-event-fetcher` resource as that gives better ergonomics for data loading in templates
2022-01-22 16:06:39 +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
Sanne de Vries
0ddca821d6 Revert "Updated profile page for Authors & Contributors"
This reverts commit c5940ab57b.
2022-01-21 12:46:27 +00:00
Sanne de Vries
c5940ab57b Updated profile page for Authors & Contributors
No ref

- Removed breadcrumbs when profile page is loading
- Redirected Authors and Contributors to profile page when accessing /staff
2022-01-21 11:35:02 +00:00
Kevin Ansfield
4b3fc52cf0 Extracted dashboard member activity into separate component
refs https://github.com/TryGhost/Team/issues/1277

- first step of further refactoring to make member activity display more generic
- separates component data loading from overall controller logic and allows it to be tested in integration tests as well as acceptance tests
2022-01-18 15:16:22 +00:00
Kevin Ansfield
93b4262db5 Extracted member activity fetching into new service
refs https://github.com/TryGhost/Team/issues/1277

- pulled timeline fetching from `members-stats` service to `members-activity` service ready for further refactoring to make fetching/processing more generic
2022-01-18 13:55:42 +00:00
Daniel Lockyer
0f2faed20c Updated database warning wording
refs https://github.com/TryGhost/Toolbox/issues/175

- both cases now show the same message so I've reverted back to
  returning a boolean indicating whether it should be shown
- also pulls out the check for Pro so the if-statements are easier to
  read
2022-01-18 11:10:25 +00:00
Daniel Lockyer
4994e27838 Refined database warning message to reflect specific versions
refs https://github.com/TryGhost/Toolbox/issues/175
refs c4083967df

- the referenced commit added a warning message to the What's New page
  to notify the user that we're going to be requiring MySQL 8 in
  production as of v5
- this would also show if the user was already using MySQL 8, which
  isn't ideal
- I've added a library to Ghost which will return the specific version
  of MySQL used, so we can now detect that
- eb68e8d339 has updated the config endpoint to return `mysql5`, `mysql8` etc,
  so we can now change the logic here to reflect that
- this commit also adds another warning if we're in development mode and
  using mysql5, as this will not be supported as of v5
2022-01-18 09:41:04 +00:00
Rishabh
f47fee86e2 Refined free tier card usage
refs https://github.com/TryGhost/Team/issues/1037

- adds free tier card behind multiple tiers flag
2022-01-18 00:26:56 +05:30
Rishabh Garg
86b55b0f81 Added new free tier card with custom description/benefits (#2203)
refs https://github.com/TryGhost/Team/issues/1037

Adds new free tier card with option to add custom description and benefits for free tier, behind the tiers beta flag. Also:

- updates formatting of tier prices
- changes "Free" section to "Default"
- updates price formatting of membership tiers in admin
- updates currency code handling for product card
- updates default paid product handling

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2022-01-18 00:23:43 +05:30
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
d09db70f43 Refactored use of ShortcutsRoute mixin on editor screen
no issue

- mixins are deprecated in Ember so we want to remove their usage
  - pre-requisite for easier automation for switching to native class syntax
- removed ShortcutsRoute mixin in favor of using the `{{on-key}}` modifier and standard controller action
2022-01-17 10:06:57 +00:00
Kevin Ansfield
c868dd6224 Refactored use of ShortcutsRoute mixin on tags screen
no issue

- mixins are deprecated in Ember so we want to remove their usage
  - pre-requisite for easier automation for switching to native class syntax
- removed ShortcutsRoute mixin in favor of using the `{{on-key}}` modifier and standard controller action
2022-01-17 10:06:57 +00:00
Kevin Ansfield
c4083967df 💡 Added database upgrade warning for required MySQL 8 in Ghost 5.0
no issue

- Ghost 5.0 will require MySQL 8 when running in production so we've added a warning to the whats new/about screen to give some visibility for self-hosters to prepare
- updated `whatsnew` controller to native class syntax
2022-01-14 13:27:32 +00:00