Commit Graph

72 Commits

Author SHA1 Message Date
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
Rishabh
6e3d2bef3a Updated filter UI to show existing filters on page refresh
refs https://github.com/TryGhost/Team/issues/972

If a filter is applied in the new members list then the URL gets updated and the filter dropdown contains the filters that have been created. When refreshing the page while a filter is applied, the URL remains the same, the filter is still applied but the UI in the filter dropdown resets and doesn't show the appropriate filter fields and values.

This change parses the nql filter from URL using `nql-lang` library and rebuilds the filter UI blocks based on current filter in URL. It also ignores any invalid or unexpected filters in the UI.
2021-09-09 15:13:58 +05:30
Rishabh
e70e0e273d Fixed member list not loading on scroll with filtering
closes https://github.com/TryGhost/Team/issues/971
reverts abe5c6d681

We use vertical-collection to allow infinite loading + scrolling for members list instead of loading and rendering all members at once. The behavior was not working correctly with updated list for filtering feature, as we dynamically update columns. This change fixes the scroll behavior and members loading together by updating the containerSelector for vertical collection.
2021-09-07 16:50:43 +05:30
Peter Zimon
5516968936 Added empty result states to new members filtering 2021-09-03 12:18:15 +02:00
Peter Zimon
0f0c44295e Added show-all button to empty members filter list 2021-09-03 11:37:26 +02:00
Rishabh
5594ba7219 Added live filter update to members list
refs https://github.com/TryGhost/Team/issues/963

- adds live update to member list based on applied filters
- cleans up filter behaviour for different scenarios
2021-08-13 23:22:59 +05:30
Rishabh
520252f5aa Added filter count to filter builder UI
no refs
2021-08-13 18:37:19 +05:30
Rishabh
084380d155 Wired reset filters filter button in filter builder
closes https://github.com/TryGhost/Team/issues/964

Wires the "Reset" button in filter builder to clear all filters easily and see the original full list of members.
2021-08-13 18:00:28 +05:30
Peter Zimon
0c3848c23a Refined members action dropdown 2021-08-13 13:55:08 +02:00
Rishabh
38a3962368 Added bulk operations UI for filtered members
refs https://github.com/TryGhost/Team/issues/969

A lot of power of filtering members comes from ability to perform actions on the filtered member list. This change adds bulk operation actions on the the UI to apply on filtered members, but has not wired them up to the API yet.

- adds unsubscribe bulk operation UI
- adds label addition bulk operation UI
- adds label removal bulk operation UI
- adds new single label selection UI for add/remove label to members UI
2021-08-13 17:11:34 +05:30
Rishabh
a895bafb53 Added label editing feature in filtering dropdown
refs https://github.com/TryGhost/Team/issues/966

With introduction of members filtering, the current way of editing member labels needed an upgrade. This change updates the member label input component to include editing option which allows triggering label edit modal directly from the filtering menu when working with labels. The long term idea is to make this a consistent global pattern with labels dropdown, extending to member details screen as well.
2021-08-12 17:51:18 +05:30
Rishabh
247f24394d Added dynamic columns to member list from filter UI
refs https://github.com/TryGhost/Team/issues/943

- adds new columns to member list table based on selected filters in UI
- handles dynamic columns in members list with formatted output like for labels
- works behind the filtering feature flag
2021-08-10 17:41:59 +05:30
Rishabh
30756f8882 Separated alpha members filtering feature into own component
refs https://github.com/TryGhost/Team/issues/943

- separates the new alpha members filtering to its own `-labs` component
- fixes behaviour for existing filtering feature on members list which was overwritten with last change
- updates up action handling to modern glimmer syntax
2021-08-07 09:48:47 +05:30
Rishabh
7a43c53ddb Added basic members list filtering via UI
refs https://github.com/TryGhost/Team/issues/943

- updates the static filtering ui to dynamic (behind alpha flag)
- generates basic nql filter queries for selected filters - `is` , `is not`
- filters members list on applied filters
2021-08-05 19:22:58 +05:30
Rishabh
9ee66f8b85 Added filtering on members list via URL param
refs https://github.com/TryGhost/Team/issues/942

- adds `?filter` param to members list page which allows directly filtering list via NQL filter syntax
2021-08-04 15:53:06 +05:30
Peter Zimon
5255489779 Added static members filtering
- added filter builder dropdown (alpha)
- refactored related CSS
2021-07-23 16:05:22 +02:00
Peter Zimon
d356f5451a Added static result table for members filtering
- Added horizontal scrolling, fullscreen table component.
- Mocked multiple columns in the members result list.

Alpha feature.
2021-07-22 15:47:01 +02:00
Kevin Ansfield
7ab0db9be7 Fixed ember-test-selectors bound attributes deprecations
no issue

- converted publish menu and `gh-tags-list-item` components to glimmer syntax so data attributes can be passed in via `...attributes`
- added explicit `data-test-button` bound attribute to `gh-task-button` component
- moved `modal-theme-warnings` auto-bound data attribute from JS file to explicit html attribute in template
2021-07-08 22:44:52 +01:00
Kevin Ansfield
72590083f3 Added ability to bulk delete members by label or status (#1883)
refs https://github.com/TryGhost/Team/issues/585
requires https://github.com/TryGhost/Ghost/pull/12082

When a label or status filter is selected on the members screen show a "Delete selected" option in the actions dropdown. Bulk deleted members will _not_ have any subscription data modified in Stripe, if a member should be deleted and have their subscription cancelled it's necessary to do that on a per-member basis.

- updated bulk delete handling to match API
- added link to bulk delete confirmation modal in members actions dropdown (only shown when label, status, or search is used)
- updated testing framework for members
  - added label factory for easier test setup
  - updated `GET /members` and `DEL /members` endpoints to work with label filters
  - updated test selectors for easier reference in tests
2021-04-08 12:06:27 +01:00
Peter Zimon
0fbb1adbdb Dashboard mini charts basic styles 2021-02-19 10:39:13 +01:00
Peter Zimon
f7cb949a6e Responsive UI fixes 2021-02-12 14:29:49 +01:00
Rish
6f1ea8b018 Fixed nightshift property not set on Member charts
no issue

Nightshift value was not correctly setup on <GhMembersChart> component, so it was always set to false.
2021-02-11 20:54:34 +05:30
Peter Zimon
6e1b6a2618 Updated custom integration UI 2021-02-08 21:16:41 +01:00
Peter Zimon
879c7866e9 Members screen UI refinements 2021-02-04 16:52:19 +01:00
Peter Zimon
c757ddbef8 UI updates (#1835)
* Admin UI update basics

Added the basics for the Admin UI/style update. Very far from being done...

* Admin style updates

- exploring menu
- enabling full width content (integrations selection bg)
- updated main screens
2021-02-03 20:08:01 +01:00
Sanne de Vries
ffe0f84700 Added open-rate column and ordering to the members list (#1790)
closes https://github.com/TryGhost/Ghost/issues/12421

- added `emailOpenRate` property to member model
- added open-rate column to the members list
  - hidden when email analytics is disabled
- added `{{feature "flag"}}` helper so feature flags can be checked in templates without injecting the feature service into the backing class
- added `order` query param to the members controller/route and wired it into the data fetching routine
- added order dropdown to the filter bar with "Newest" (default) and "Open rate" as the two options
  - whole dropdown is hidden if email analytics is disabled

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-12-08 19:23:57 +00:00
Fabien 'egg' O'Carroll
6ecb38eaa5 Added support for filtering the exported Members CSV (#1716)
no-issue

Co-authored-by: Peter Zimon <zimo@ghost.org>
2020-09-23 14:29:47 +01:00
Kevin Ansfield
3b78973a21 Removed bulk member edit dev experiment
no issue

- we're moving forward with a simplified bulk delete and the UI would conflict if both approaches are behind the dev experiments flag
2020-07-23 15:03:18 +01:00
Kevin Ansfield
eee84ab5f7 Added first pass bulk members delete confirmation and results display
no issue

- display a confirmation modal when bulk deleting members
- hit the `DELETE /members/?all=true` endpoint when confirming
- show counts of members deleted/skipped
- fix selection reset when leaving edit mode
2020-06-19 18:14:41 +01:00
Kevin Ansfield
d8270a110c Moved members bulk delete confirmation into a modal 2020-06-19 14:14:39 +01:00
Kevin Ansfield
34c28dcc0e Added rough "edit mode" for members table behind dev flag
no issue

- initial UI for bulk-selection, focusing for now on first stage which is limited to select-all and delete actions
- adds "Edit" button to the members table that shows the "selection" toolbar in place of the table header and shows a checkbox next to each member
2020-06-18 11:08:53 +01:00
Kevin Ansfield
16f4b1c9af Added all/free/paid filter to members admin screen (#1600)
requires https://github.com/TryGhost/Ghost/pull/11892

- adds `?paid` query parameter to members route that is tied to the `?paid` query param in the API request
- added all/free/paid members dropdown to members filter component
2020-06-12 12:12:27 +01:00
Kevin Ansfield
8f5ccfe401 Fixed missing rename of <GhMembersFilter> in members.hbs 2020-06-09 23:22:43 +01:00
Kevin Ansfield
7ac7e73a05 🐛 Fixed members list not refreshing after adding yourself
no issue

- passed in the `refreshData` action to the `<GhMembersNoMembers>` component and called it after creating the member
- converted `<GhMembersNoMembers>` to a glimmer component
2020-06-05 08:50:20 +01:00
Kevin Ansfield
a76465b5ee Fixed columns resizing whilst scrolling members list
no issue

- the members list uses occluded rendering to keep scrolling performance high but this will cause constant reflows of the table contents whilst scrolling because contents are swapped in and out causing the browser to adjust the column widths to match longest/shortest content in the currently rendered set of rows
- applying `table-layout: fixed` to the table means that columns will always match the sizes defined by the first row of the table (in this case the header) ensuring that there is no dynamic resizing whilst scrolling
2020-05-28 12:59:34 +01:00
Kevin Ansfield
ff33eb978b Added server-side search to new members screen (#1582)
requires https://github.com/TryGhost/Ghost/pull/11854

- ties the search input on the members screen to a `?search` query param, debounced at 250ms to avoid unnecessary API requests and UI churn
- updated the members route's `model` hook to pass through the search param in the API request query parameters
2020-05-28 10:15:17 +01:00
Kevin Ansfield
8c19ea9cf9 Updated <GhMembersChart> to fetch stats from the API
no issue

- added mocked API for `/admin/members/stats/` that generates random data for the chart
- re-architected `<GhMembersChart>` to fetch data from the API rather than calculating stats from all members loaded in memory
- enabled mirage in development so that the chart can be tested before the live API is ready
2020-05-22 17:58:45 +01:00
Kevin Ansfield
3a6550b7c4 Linked label dropdown in members screen to paginated list loading
no issue

- moved model loading back into the route
- updated model loading to refresh correctly when `label` query param changes
- fixed infinite loading/"no members" display in members list by using the `members.loading` property that `ella-sparse` gives us (previously we'd never leave the loading display because `this.members.length` would be 0)
- changed the members nav link to reset query params only if it's clicked whilst on the members screen - matches posts/pages behaviour and lets you navigate without having to re-enter your filter/search
2020-05-22 17:58:45 +01:00
Kevin Ansfield
7e7bca7ff0 Added loading state for member list rows
no issue

- with the sparsely loaded list you can scroll to an area which is being loaded in the background
- if a list row is being loaded, display a "loading" version of the row so it doesn't look like you're stuck on a blank screen
2020-05-22 09:31:17 +01:00
Kevin Ansfield
5a1b3d90fb Updated members list to use paginated loading
no issue

- disabled members search/filter/chart as they won't work without all members loaded into memory (they will be added back later)
- added `ember-ella-sparse` to handle a sparse array of members
- updated `fetchMembersTask` to return a sparse array instance
- updated components that work on a `member` instance to use `.get` because all items in a sparse array are proxy objects
- changed list loading behaviour to not refresh the list from the API unless the client-side list is more than a minute old - allows for much snappier nav between list and details screens
2020-05-20 16:39:32 +01:00
Kevin Ansfield
3cc10bfa83 Updated members routes/controllers with Octane idioms
no issue

- ran [`ember-native-class-codemod`](https://github.com/ember-codemods/ember-native-class-codemod) on members-related files
- updated files to remove need for `@classic` decorator where possible
    - switched to tracked properties
    - removed usage of `this.get/set/toggleProperty` etc
- swapped usage of `{{action 'foo'}}` for `{{this.foo}}`
2020-05-20 16:39:31 +01:00
Kevin Ansfield
76cbdbaee7 🐛 Improved scrolling of members screen in Firefox
refs https://github.com/TryGhost/Ghost/issues/11755

- adjusted estimated height to match actual rendered size and enabled `staticHeight` to switch to a simpler algorithm inside vertical-collection
- prevents some jank seen when scrolling where rows jump
2020-05-01 18:17:47 +01:00
Rish
cd832a15bb Fixed members loading spinner alignment
refs https://github.com/TryGhost/Ghost/issues/11755

Loading spinner on members screen was not vertically centered, this updates the spinner position.
2020-04-21 13:42:34 +05:30
Kevin Ansfield
13a9a2802b Added member's geographic location to admin
no issue

- added `geolocation` attribute to member model with json-string transform
- prevent geolocation from being sent back to the API in member serializer
- add "Location" column to members list
  - if country is "US" then display "{State}, US" otherwise show full country name such as "United Kingdom"
  - displays "-" if no geolocation data has been collected for the member
2020-02-27 12:56:26 +00:00
Peter Zimon
64e4ea16e4 🐛 Fixed visual bug for members label dropdowns
no refs.
- fixed spacing issue for member label dropdown edit icon
- added max width to member label dropdown
2020-02-14 12:39:36 +01:00
Rishabh Garg
d115204d9f Added labels for Members (#1477)
no issue

refs TryGhost/Ghost#11538

* Added members label handling v1

* Added members label dropdown in list screen

* Updated selected labels and member list UI refactor

* Added v1 label add/delete modal

* Added add label modal v1

* Fixed disabled check for new label save

* First stab at member filters layout

* Updated member detail screen design

* Member detail refinements

* Added basic editing for member labels

* Fixed label deletion from members list

* Updated filtered list header

* Refinements for dropdown and empty filter state

* Refined label modal

* Updated member labels fetch logic

* Added custom dropdown component for labels

* Refined style for dropdown

* Refined dropdown button

* Restructure and refine members dropdown styles

* Added selected indication to dropdown

* Fixed dropdown footer style

* Removed member label placeholder

* Removed add label from member list actions

* New label refinements

* Added confirmation modal for label delete

* Added duplicate validation check for labels

* Updated validation check with slug

* Updated copy

* Updated actions dropdown copy

* Fixed visual glitch of dropdown on FF

* Hide scrollbar for labels dropdown

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2020-02-14 15:04:01 +05:30
Kevin Ansfield
2231dd84c2 Migrated to <AngleBracketSyntax /> (#1460)
no issue

Ember is migrating to `<AngleBracketSyntax />` for component invocation, see https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md

We were in a half-way situation where some templates used angle bracket syntax in some places, this PR updates templates to use the syntax everywhere.

This simplifies the rules for what template code is referring to...

`<Component>` = a component
`{{helper}}` = a helper (or locally assigned handlebars variable)
`{{this.foo}}` = data on the template backing context (a component/controller)
`{{@foo}}` = a named argument passed into the component that the component backing class has not modified (note: this commit does not introduce any named arguments)

- ran codemod https://github.com/ember-codemods/ember-angle-brackets-codemod on the following directories:
  - `app/templates`
  - `lib/koenig-editor/addon/templates`
- removed positional params from components as angle bracket syntax does not support them
  - `gh-feature-flag`
  - `gh-tour-item`
  - `gh-cm-editor`
  - `gh-fullscreen-modal`
  - `gh-task-button`
- updates some code that was missed in 3c851293c1 to use explicit this
2020-01-16 15:14:03 +00:00
Rishabh Garg
6a1edceded Added members growth chart (#1424)
no issue

Adds new members growth chart in members list screen to highlight growth of members over different date ranges
2019-12-17 15:59:26 +05:30
Kevin Ansfield
7d997d5c2d Fixed member count after deleting a member
no issue

- the member count is automatically calculated via the length of the live members array so there's no need to manually decrement it - if we do manually decrement then the count is off by one because the auto calculation runs to get the new value before the manual decrement
2019-12-13 11:38:37 +00:00
Kevin Ansfield
5585a781b9 Unified tag and member screen code
no issue

The tag and member screens share the same underlying UI/UX patterns but were using different code patterns. This brings both in line so that we have consistent code patterns that can be re-used for other screens.

- fixed cleanup of new tags by adding the `deactivate` hook to the `tag` route
- updated `member` and `member.new` route/controller setup to match tag route/controller setup
  - added `save` action to member controller so that Ctrl/Cmd+S works on member screen
  - updated tag route/controller to utilise the same instant display w/background refresh when accessing the tag details screen
- completed transition of non-component tag/members templates over to angle bracket component syntax
2019-12-12 13:59:46 +00:00