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>`
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
refs https://github.com/TryGhost/Team/issues/1277
- moved event parsing from a component to a helper
- keeps code as a plain function
- allows for per-event parsing which helps with rendering as we're not rebuilding/re-rendering a whole array each time the events data changes when a new page is loaded
- updated to include full member and email objects (will be used later for email preview popup)
- updated members-activity table row component to use the event parser helper for better event details
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,]`)
refs https://github.com/TryGhost/Team/issues/1290
- added an explicit `current-when="members-activity"` so the active class is not tied to the default behaviour of matching specific query params
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
refs https://github.com/TryGhost/Team/issues/1277
- using `<= created_at` requires client-side deduplication to prevent the same records appearing in the next page
- using `< created_at` does result in a possibility of records being missed between pages with the API's current pagination behaviour if many events occur within the same second but for our current requirements (no email events shown unless filtering by specific member) that is edge-case enough that simplified client code is preferable
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
refs https://github.com/TryGhost/Team/issues/1277
- re-uses same fetcher resource used on member activities screen
- allows for component to be simplified as it no longer needs to care about handling data loading itself
- drops use of 1-minute data caching as there is no real need for it in typical usage and can be confusing when the dashboard didn't update as expected
- exposed error message on `members-event-fetcher` if one is encountered
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
no issue
- many "The automatic session initialization is deprecated" were shown in test output due to an old method of initializing the session service
- switched to explicit session setup in the application route's `beforeModel` hook
- https://github.com/simplabs/ember-simple-auth/issues/2314
no issue
- bumped `ember-source`, `ember-data`, and `ember-cli` to latest 3.22.x versions
- fixed errors caused by updating properties inside of a render
- `<GhPublishMenu>` removed insta-call of `@setSaveType` when rendering sub-components in favour of pre-setting the default `@saveType` value when the underlying post status changes
- updated `<GhNavMenu>` to use the run-loop to update the `firstRender` property once rendering has finished rather than mid-render
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()`
refs https://github.com/TryGhost/Team/issues/1277
- if email events were passed through the parser they had blank actions and objects
- added `opened`, `received`, and `failed to receive` actions for email events
- changed object to equal `an email` for any email events
refs https://github.com/TryGhost/Team/issues/1277
- `data-cache` service has a `.set(key, data, lifetime)` method that will store the data under the key and sets a timeout that will remove the data when the lifetime expires
- data can be retrieved with `.get(key)`
- allows for components to cache data for use when re-rendering without having to worry about keeping track of their state and it's expiration manually somewhere else
- moved caching concern out of the `members-activity` service and into the latest-member-activity dashboard component which is the one that cares about it's data and cache lifetime
- frees the `members-activity` service up to be more generic as it's no longer tied to the dashboard component's concerns
- component switched to using a task rather than a promise so it is automatically cancelled if it's destroyed before data fetching is complete
no issue
- we want to re-use this component as display-only on the email newsletter settings screen but the previous component design meant that changes to the `@filter` argument did not update the display
- moved to using getters for the internal base/specific filter Set instances so they are auto-updated when the `args.filter` param changes
- updated the `toggleSpecificFilter` action to store the current specific filter as temporary internal state when toggled off so it can be re-filled when toggling back on
- this interaction was why the component state had previously been disconnected from the `@filter` param
- moved filter string generation into an explicit `updateFilter` method that is called when any action occurs that should update the filter string. Changes to the filters are passed in as arguments so that we call the passed in action which will then update the `@filter` argument and the component state can react accordingly
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
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
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
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