Commit Graph

3 Commits

Author SHA1 Message Date
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
a45f80fa82 Added fetching of member events to members-activity screen
refs https://github.com/TryGhost/Team/issues/1277

- added `ember-could-get-used-to-this` dependency to get access to Resources
  - context: https://www.pzuraq.com/introducing-use/
- added MembersEventFetcher resource for loading members events
  - using a Resource allows for a better data loading experience using only components
  - uses raw data from the API rather than going through Ember Data because we don't need full models or session-length caching that gives us
  - data is kept around in memory for the lifecycle of the resource, if the `filter` param changes the resource is torn down and recreated so it starts from page 1 again, once it's no longer used by a component it's torn down so data isn't kept around
  - paginates by using a `created_at:<={lastSeenTimestamp}` filter - this assumes the API can handle that effectively as a cursor with no duplicate or skipped records
- updated `members-activity` template to use the new resource and control data loading using infinite scroll
- moved overall screen structure from the `<MembersActivity::Table>` component into the `members-activity` template so that the table component can stay focused on just the table display
2022-01-22 15:35:08 +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