Commit Graph

765 Commits

Author SHA1 Message Date
Simon Backx
8502ebb96a Moving over the new Dashboard to replace the old (#2389)
refs: https://github.com/TryGhost/Team/issues/1631

Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
2022-05-17 09:34:34 +02:00
Rishabh Garg
8b5b3aa734 Updated usage of the Tiers API (#2388)
refs https://github.com/TryGhost/Team/issues/1575

- Update usage of Tier to read monthly & yearly price & currency from top level
- Updated usage of Tier to read benefit name from benefits[n], not from benefits[n].name

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2022-05-16 19:51:49 +01:00
Simon Backx
eee3a9aa90 🔥 Removed multipleProducts, tierWelcomePages, and tierName flags
refs https://github.com/TryGhost/Team/issues/1616
2022-05-16 17:25:03 +02:00
Kevin Ansfield
3b088cbd77 Removed usage of old publish menu for contributors
no issue

- updated `<PublishManagement>` and sub-components to handle contributors by replacing publish button with save button in main view and in preview
- removed feature flag gating and usage of `<GhPublishmenu>` in editor template
- updated tests that indirectly used the old publish menu so they work with the new design/behaviour
- skipped editor tests that used the old publish menu
2022-05-16 14:18:04 +01:00
Simon Backx
032f4d2ced Removed non multipleNewslettersUI tests 2022-05-16 14:11:51 +02:00
Hannah Wolfe
385240e03d Refactored to use individual slack settings (#2384)
refs: TryGhost/Team#1625

- we want to remove backwards compatibility code for slack being a single setting

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-16 11:38:32 +01:00
Kevin Ansfield
d353f5dff1 Skipped editor test that uses old publish menu
no issue

- CI keeps failing on this test because Firefox is being slow and hitting the 15sec timeout
- skipped for now as it's testing an old flow that no longer exists and the test will be replaced with an updated version soon
2022-05-12 15:06:52 +01:00
Hannah Wolfe
47d6c17135 Settings cleanup (#2377)
refs: https://github.com/TryGhost/Toolbox/issues/327
requires: TryGhost/Ghost#14791

- lang / locale has had a lot of churn, but we decided this setting should always be locale
- Removed test relating to unused editor_is_launch_complete setting 

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-12 14:53:18 +01:00
Hannah Wolfe
affe6743e5 Renamed products to tiers (#2372)
refs: https://github.com/TryGhost/Team/issues/1145

- this should allow us to remove the /products endpoint in v5

It avoids:

- `kg-product-card`, that really is meant to say product
- `product-cadence` on offers

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-11 22:41:54 +05:30
Kevin Ansfield
756f5094b4 Added "Save" button to editor for scheduled and published posts
refs https://github.com/TryGhost/Team/issues/1597

- added "Save" button to editor for scheduled and published posts when any edits have been made
- shows "Saving..." then "Saved" for 3 seconds before disappearing
  - replaces "Saving..." indicator shown in status bar on the left
- added `showIcon` argument to `<GhTaskButton>` so it can be used for text style buttons
- changed editor status behaviour to only show "Scheduled" by default with the full text shown on hover
2022-05-10 10:04:21 +01:00
Simon Backx
a103184c6a Updated newsletter recipientFilter to use slugs instead of instead
refs https://github.com/TryGhost/Team/issues/1576
refs https://ghost.slack.com/archives/C02G9E68C/p1651763933403669?thread_ts=1651763878.116549&cid=C02G9E68C
2022-05-05 17:37:34 +02:00
Simon Backx
1f5f9645e6 Updated members count to use selected newsletter when publishing
refs https://github.com/TryGhost/Team/issues/1576

- Passes the selected newsletter to the recipient selector
- Added a `recipientFilter` getter to the newsletter model to make changes easier in the future
- Updates the `fullRecipientFilter` in the new publishing flow to use the newsletter's recipientFilter
- Already takes future paid only newsletters into account
- The counts in the status message after publishing is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
- The counts in the scheduled notification is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
2022-05-05 17:17:23 +02:00
Simon Backx
19249bdae5 Renamed members-email-labs to newsletters and removed unused files
no issue

We still had some old components and templates from the `members-email` settings that were only were used when the (now GA) `multipleNewsletters` flag was disabled. I’ve removed them and renamed all routes and components from `members-email` and `members-email-labs` to just `newsletters` because it was sometimes hard to understand if a given components was still used or not when fixing issues.
2022-05-05 13:37:53 +02:00
Simon Backx
9b87b4c40a Added basic newsletter creation test
refs https://github.com/TryGhost/Team/issues/1477

- Very basic test only
- Includes some extra test attributes in the components
- Commented out a test that was not yet fininished
2022-04-28 10:50:27 +02:00
Rishabh Garg
c15711434f Updated route for newsletter settings (#2353)
- updates newsletter settings route to `/settings/newsletters` for GA
2022-04-26 13:10:16 +01:00
Simon Backx
4e3b4a7fe0 Readded multipleProducts flag in member filter tests 2022-04-26 13:10:16 +01:00
Simon Backx
0dc2c17285 Removed blank line that failed linting 2022-04-26 13:10:16 +01:00
Simon Backx
03edf7e1d9 Fixed test linting error 2022-04-26 13:10:16 +01:00
Simon Backx
18f4748e8b Fixed tests partially for updated member counts
no issue

Also moves some reused test methods to the test helpers folder (wasn't able to move it to the fixtures because too many tests were failing):
- enableNewsletters helper
- enableStripe helper
- enableMailgun helper
2022-04-26 13:10:16 +01:00
Kevin Ansfield
f6c9ffcf60 Fixed conflicting test selector in <GhTaskButton>
refs 8e120a74d6

- we use `data-test-state` inside of some modals which also use `<GhTaskButton>` which caused unrelated tests to start failing due to a change in matching element counts
2022-04-19 20:42:47 +01:00
Kevin Ansfield
8e120a74d6 Fixed <GhTaskButton> behaviour
refs 502fcaba3c

- the conditional for `isFailure` was wrong meaning we were showing the idle state unintentionally
- fixed the conditional so it checks for the return value rather than a `null` error
- updated the template with test selectors so it's easier to determine state where class names are not sufficient to differentiate
2022-04-19 20:25:27 +01:00
Kevin Ansfield
4c5144cb61 🐛 Fixed close button on "unsaved changes" modal not always behaving like "Stay" button
no issue

The close button in the unsaved changes modal used the `@close` action directly compared to the "Stay" button which used `(fn @close false)`. The close button version without explicit arguments resulted in the first argument being a `PointerEvent` instance which if checked as a modal return value as `if (shouldClose)` would evaluate as truthy therefore matching the "Leave" behaviour instead of the "Stay" behaviour.

- changed modal to explicitly call `(fn @close false)` when the close button is clicked
- updated design settings route to have an explicit `shouldLeave === true` check so default behaviour is always "Stay"
2022-04-14 12:39:10 +01:00
Peter Zimon
626634246f Updated Portal mock for offers (#2319)
Updated the preview block of offer creation screen to match the new style of Portal.
2022-04-01 13:22:41 +02:00
Kevin Ansfield
623825f8f0 🐛 Fixed scheduled send-only post switching to publish+send when rescheduling
closes https://github.com/TryGhost/Ghost/issues/14354

When setting/cleaning up the publish menu state we were incorrectly reverting to the default "publish & send" state when a post was already set to be email-only. This resulted in an unexpected and non-obvious switch to "publish & send" when re-scheduling a scheduled email-only post.

- updated the publish menu setup and cleanup routines to account for scheduled, email-only posts
- fixed the header in the publish menu to say "sent" rather than "published" when an email-only post is scheduled
2022-03-31 17:11:06 +01:00
Kevin Ansfield
78e08af003 Fixed newsletter settings tests
refs a4ca693871

- label's "for" was removed to enable more direct use of the checkbox enabling keyboard usage but the test was not updated to reflect the change
2022-03-31 11:37:38 +01:00
Kevin Ansfield
d6487d3630 Created labs versions of members-email settings code
refs https://github.com/TryGhost/Team/issues/1441

- duplicated route/controller/template and component to `-labs` versions so larger changes and refactors can be made without affecting the GA code
- added redirect for `/settings/members-email -> /settings/members-email-labs` when `multipleNewsletters` flag is enabled
- cleaned up multiple-newsletters related code from the non-labs component
2022-03-31 11:06:21 +01:00
Kevin Ansfield
3e4c8fb429 Improved test output readability for custom views failures
no issue

- test was failing locally due to a bad dependency version but the "expected null to exist" error was not very helpful
- added custom messages to the expectations so it's immediately obvious which expectation has failed, eg "custom view modal (on add): expected null to exist"
2022-03-31 10:52:54 +01:00
Kevin Ansfield
4bfc7529d6 Cleaned up membersActivityFeed labs flag (#2309)
no issue

- `membersActivityFeed` is GA so we don't need any of the conditionals or now-unused code
2022-03-30 12:43:52 +01:00
Rishabh Garg
fcf7f516b8 🐛 Fixed error on saving a paid member (#2312)
refs https://github.com/TryGhost/Team/issues/1435
refs a47b61c1d4

A recent change for showing all subscriptions of a member on detail screen introduced a circular json structure with subscription -> tiers -> subscriptions, which throws an error on saving any member with paid subscription on member detail screen.
2022-03-22 21:58:21 +05:30
Simon Backx
96d02a208d Fixed linting issues in dashboard 5 component 2022-03-22 09:58:42 +01:00
Simon Backx
7c96a1d562 Added dashboard 5.0 component
refs https://github.com/TryGhost/Team/issues/1431
2022-03-21 18:08:13 +01:00
Thibaut Patel
a47b61c1d4 Added canceled subscriptions in member detail screen (#2287)
refs https://github.com/TryGhost/Team/issues/1141

Showing canceled subscriptions provide a more complete picture of the activity of a member.

- Given there is no `member.product` object when a subscription is canceled, use the `member.subscriptions.price.product` objects instead of `member.products`.
- applied boy-scout rule for linter errors and and code formatting
- removed `multipleTiers` flag conditionals as it's now GA
- set up subscriptions as a separate mirage resource so they are easier to work with
    - updated `PUT /members/:id/` endpoint to match real API's complimentary subscription behaviour
    - modified mirage member serializer to match API output

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2022-03-18 16:15:42 +00:00
Kevin Ansfield
091ae194bf 🐛 Fixed duplicate email open rate column when filtering members by open rate
no issue

- email open rate is shown by default so we don't need to add the column a second time when the list is filtered by that data
- added `email_open_rate` to the default columns list so it's ignored when adding any filtered-by columns
2022-03-17 09:29:15 +00:00
Kevin Ansfield
fcb27507d3 🐛 Fixed slow loading and high memory usage of members list screen
refs https://github.com/TryGhost/Team/issues/1423

- problem:
  - all members requests were automatically adding `?include=email_recipients` as the email recipients relationship was set up to be always embedded
  - embedded email_recipient records also embed the whole email record
  - on the members index screen this meant for each of the 50 members loaded on a page we were also loading every email they have ever received resulting in a huge API response
  - this was not a problem previously because the API was ignoring the `include` parameter on the browse endpoint and Admin wasn't formatting the include properly in snake_case
- solution:
  - the only place we need associated email recipients is on the member details screen where they are used to show the email activity feed
  - removing the `{embedded: 'always'}` option for the `member.emailRecipients` association stops `?include=email_recipients` being added automatically to every members request
  - the member details screen explicitly adds `?include=email_recipients` so no further changes are needed
  - activity feed will be changing to use proper event objects in the future and further optimisation can be made
2022-03-15 18:26:24 +00:00
Sanne de Vries
bb7b388465 Fixed test 2022-03-11 12:52:30 +00:00
Kevin Ansfield
f0418266f4 🐛 Fixed "Must be in the past" error when closing and re-opening publish menu whilst scheduling
closes https://github.com/TryGhost/Team/issues/1399

- the publish/schedule save type was not being reset when closing the publish menu, even though the underlying post publish date _was_ reset leading to the publish menu and the post state being out of sync
- added a reset of the save type when closing the menu, this means "schedule" will need to be re-selected when re-opening the menu but that follows the same behaviour as the reset of the publish menu options
2022-03-11 10:13:08 +00:00
Kevin Ansfield
b373109b16 Updated members bulk-delete test for change of default filter
refs 79afb5fc9c
refs 652fc883d7

- test was set up expecting "Label" to be the default filter shown when opening the members filter UI but it's been changed to "Name" which is no longer behind a labs flag
2022-03-10 17:05:15 +00:00
Kevin Ansfield
79afb5fc9c Added "Name" and "Email" filters to members screen
closes https://github.com/TryGhost/Team/issues/1408
closes https://github.com/TryGhost/Team/issues/1409

- adds new text-based filters that match against member names and emails that allows more specific filtering than search
  - new filter operators introduced for "contains", "does not contain", "starts with", and "ends with"
2022-03-10 16:45:24 +00:00
Kevin Ansfield
af08f050d3 Added "Email" members filter
refs https://github.com/TryGhost/Team/issues/1409

- added filter property definition using the same "contains" operators and parsing supported added for the "Name" filter
2022-03-09 16:05:28 +00:00
Kevin Ansfield
f65437b14c Added "Name" members filter (#2289)
refs https://github.com/TryGhost/Team/issues/1408

- switched to `@tryghost/nql` packages to get access to latest releases
- updated `GET /members` mirage endpoint with a try/catch and explicit logging to make any errors from NQL more visible
- added "Name" filter option
  - has `is`, `contains`, `does not contain`, `starts with`, `ends with` operators
  - uses a plain text field for the input value
- added support for `~`, `-~`, `~^`, and `~$` operators when generating NQL queries from filter definitions
2022-03-08 21:30:20 +00:00
Kevin Ansfield
3a9ea11213 Added "Last seen" filter to members screen
refs https://github.com/TryGhost/Team/issues/1418

- adds "Last seen" option to members filtering that lets you filter by date a member last logged in or opened an email with `before`, `on or before`, `on or after`, and `after` options
- adds "Last seen on x" data to the member details screen
2022-03-08 20:21:49 +00:00
Kevin Ansfield
10ff54151f Fixed linter error for unused variable in dashboard-test.js 2022-03-08 19:23:03 +00:00
Kevin Ansfield
9fbb63cf41 Updated dashboard acceptance tests for latest member graphs/resources box behaviour
refs https://github.com/TryGhost/Team/issues/1376

- adjusted tests so they are in sync with expected dashboard behaviour
- removed `dashboardHideGettingStarted` feature and it's usage in the `showMembersGraphs` property as there's no longer a resource box to dismiss
2022-03-08 19:20:12 +00:00
Kevin Ansfield
3d8b06847b Cleaned up members filter nql parsing/generation
refs https://github.com/TryGhost/Team/issues/1419

- small cleanups to remove unnecessary duplication
2022-03-08 19:07:46 +00:00
James Morris
3571c79fd5 Updated tests to remove the Resources Banner from Dashboard
refs: https://github.com/TryGhost/Team/issues/1376
2022-03-08 19:04:11 +00:00
Sanne de Vries
3ae3e8142a 🎨 Redesigned user authentication pages (#2286)
Refs https://www.notion.so/ghost/Invite-staff-users-steps-in-setup-guide-367737e13d97450a98a0f39ec6b68181

* Simplified the selfhoster setup flow to one setup page only
* Redesigned the reset password pages and the signup page for new staff members

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2022-03-08 17:30:46 +00:00
Kevin Ansfield
c4c48d4104 Resolved ember-cli-mirage import deprecations
refs https://github.com/TryGhost/Admin/pull/2209

- `miragejs` has been extracted to a framework-independent library, the re-exports of `miragejs` elements in `ember-cli-mirage` have been deprecated making our test logs very noisy
- added `miragejs` as a top-level dependency
- updated all relevant imports to pull from `miragejs` instead of `ember-cli-mirage`
2022-03-08 11:32:01 +00:00
Kevin Ansfield
696fca0f9e Hid members graphs in dashboard until get-started block dismissed or members added
refs https://github.com/TryGhost/Team/issues/1406

- added fetch of a single member to the dashboard initialisation if we don't already have some members loaded in memory
- added `showMembersGraphs` getter used in the conditional for rendering the members graphs block component
  - if `improvedOnboarding` flag is disabled, return `showMemberData` so existing functionality is retained
  - will return `false` if until the single-member fetch has completed if we don't already have any members in memory
  - returns `true` if any members exist or the "get started" dashboard resources block has been dismissed
2022-03-07 13:26:52 +00:00
Kevin Ansfield
020cd75369 Added shortcut buttons to "Last seen" members filter datepicker (#2291)
refs https://github.com/TryGhost/Team/issues/1410

- added block invocation support to `<GhDatePicker>` that exposes the calendar components used inside the datepicker dropdown allowing for customisation of the dropdown content
- updated "last seen" datepicker to use the block invocation support to add buttons that select typical "time ago" dates

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2022-03-04 17:09:28 +00:00
Kevin Ansfield
17710c3e8e Switched members table to show info from most-recently-updated subscription instead of first in array
no issue

- members having multiple subscriptions is not really expected but if it does happen then the most recently updated subscription is most likely to be the one that we're interested in showing the details of in the members table
- added `{{most-recently-updated arr}}` helper+function that will return the item in the array argument with the most recent "updated at" value
  - uses `updatedAtUTC` or `updatedAt` or `updated_at` values so it will work against any of our models or un-transformed API response objects
- updated `<GhMembersListItemColumn>` to use a `mostRecentSubscription` getter when showing subscription data rather than assuming the first object in the subscriptions array should be displayed
2022-03-04 16:32:41 +00:00