Commit Graph

1718 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
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
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
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
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
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
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
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
Rishabh
941d4de4af Fixed default currency for new tier creation
no refs
2022-01-21 12:34:39 +05:30
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
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
Peter Zimon
6579d8de5c Removed extra mobile class from Members list header 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
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
4e9a78c36d Cleaned up unused branding modal
no issue

- the branding modal was a hangover from before the design settings screen that hadn't been fully removed after the newer settings screen was released
2022-01-13 13:31:32 +00:00
Kevin Ansfield
d0f6dd7fef Refactored custom integration creation and limits modals
refs https://github.com/TryGhost/Team/issues/559

- switched to new ember-promise-modals pattern
- removed controller and template in favor of opening modals directly from the route
- removed unused `mousedown` event handlers - they are only necessary when an input blur would trigger validation errors
- fixed Enter key not triggering create action by adding an `{{on-key "Enter"}}` event handler to the name input
- fixed scroll not resetting to top of integrations screens when navigating between them by adding `{{scroll-top}}` element modifier to the main content sections
2022-01-13 13:16:13 +00:00
Kevin Ansfield
6a43cb27c3 Refactored leave-editor confirmation modal
refs https://github.com/TryGhost/Team/issues/559

- switched to new ember-promise-modals pattern
- simplified `willTransition` handling because we can now wait on the promise returned from opening the modal
  - the modal content was changed to use `{{on "click" (fn @close true)}}` on the "leave" button so we can check for that return value for leave confirmation
2022-01-12 10:18:25 +00:00
Kevin Ansfield
d3cebeec50 Refactored search modal
refs https://github.com/TryGhost/Team/issues/559

- changed modal to use new modal pattern
- fixes padding jump when opening due to improved animation behaviour not using duplicated elements
2022-01-11 17:59:48 +00:00
Kevin Ansfield
e8cb144317 Renamed offer modals
no issue

- offer-related modals were split across the top-level `modals` directory and the `modals/offers` directory
- normalized to the `modals/offers` directory
2022-01-11 17:45:10 +00:00
Kevin Ansfield
06aaf09336 Refactored <GhSearchInput>
no issue

- converted component to glimmer component and native class syntax
- reduced duplication by adding a description of each searchable model that is then used for data loading and searching
- removed convoluted use of computed properties as they weren't needed - the result of the search function is used by `<PowerSelect>` directly so we don't need any tracking/automated re-rendering
2022-01-11 17:35:32 +00:00
Kevin Ansfield
73a6354135 Fixed "calling .set on destroyed object" error in gh-image-uploader tests
refs https://github.com/TryGhost/Admin/pull/2041

- the pretender upgrade highlighted an issue with the component's progress event handler where it could fire and attempt to set the progress property after the component has been destroyed
2022-01-06 10:20:06 +00:00
Kevin Ansfield
6a673ce8e1 🐛 Fixed confusing wording change whilst saving in publish confirmation modal
no issue

- after clicking the "Publish and send" button in the publish confirmation modal the post is saved and an email is created which caused the wording to change to automatically switch to the "publish only" state because posts with existing emails can't be sent again
- changed the wording-choice data to be set statically based on data available when the modal is triggered rather than auto-updated based on overall system state
2022-01-04 18:05:34 +00:00
Kevin Ansfield
40a48c1e99 Cleaned up customThemeSettings feature flag
refs https://github.com/TryGhost/Team/issues/1164

- removed flag and labs screen toggle
- removed all conditionals
- removed all old/unused route/controller/component files
- renamed labs components and classes to non-labs naming
2022-01-03 14:09:27 +00:00
Fabien egg O'Carroll
3b1696c57d Added check for payload property on error
no-issue

If the onUploadStart or onUploadSuccess methods error, and the error
does not contain a payload property then we recieve an opaque error
message which can be difficult to understand.
2021-12-13 15:57:29 +02:00
Fabien egg O'Carroll
1b9854b99f Added ability to attach metadata to uploads
no-issue

Currently the onUploadSuccess and onUploadFailure have no way to
identify which upload has succeeded or failed other than the filename.
However the filename is not guaranteed to be unqiue, so this can cause
bugs.
2021-12-13 15:57:29 +02:00
Kevin Ansfield
35c8be787c Changed confirm publish modal wording
refs https://github.com/TryGhost/Team/issues/1169

- switched from "no members" to "0 members"
2021-12-09 12:12:46 +00:00
Kevin Ansfield
8db9bc9f2e Fixed upgrade button not closing modal when attempting theme upload
no issue

- the upgrade button is a link rather than a button so was not triggering the modal's close behaviour
- added an `{{on "click" @close}}` handler to the link. `@close` does not preventDefault so the link's transition will still occur
2021-12-07 14:20:16 +00:00
Kevin Ansfield
93002be21d Fixed incorrect notification wording for scheduled email-only posts
refs https://github.com/TryGhost/Team/issues/1169

- we were incorrectly saying "Will be published and sent" instead of "Will be sent" for scheduled email-only posts
2021-12-07 10:57:21 +00:00
Kevin Ansfield
98b5506d64 🎨 Added confirmation dialog any time a post/page will be published
refs https://github.com/TryGhost/Team/issues/1169

Previously we were only showing a confirmation dialog if a publish action would trigger an email which was inconsistent and did not instil confidence when publishing.

- replaced old `modal-confirm-email-send` modal with the newer-style `modals/editor/confirm-publish` component
  - updated to handle standard publish in addition to email publish
  - updated copy
  - added "error" state when attempting to send email-only post to no members
- updated publish menu `save` task to open the confirm modal when going from `draft` to `published` or `scheduled`
  - underlying save with email polling moved to `_saveTask` so it can be re-used across `save` task (when not publishing) and when confirming from the modal
2021-12-07 00:18:24 +00:00
Fabien 'egg' O'Carroll
b3d2fb8b96 Allowed popups from email preview to escape sandbox (#2168)
refs https://github.com/TryGhost/Team/issues/1001

Our email newsletter preview is rendered inside of an iframe with
javascript disabled. When opening links from the preview, the new
window/tab inherits this property - which breaks links to twitter.
2021-12-06 18:48:04 +02:00
Kevin Ansfield
84b8d1be3b Moved cmd+shift+p shortcut handling into <GhPublishmenu>
refs https://github.com/TryGhost/Team/issues/1169

We want all publish actions to trigger a confirmation modal. Currently that confirmation modal is controlled by `<GhPublishmenu>` which made it difficult to use from the route-induced publish shortcut.

- removed old shortcut mixin approach from the editor route
- added modern keyboard handler to a hidden element that is rendered any time the publish menu is present
2021-12-01 11:51:10 +00:00
Rishabh
1b4c556837 Extended uploader component to take custom request method
no refs

By default, the uploader component was always using the `post` method to make upload calls for the files. Since some usecases like uploading media thumbnails need a different request method like `put`, this change allows overriding the request method used in upload.
2021-12-01 14:34:40 +05:30
Kevin Ansfield
aa9a9c9598 Removed unused tenor components from earlier iterations
refs https://github.com/TryGhost/Team/issues/1225

- iterations of earlier approaches (modal-image-selector, and kg-media-selector) for the gif selector were kept around whilst we narrowed down the interaction patterns, we've settled on the inline-image-selector pattern introduced in 3f3b66b668 meaning the others are no longer needed
2021-11-29 18:28:19 +00:00
Peter Zimon
591d5442e5 GIF browser refinements 2021-11-23 16:03:53 +01:00
Kevin Ansfield
3a4d1ecf60 Fixed error when searching tenor
no issue

- when removing zoom support from the tenor connector a call to `closeZoom()` when searching was missed
2021-11-19 17:31:35 +00:00
Peter Zimon
b3f74c1d88 GIF card refinements 2021-11-18 19:08:01 +01:00
Kevin Ansfield
0c4f9c8c6a 🐛 Fixed Casper not being installable from themes list
no issue

- fixed typo in the install-theme modal that meant we weren't correctly identifying Casper as the default theme meaning an attempt to install it was made instead of activating it
2021-11-17 22:49:00 +00:00
Kevin Ansfield
5f7c79d04e Fixed "Attempted to handle event deleteRecord on <page:x> .." error
refs https://github.com/TryGhost/Team/issues/1121

Double-clicking the delete button in the confirmation modal could trigger a second attempt to delete the post/page when it had already been deleted resulting in an ugly/incomprehensible error bubbling up.

- added `{drop:true}` to the task instance so it can't be called again whilst it's currently running
- added a guard for `isDeleted` so we don't attempt to destroy an already deleted record
- added a `true` return so the button indicates a successful state rather than an error state whilst the modal is closing
2021-11-16 17:59:59 +00:00