Commit Graph

8487 Commits

Author SHA1 Message Date
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
acbc4233a8 Humanized event details on members activity screen
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
2022-01-25 11:50:10 +00:00
Kevin Ansfield
5da8ee3c76 Switched members event fetcher to use data.created_at as cursor
refs https://github.com/TryGhost/Team/issues/1277

- updated to match API's expected filter format
2022-01-25 10:13:37 +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
e45dd1c3a7 Fixed "Members activity" nav link losing active class when filtered
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
2022-01-24 17:44:09 +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
Daniel Lockyer
731c87ad11 Merged v4.33.1 into main
v4.33.1
2022-01-24 16:01:20 +00:00
Daniel Lockyer
7c50b97f93 v4.33.1 2022-01-24 15:59:59 +00:00
Kevin Ansfield
9c06b5e71f Switched from <= to < in members event pagination
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
2022-01-24 11:01:42 +00:00
Fabien "egg" O'Carroll
9c139a78e4 Removed Archived Tiers from Portal settings
refs https://github.com/TryGhost/Team/issues/1252

Archived Tiers are no longer able to be signed up to, and should not be
shown in Portal
2022-01-24 12:12:15 +02:00
renovate[bot]
065cac4914 Pin dependency @ember/test-helpers to 2.6.0 (#2222)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-24 09:07:47 +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
b5db0d57d9 Updated dashboard member activity widget to use fetcher resource
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
2022-01-22 16:04:54 +00:00
Kevin Ansfield
08538bbb0b Fixed linter error
refs a45f80fa82

- removed unused import left over from development testing
2022-01-22 15:38:25 +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
31ccd15eb1 Updated Ember dependencies to 3.24 (#2221)
no issue

- bumped `ember-source`, `ember-data`, and `ember-cli` to latest 3.24.x versions
2022-01-22 11:24:26 +00:00
Kevin Ansfield
d51e25888d Resolved ember-simple-auth deprecations
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
2022-01-22 00:30:56 +00:00
Kevin Ansfield
8965ee9789 Updated Ember dependencies to 3.23
no issue

- bumped `ember-source`, `ember-data`, and `ember-cli` to latest 3.23.x versions
2022-01-22 00:20:35 +00:00
Kevin Ansfield
b71babfc51 Updated Ember dependencies to 3.22 (#2220)
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
2022-01-22 00:05:05 +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
d494e01d6b Updated <MemberActivityEventParser> to handle email events
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
2022-01-21 18:15:06 +00:00
Kevin Ansfield
ec6a5637e8 Added data-cache service for managing limited-lifetime cached data
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
2022-01-21 18:15:06 +00:00
Daniel Lockyer
3c2a322d79 v4.33.0 2022-01-21 16:00:31 +00:00
Fabien "egg" O'Carroll
98030859a5 Removed archived Tiers from complimentary select
refs https://github.com/TryGhost/Team/issues/1252

Archived Tiers should not be able to be used to create new subscriptions.
2022-01-21 15:42:33 +02:00
Sanne de Vries
4404dc179f Revert "Updated Author & Contributor views"
This reverts commit 8bcb534feb.
2022-01-21 13:01:52 +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
Rishabh
941d4de4af Fixed default currency for new tier creation
no refs
2022-01-21 12:34:39 +05:30
Renovate Bot
ea71e2a653 Update dependency eslint-plugin-ghost to v2.12.0 2022-01-20 15:42:07 +00:00
Renovate Bot
f1c1894f1a Update dependency @tryghost/string to v0.1.22 2022-01-20 15:36:12 +00:00
Renovate Bot
d215a9b114 Update dependency @tryghost/color-utils to v0.1.6 2022-01-20 15:36:01 +00:00
Renovate Bot
1492ded009 Update dependency @tryghost/limit-service to v1.0.9 2022-01-20 15:04:17 +00:00
renovate[bot]
53c96c1603 Update dependency liquid-fire to v0.34.0 (#2211)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-20 13:34:48 +00:00
renovate[bot]
dc7baa20f5 Update dependency ember-auto-import to v1.12.1 (#2210)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-20 13:18:29 +00:00
renovate[bot]
f05977b60e Update dependency ember-keyboard to v7.0.1 (#2208)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-20 13:17:38 +00:00
Kevin Ansfield
c24bd50f10 Refactored <GhMembersRecipientSelect> to auto-update on @filter change
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
2022-01-19 14:29:49 +00:00
Kevin Ansfield
16781fbc0f Fixed linter error
refs 92ece7b373

- removed unused import that was left over from an earlier approach
2022-01-19 13:15:19 +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
Sanne de Vries
8bcb534feb Updated Author & Contributor views
No ref

- Switched sidebar post navigation to be always open
- Removed breadcrumbs from profile page
2022-01-19 11:24:07 +00:00
Rishabh
e142812a68 Refined free tier UI
refs https://github.com/TryGhost/Team/issues/1037

- added default currency to free tier card
- updated benefit placeholder for free tier
- updated description placeholder for free tier
2022-01-19 13:04:08 +05:30
Djordje Vlaisavljevic
19b232640e Updated the placeholders and headings for edit free membership modal
refs https://github.com/TryGhost/Team/issues/1029
2022-01-19 02:19:51 +01:00
Kevin Ansfield
0fd16d504d Fixed linter error
refs 4b3fc52cf0

- removed errant console.log
2022-01-18 15:26:16 +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
Peter Zimon
6579d8de5c Removed extra mobile class from Members list header 2022-01-18 12:55:57 +01:00
Peter Zimon
7f384b8516 Fixed members list header Safari bug 2022-01-18 12:55:57 +01:00
Sanne de Vries
23da2a57fe 🐛 Fixed modal to invite staff users not scrolling in Safari & Chrome
Closes https://github.com/TryGhost/Ghost/issues/13975
2022-01-18 11:28:51 +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