Commit Graph

15614 Commits

Author SHA1 Message Date
Elena Baidakova
7ef157b17f
Improved count of items in e2e tests (#15986)
refs TryGhost/Team#2371
- We need to wait selectors before count them
https://github.com/microsoft/playwright/issues/14278

These changes needed to make the results of tests more stable on the CI
2022-12-12 16:51:31 +04:00
Elena Baidakova
8d2418578d
🐛 Removed horizontal scroll for long author's name (#15985)
closes TryGhost/Team#2272
- Show all name's text due to poor support `text-overflow: ellipsis` in
email clients
2022-12-12 15:36:58 +04:00
Peter Zimon
bd92b3ac89 Added UI refinements
refs. https://github.com/TryGhost/Team/issues/2348

- spacing and typography was off on the receiving FAQ page
- longform popup size missed mobile sizes
2022-12-12 15:09:32 +05:30
Rishabh
ce45571dc0 Updated email faqs in portal to show sender email address
refs https://github.com/TryGhost/Team/issues/2348

- updates email faqs to show the sender email from newsletter data
2022-12-12 15:09:32 +05:30
Rishabh
14bdb58694 Added newsletter sender email to content API
refs https://github.com/TryGhost/Team/issues/2348

The suppressions FAQ on portal needs to show the newsletter's sender address, which wasn't exposed to the content API so far.
2022-12-12 15:09:32 +05:30
Rishabh Garg
d7fc3a5e48
Cleaned up old plan UI code in portal (#15805)
closes https://github.com/TryGhost/Team/issues/1889

Portal's UI, specially for Signup and Account Upgrade, has changed a lot as we went from single tier -> multiple prices -> multiple tiers. This change removes the old unused `PlansSection` and related components that are no longer in use anywhere in Portal UI since we transitioned to Products(tiers).

- removes unused `ChangeProductPlansSection` component
- removes unused `PlanSectionStyles` to cleanup unused styles
2022-12-12 14:54:03 +05:30
Rishabh
4e766e2584 Fixed broken playwright tests
refs https://github.com/TryGhost/Team/issues/2371

- playwright tests were broken due to state changes based on prev tests that were not accounted for
- in case of multiple newsletters, portal tests expected another step between stripe checkout for newsletter selection
- site settings test was disabling members, but not re-enabling it back
2022-12-12 14:50:34 +05:30
Elena Baidakova
8b92b49363
Added data test attributes (#15981)
refs TryGhost/Team#2371
2022-12-12 10:23:13 +04:00
Elena Baidakova
88b056dc86
Added Playwright member's actions tests (#15968)
refs TryGhost/Team#2371
- check that members can unsubscribe from newsletters by toggling
preferences in their account settings
- check that member can log out
2022-12-12 10:13:08 +04:00
Rishabh
aa706bc569 Removed one-time offer from being shown in portal
refs https://github.com/TryGhost/Team/issues/2376

When a discount offer for a first-payment is setup, when a member views their plan details in Portal, it still shows the discounted price, it shows the discounted offer instead of the actual price they will be charged next time, which is incorrect.
For one time payments, we'll not reflect the discount in portal as the member will not receive that discount going forward.
2022-12-12 11:32:47 +05:30
renovate[bot]
3550c629e4 Update dependency ember-auto-import to v2.5.0 2022-12-12 11:17:40 +07:00
renovate[bot]
1fc553e258 Update sentry-javascript monorepo to v7.24.2 2022-12-12 10:42:56 +07:00
renovate[bot]
76c096ae82 Update dependency postcss to v8.4.20 2022-12-12 10:42:35 +07:00
Ghost CI
8d7aa3079f v5.25.3 2022-12-09 16:01:15 +00:00
Rishabh
960250e99e Fixed email suppressed page portal tests
- tests were failing due to copy changes that made the test selectors fail to fetch the element
- for future, we should switch to using test ids here instead of text as they can easily change causing these failures
2022-12-09 19:40:10 +05:30
Rishabh Garg
109bce8096
Fixed portal comp upgrade playwright tests (#15977)
refs
f5aae1e2c5
refs
0f9ed54a6f

- changing playwright portal tests to work for single tier setup caused failure for comped upgrade tests as they were relying on button text that changed
2022-12-09 19:19:13 +05:30
Rishabh Garg
33458daae8
🐛 Fixed free trial applied alongside an offer in checkout (#15975)
refs https://github.com/TryGhost/Team/issues/2375

If a discount offer is associated with a tier that has a free trial enabled on full price / standard portal in membership settings, then the stripe checkout applied both the discount and free trial to the member, which is incorrect as we shouldn't be combining both.

- removes trial days from stripe checkout if a coupon is being applied, so only one of them is applied at a time
2022-12-09 18:47:05 +05:30
Peter Zimon
2e87ceae1f Portal copy refinements
refs. https://github.com/TryGhost/Team/issues/2348

- re-enable email button had outdated copy
2022-12-09 14:08:03 +01:00
Kevin Ansfield
9fd87f565d Migrated <GhValidationStatusContainer> to {{validation-status}} modifier
no issue

- moved logic from `<GhValidationStatusContainer>` to a new `validation-status` modifier
  - removes a usage of the `ValidationState` mixin
  - migrated uses of the component to a mixin
  - paves the way for full removal of the `ValidationState` mixin in later refactors (mixins are deprecated)
- migrated `<GhFormGroup>` to a glimmer component
  - swapped the extend of `GhValidationStatusContainer` to usage of the `validation-status` modifier with a template-only component
  - updated all `<GhFormGroup>` to use the standard `class=""` instead of `@classNames=""` and `@class=""`
  - allows `data-test-*` attributes to be added to uses of `<FormGroup>` to help when complex components are grouped as a form input
2022-12-09 12:38:35 +00:00
Peter Zimon
34d99c92e0 Updated email FAQ
refs. https://github.com/TryGhost/Team/issues/2348

- updated copy for not receiving emails FAQ. It's still WIP, from addresses need to be wired in
2022-12-09 13:28:06 +01:00
Simon Backx
9e6f5e93d8
🐛 Fixed email header images serving original image size (#15950)
fixes https://github.com/TryGhost/Team/issues/2368

- Removed the usage of the `isLocalContentImage` Koenig util for the
email header and feature image url generation.
- While we were trying to set the width to 1200px, we didn't have that
size hardcoded. So that url would redirect back to the original location
instead of serving a smaller image. So I added a new internal size to
the `imageOptimization` config.
- This is fixed in both the new and old email flow and includes some
extra tests for the new flow.
2022-12-09 11:17:22 +01:00
Peter Zimon
527d718b76
Added extra assertions to Offers tests (#15956)
refs. https://github.com/TryGhost/Team/issues/2371

- two extra assertion was needed for discount and free-trials to check
if the offers are listed in ‘Active’ offers and the URLs load portal
2022-12-09 08:56:41 +01:00
Naz
ffd07ea744
Added Playwright "Private site" test
refs https://github.com/TryGhost/Team/issues/2371

- Test enabling private site and checking access with a password
- The test flow is lacking a check for site access through password
due to a Playwirght bug. This should be cleaned up in the future
2022-12-09 14:01:19 +07:00
Peter Zimon
be84593684 Fixed offers archive test
refs. https://github.com/TryGhost/Team/issues/2371

- deleteAllMembers was an unnecessary step
- since there's a generated code appended to the name of the archived offer, it had to be shorter to avoid potential naming conflicts
2022-12-09 07:48:24 +01:00
Fabien "egg" O'Carroll
adae605555 Moved unsubscribing members behind feature flag
refs https://github.com/TryGhost/Team/issues/2367

We're not releasing this immediately so need to put it behind the flag
so that we continue to send emails to the correct members.
2022-12-09 13:24:25 +07:00
Ronald Langeveld
d62f09c588 Added filtered list labelling playwright test
ref https://github.com/TryGhost/Team/issues/2371

- Filters and then adds label to filtered members
2022-12-09 12:56:34 +07:00
Sanne de Vries
9b819698e8 Fixed title attributes on headings in editor toolbar
No ref
2022-12-09 10:10:34 +07:00
renovate[bot]
5407902577
Update dependency supertest to v6.3.3 2022-12-08 17:16:37 +00:00
Simon Backx
e7572fc111 Added Playwright test for disabled subscription access
refs https://github.com/TryGhost/Team/issues/2371

Portal should be disabled on the frontend, sending as a newsletter should no longer be an option when publishing
2022-12-08 17:58:03 +01:00
Djordje Vlaisavljevic
82aa9522dc Added playwright test for updating atier
refs TryGhost/Team#2371

- Tests that tier details can be updated
- Tests that the updates are reflected in Portal
2022-12-08 17:40:42 +01:00
Simon Backx
6af149120a Added Playwright test for invite only sites
refs https://github.com/TryGhost/Team/issues/2371

Tests if an invite only site disables sign up.
2022-12-08 17:27:30 +01:00
Rishabh
f5aae1e2c5 Updated playwright tests for portal member upgrade
refs https://github.com/TryGhost/Team/issues/2371

- updated setup to ensure single tier for testing single tier flows
- updated portal test to use utils and new data test ids
2022-12-08 21:09:19 +05:30
Simon Backx
08206f367f Removed publishing spec only test 2022-12-08 15:30:27 +01:00
Simon Backx
7c6e9c6ecf Added Playwright tests for scheduled post emails
refs https://github.com/TryGhost/Team/issues/2371

- Added some more utility methods to the Publishing spec
- Added tests for scheduled pusblish+send and send flows
2022-12-08 15:24:37 +01:00
Kevin Ansfield
f2e1d77a0f Fixed linter error 2022-12-08 14:02:27 +00:00
Simon Backx
80258cd396 Added Playwright tests for publishing post with email
refs https://github.com/TryGhost/Team/issues/2371

- Adds a test for publishing and sending
- Adds a test for email only sending
- Updated some util methods in the publishing spec to remove the dependency on the post bookmark (which is not present for email only posts)
2022-12-08 14:38:12 +01:00
Sam Lord
3449c49c10 Tidy up the mocking utility for Mailgun
no issue
Moved the mocking into the Playwright specific codebase, since this will only be used in browser based testing
2022-12-08 13:01:35 +00:00
Sam Lord
249802d62b Added mailgun mock to allow publishing workflow to run
no issue
2022-12-08 13:01:35 +00:00
Naz
4c6a86eca4 Added mocked Mailgun client to browser test env
refs https://github.com/TryGhost/Ghost/pull/15959

- To be able to test and intercept emails we need a mock in test environment - avoids making calls to the Mailgun API
2022-12-08 13:01:35 +00:00
Sodbileg Gansukh
3d6753a54a Added create comped member test
refs https://github.com/TryGhost/Team/issues/2371

A member can be granted a comp in admin, that account should be able to access paid content.
2022-12-08 20:59:12 +08:00
Fabien "egg" O'Carroll
0f9ed54a6f Tested upgrading to a paid subscription from comped
refs https://github.com/TryGhost/Team/issues/2371

Note that the "Choose" button is "Continue" when running this test
standalone so currently it needs to run with the full suite.
2022-12-08 19:54:56 +07:00
Kevin Ansfield
88c8bf7dbc Added compedPlan option to createMember test util
refs https://github.com/TryGhost/Team/issues/2371

Usage:

```
await createTier(page, {name: 'Silver', monthlyPrice: 5, yearlyPrice: 50});
await createMember(page, {email: 'silver@example.com', compedPlan: 'Silver'});
```
2022-12-08 12:17:31 +00:00
Kevin Ansfield
1f22edb47c Removed errant page.pause() 2022-12-08 12:09:54 +00:00
Kevin Ansfield
4eeaca7ab8 Extracted openPostSettingsMenu and setPostVisibility test utils
refs https://github.com/TryGhost/Team/issues/2371

- extracting the re-used actions to utils allows tests to be self-descriptive rather than relying on comments and keeps the selectors and related actions in one place to help refactoring if/when they change
2022-12-08 12:02:22 +00:00
James Morris
e44f10bc5d Updated Playwright test: Sign up for paid plan via portal - single tier
refs https://github.com/TryGhost/Team/issues/2371

- Includes new data-test-* attributes
- Includes better checking of paid tier from member
2022-12-08 11:54:32 +00:00
Kevin Ansfield
9d434b8105 Removed errant page.pause() 2022-12-08 11:27:47 +00:00
Peter Zimon
8e9245bb91 Added archive offers test
refs. https://github.com/TryGhost/Team/issues/2371

- Test for archived offers should be moved to ‘Archived’ view of the offer list in Admin, and the offer URL should redirect to the site's homepage for logged out visitors
2022-12-08 12:21:52 +01:00
Rishabh
d04048718c Updated portal with data test attributes
refs https://github.com/TryGhost/Team/issues/2371

- bumps portal to latest that includes data test attributes for playwright testing
2022-12-08 16:28:22 +05:30
Rishabh
a71f096905 Released Portal v2.21.0 2022-12-08 16:26:17 +05:30
Rishabh
b3db2d38f7 Added data test attributes for Portal
refs https://github.com/TryGhost/Team/issues/2371

- adds data attributes to portal action buttons/inputs/switches for playwright tests
2022-12-08 16:25:29 +05:30
Kevin Ansfield
df72182e2d
Further attempt to fix update-published-post test in CI (#15964)
refs https://github.com/TryGhost/Team/issues/2371

- bumped timeout between saving and refreshing to account for slower
speeds in CI
- increased specificity for the frontend text comparisons so the output
when failing is smaller and easier to parse
2022-12-08 10:36:33 +00:00
James Morris
991b60a342 Added the Playwright test: Sign up for paid plan via portal - single tier 2022-12-08 10:23:35 +00:00
Simon Backx
c78a04f54c Increased Sentry maxValueLength to 1000
refs https://ghost.slack.com/archives/C02G9E68C/p1670342388977959

Sentry truncates important information in error messages (e.g. errors with long MySQL queries). Increasing maxValueLength should give us more information for those errors.

Sentry documentation: https://docs.sentry.io/platforms/javascript/configuration/options/#max-value-length
2022-12-08 11:15:52 +01:00
Simon Backx
641364876c Added Playwright test to unschedule a post
refs https://github.com/TryGhost/Team/issues/2371

- Schedule and unschedule a post
- Also includes some extra status checks
2022-12-08 11:13:54 +01:00
Rishabh
ae3d85d2c4 Added playwright test for paid member switching plans
refs https://github.com/TryGhost/Team/issues/2371

- tests that a paid member can switch between monthly and yearly plans after logging in
2022-12-08 15:35:41 +05:30
Rishabh
bc9b8a22f0 Added test data attributes to Portal for playwright tests
refs https://github.com/TryGhost/Team/issues/2371

- adds `data-test-*` attributes to portal across pages to allow easily capturing buttons/switches for playwright tests
2022-12-08 15:35:41 +05:30
Kevin Ansfield
7371addbc5 Another attempt to fix update-published-post test in CI
refs https://github.com/TryGhost/Team/issues/2371

- the 100ms timeout was enough for local tests to pass but was still failing on CI
- bumped to 200ms and skipped the creation of a new paragraph to reduce what the editor is doing
2022-12-08 09:59:20 +00:00
Kevin Ansfield
8ddf1f0215 Fixed update-published-post Playwright test
refs https://github.com/TryGhost/Team/issues/2371

- added timeout between clicking the editor and starting to type otherwise some of the typing events could be missed causing a mismatch in actual vs expected output
2022-12-08 09:39:05 +00:00
Ronald Langeveld
3e62764a64 Added csv validation, members export Playwright test
ref https://github.com/TryGhost/Team/issues/2371

- updated Member exports with csv validation
- added member fixtures to be loaded into Ghost to ensure filtering
  works correctly when downloading / exporting members csv.
2022-12-08 16:33:27 +07:00
Simon Backx
c1fc0d8888 Added Playwright test to schedule a Page
refs https://github.com/TryGhost/Team/issues/2371

Schedule a page and check if it is only published at the scheduled time.
2022-12-08 10:25:30 +01:00
Simon Backx
0dbc10a41a Added Playwright test for publishing a page
refs https://github.com/TryGhost/Team/issues/2371

Publish a page and verify that the page is published.
2022-12-08 10:24:35 +01:00
Naz
739bda9bb8
Fixed publishing type selectors in playwright
refs https://github.com/TryGhost/Team/issues/2371

- The "data-test-*" selectors in playwright did not work with publishing channel selectors. This is a quick hack to enable working around it
2022-12-08 14:38:59 +07:00
Ronald Langeveld
9a99b81ea4 Added Playwright test for filtered members export
ref https://github.com/TryGhost/Team/issues/2371

- Added test for exporting a set of filtered members
2022-12-08 13:20:29 +07:00
Fabien "egg" O'Carroll
69e080e9a0 Removed filtering in mega
This is no longer necessary as we unsubscribe members from newsletters when
their email is suppressed.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
939e3ce96f Fixed suppression list handling of spam complaint events
refs https://github.com/TryGhost/Team/issues/2351

We were storing all suppressions with a reason of bounced, rather than
spam for spam complaint events.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
5749a17910 Cleaned up EmailEventStorage tests
This ensures that services aren't required before boot, so that they are
initialised in the correct order.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
9736d942e1 Unsubscribed Members from newsletters when their email is suppressed
refs https://github.com/TryGhost/Team/issues/2367

This ensures that a Member is not considered subscribed to any emails, so that
counts for newsletter recipients are correct. Eventually we will filter members
on their email suppression status but this is not implemented yet.
2022-12-08 13:02:36 +07:00
Ronald Langeveld
7567997dbf Added Playwright test for member exports
ref https://github.com/TryGhost/Team/issues/2371

- Tests whether a CSV can be exported with all members
2022-12-08 12:27:41 +07:00
Sanne de Vries
0ebb3cbefe Added Playwright "Post visibility" tests
Refs https://github.com/TryGhost/Team/issues/2371

- Tests whether the post access selection of public, members, or paid-members matches the expected post visibility on the frontend.
2022-12-08 11:26:44 +07:00
Kevin Ansfield
460b031969 Added additional post setting changes to e2e published post update test
refs https://github.com/TryGhost/Team/issues/2371

- tests both the post body and settings in the PSM take effect when saving
2022-12-07 18:18:48 +00:00
Rishabh
e24a67b882 Fixed member upgrade portal playwright test
refs b6db85a5d6

- portal upgrade test used duplicate email which caused the member creation to fail
- also updates the tier selection for checkout
2022-12-07 22:45:12 +05:30
Simon Backx
b615c9f7d2
Added post scheduling Playwright test and loosened time restrictions (#15960)
refs https://github.com/TryGhost/Team/issues/2371

- Adds a test that schedules a post 5 seconds in the future and waits
for it to be published
- Reduced the time restrictions for scheduling: 
    - The minimum time in the frontend is now 5 seconds in the future (came
from 5 minutes in the future)
    - The time picker now suggests 10 minutes in the future instead of the
minimum scheduling time (came from 5 minutes)
    - In the backend, a post will be allowed to be scheduled if it is at
least 2 minutes in the past (came from 2 minutes in the future)
    - The scheduler will publish a post if it is at least 5 minutes in the
past, and maximum 5 minutes in the future (came from 2 minutes)
2022-12-07 17:29:36 +01:00
Djordje Vlaisavljevic
2464d45b4a Added playwright test for creating additional tier
refs TryGhost/Team#2371

- Tests that an additional tier can be created and that it'll appear in portal settings unselected by default
2022-12-07 17:26:11 +01:00
Rishabh Garg
b6db85a5d6
Added playwright test for free member upgrade via portal (#15961)
refs https://github.com/TryGhost/Team/issues/2371

- tests that a free member can upgrade to a paid tier via stripe checkout and the payment details are reflected in portal and member detail page on admin
2022-12-07 21:41:55 +05:30
Fabien "egg" O'Carroll
80b766047e Added defaults for monthly and yearly price
refs https://github.com/TryGhost/Team/issues/2362

Rather than throwing when we encounter a Tier price of 0, we can instead default
to the standard yearly and monthly price.
2022-12-07 22:02:37 +07:00
Hannah Wolfe
205664f75f
Updated Playwright createTier util to be repeatable
- we have to close the premium tier list after creating a tier, else we can't create another one
2022-12-07 14:32:26 +00:00
Kevin Ansfield
3bd9e2ecfe
Added Playwright "Update published post" test (#15958)
refs https://github.com/TryGhost/Team/issues/2371

- tests modifying the content of a published post
- extracted publish flow into a `publishPost` function that returns a new browser page object with the newly created post loaded
2022-12-07 14:13:23 +00:00
Ronald Langeveld
5bd82bc6d7 Added Playwright test for Member Impersonation
ref https://github.com/TryGhost/Team/issues/2371

- tests whether an impersonation link gets generated as well as whether
  the link authenticates the user on a new page.
2022-12-07 19:26:23 +07:00
Simon Backx
31855ba75a Added Playwright publish only test
refs https://github.com/TryGhost/Team/issues/2371

Test publishing flow for publish only posts.
2022-12-07 12:03:56 +01:00
Sam Lord
d6072ea0e8 Record tests using same setup as the test runner
no issue
2022-12-07 10:59:45 +00:00
Ronald Langeveld
8c41807978 Added Playwright test for deleting members from Admin.
ref https://github.com/TryGhost/Team/issues/2371

- This test will delete the previously added and editor member, returning the initial member state with no members.
2022-12-07 17:00:36 +07:00
Daniel Lockyer
1e27dd638f
Added Playwright check that Offer redemption count was incremented
refs https://github.com/TryGhost/Team/issues/2369

- this checks whether the Offer redemption count is set to 1, which
  would be indicative that the Offer was successfully counted as
  redeemed
2022-12-07 16:52:58 +07:00
Daniel Lockyer
464504a8e1
Avoided config.local.json loading in testing-browser environment
- this should be checking if we're in any of the testing envionments and
  avoid loading the `config.local.json` file if so
2022-12-07 16:25:23 +07:00
Ghost CI
e323d6162c Merged v5.25.2 into main 2022-12-07 09:04:25 +00:00
Ghost CI
a014817aa9 v5.25.2 2022-12-07 09:04:22 +00:00
Rishabh Garg
8bdad78377
🐛 Fixed broken redemption count for offers (#15954)
refs https://github.com/TryGhost/Team/issues/2369

- offer id was not getting attached to stripe checkout metadata, causing the checkout event to not store any offer information for a subscription. This got changed in a prev refactor [here](25d8d694a0 (diff-b7dfcd660902a2a20dff7da5e886d8e10234bda4ba78228255afc8d4a8e78cf6L206))
- cleans up offer id handling for checkout session event
2022-12-07 14:30:11 +05:30
Kevin Ansfield
df6de75c80 Disabled stripping of test selectors in all builds
no issue

- we want to run e2e tests against production Ghost instances and having test selectors available means much less brittle tests
- only real impact from keeping the selectors is extra file size in production builds but that is minimal (~6KB gzipped at time of commit)
2022-12-07 08:54:04 +00:00
Ronald Langeveld
1a879f9550 Added label and unsubscribe toggle on members test.
ref https://github.com/TryGhost/Team/issues/2371

- Editing members requires Label prefilled before the test runs so we can test making changes to that data.
2022-12-07 15:45:00 +07:00
Ronald Langeveld
f5bc7353b0 Added Playwright test for editing a member in admin
ref https://github.com/TryGhost/Team/issues/2371

- tests for editing a member inside admin
2022-12-07 13:02:48 +07:00
Ronald Langeveld
d60c50751b Added playwright test for creating a new member in admin
ref https://www.notion.so/ghost/Critical-Paths-980dd089c3e74a6fbc619271f5a9ce42

- this test will add a new member via the admin.
- it also tests to ensure the added member is displayed after heading back to the members list page.
2022-12-07 12:35:16 +07:00
Daniel Lockyer
d64d8c0ddd
Added Playwright test for creating and using a free-trial Offer
refs https://www.notion.so/ghost/Critical-Paths-980dd089c3e74a6fbc619271f5a9ce42

- this test will create a free-trial Offer and go through Stripe
  checkout, ensuring the member is created as paid
- also changes some utils to support creating the free-trial offer vs
  just a discounted Offer
2022-12-07 11:29:05 +07:00
Daniel Lockyer
41e1f0b568
Removed workaround for Members modal bug
refs 3817f583fa

- this should no longer be needed because the underlying bug was fixed
  and the modal should no longer show
2022-12-07 10:51:44 +07:00
Daniel Lockyer
63af7633d8
Added yarn test:browser:single to run single browser tests
- this should enable you to run a single test file without waiting for
  all others
2022-12-07 10:47:01 +07:00
Daniel Lockyer
16f3ba573b
Updated ghost_head snapshots
refs de97d90cf9

- this should have been updated when I deleted some extraneous config
  that was lurking in the testing config files
2022-12-07 10:24:44 +07:00
Daniel Lockyer
570b697b4a
Fixed double slashes in Stripe webhook URL
- `getSiteUrl` already returns a trailing slash so we shouldn't add
  another one in the path
2022-12-07 10:18:21 +07:00
Daniel Lockyer
de97d90cf9
Removed sodoSearch block from testing config
- I'm not even sure what this is doing here but we should be using the
  values from the default config, which are currently different from
  this
2022-12-07 09:46:49 +07:00
Naz
6ef5e6a7e0 Fixed local environment for playwright tests
refs https://github.com/TryGhost/Toolbox/issues/479

- this includes a handful of improvements to get Playwright working on a
  local environment including:
  - adding `testing-browser` environment so we don't nuke `development`
    environments, and makes all the necessary changes to get Ghost to
    behave when this is running
  - stopped running one global instance of Ghost as this doesn't provide
    a clean environment
  - copies a few default fixtures that are needed for the new
    environment
2022-12-07 09:44:05 +07:00
Ronald Langeveld
a302e8289f
Added Unsplash API config to Lexical (#15948)
no issue

- added default headers and app_id for React-Koenig-Lexical to consume.
2022-12-07 09:20:11 +07:00
Kevin Ansfield
1f06407878 Fixed "Cannot destructure property 'ratio'" errors
sentry ADMIN-C05

- resizing the window (or changing orientation) when viewing a single photo inside the Unsplash image selector was throwing errors because the event handler `setZoomedSize()` call was not passed the same arguments as the typical call made in `modify()`
- moved the `element` and `ratio` properties onto the class so they are preserved and ready to be used without being explicitly passed in when `setZoomedSize()` is called as part of an event
2022-12-06 17:23:38 +00:00
Kevin Ansfield
65de55ae89
Fixed unnecessary identity requests and 403s for non-Owner accounts (#15949)
no issue

`<GhBillingIframe>` generates a request to the `/identities/` endpoint every time Admin is accessed for all users, however that endpoint is only accessible to users with the Owner role meaning we have a lot of unnecessary 403 errors in event logs and the developer console.

- added early exit when we know the logged in user doesn't have the Owner role
- removed the subscription fetching code that wasn't reachable (`token` was always `undefined`)
  - the BMA sends subscription data as soon as it's available so the extra fetch isn't necessary
2022-12-06 15:20:57 +00:00
Daniel Lockyer
d04abc90b4
Added test group names
- this helps differentiate between the different tests we have available
2022-12-06 19:18:16 +07:00
Daniel Lockyer
97e5ca1de6
Extracted Playwright tests into separate files
- we should start to keep tests grouped by their area, so first we split
  by Admin tests and then Portal tests, and within that we split into
  setup/Tiers/Offers etc
2022-12-06 19:08:09 +07:00
Kevin Ansfield
b68686fe9c Fixed 403 newsletters request for contributors when opening editor
closes https://github.com/TryGhost/Team/issues/2242

Contributors don't have permission to fetch `/newsletters/` but the publish flow was sending a request every time a contributor opened a post in the editor creating noise in event logs and in the developer console.

- disabled the newsletters fetch when the logged in user is a contributor
- contributors can't publish so the "missing" data has no effect on the publish flow as it's not used
2022-12-06 11:18:29 +00:00
Simon Backx
58ba154ed7 🐛 Hid the analtyics page for editors
fixes https://github.com/TryGhost/Team/issues/2302

The analytics page should not be visible for Editors (and doesn't work currently anyway). This commit removes the button that goes to the analytics page for editors and authors.
2022-12-06 11:10:58 +01:00
Elena Baidakova
62681037f0
Added email_suppression property to response for PUT api/member method (#15946)
closes TryGhost/Team#2359
- Keep the same response structure for `api/member` GET and PUT methods
2022-12-06 13:51:26 +04:00
Naz
0ab652b768
Fixed playwright port
refs https://github.com/TryGhost/Toolbox/issues/479

- e2e and integration test suites are running on port 2369. Playwright was not following this convention, without good reason.
- Port 2368 is the default port for development and production processes, so using it for test environment is not ideal
2022-12-06 16:14:37 +07:00
Ghost CI
54b693a359 Merged v5.25.1 into main 2022-12-06 05:14:41 +00:00
Ghost CI
55b0f564ba v5.25.1 2022-12-06 05:14:37 +00:00
Simon Backx
c47891c3f6
🐛 Fixed setting delivered_at to null after hard bounce (#15942)
refs https://ghost.slack.com/archives/C02G9E68C/p1670075366333929?thread_ts=1669963540.980309&cid=C02G9E68C

When we receive a permanent bounce/failure, we set delivered_at to null.
But we don't want to lose this information.

Instead we should be able to handle recipients that both have failed_at
and delivered_at set.
2022-12-06 10:26:54 +05:30
Kevin Ansfield
1685a84a27 Fixed incorrect property access
refs 0e181c84b2

- the code is already running in the `session` service so it shouldn't access the role property via a non-existing injection
2022-12-05 17:17:47 +00:00
Kevin Ansfield
0e181c84b2 Added user role to captured Sentry data
closes https://github.com/TryGhost/Team/issues/2241

- as part of the authenticated application setup, update the captured Sentry data with the user role
- helps narrow things down when we see permission errors pop up due to requests being made for endpoints that the current user doesn't have permission to access
2022-12-05 17:15:55 +00:00
Sam Lord
d3716007bf
Fixed browser-based tests running in CI
refs: https://github.com/TryGhost/Toolbox/issues/481

* Correctly setup environment variable to run both local & staging browser-based tests
* Use non-production Ghost Admin build, since production builds require HTTPS to use Stripe Connect
2022-12-05 13:39:10 +00:00
Simon Backx
bededf4520
🐛 Fixed errors of old events from deleted members (#15944)
refs https://ghost.slack.com/archives/C02G9E68C/p1670215917451249

When a member is deleted, and we receive an opened event for an email to
that member. We threw an uncaught Bookshelf EmptyResponse error.

- This change makes fetching the member not a requirement when handling
that event in the last seen at updater.
- It also adds try catches for all event listeners in the last seen at
updater
2022-12-05 14:36:23 +01:00
Elena Baidakova
5e973688bf
Added redirect to Email Preferences in Portal after resubscribing (#15940)
closes TryGhost/Team#2360
- Redirect member to Email Preferences after email removed from
suppression list.
2022-12-05 15:58:55 +04:00
Kevin Ansfield
3817f583fa 🐛 Fixed unexpected "unsaved changes" modal when deleting a member
closes https://github.com/TryGhost/Team/issues/2275

When deleting a member, after confirming deletion another "unsaved changes" modal popped up. From that point, if you clicked to stay you remained on the member screen with stale data (the member was still deleted) resulting in further errors when any attempt to make changes was made.

- prevented the unsaved changes check running for a deleted member because it would always return `true` in that case
- ensured the data setup for the unsaved changes check still occurs when a member is accessed directly via the URL
  - previously it was skipped because the data setup only occurred inside `fetchMemberTask` but that isn't called when the route already loaded the model via it's `model()` hook
2022-12-05 11:48:37 +00:00
Naz
879aad263d
Added email verification trigger test
refs https://github.com/TryGhost/Toolbox/issues/476

- The email verification trigger and host settings related bugs have been a cause of bugs in past releases.  The admin client verification source did not have any test coverage in the past.
- The members test suite size is getting out of hand. This test is quite verbose, because of the state it's trying to check.
- In the future we should consider splitting up Member API (and probably other) test suites into smaller pieces.
2022-12-05 18:24:28 +07:00
Simon Backx
2519f4b20d Disabled autoRefresh for batch sending service to increase performance
fixes https://github.com/TryGhost/Team/issues/2363
2022-12-05 12:09:30 +01:00
Naz
e170f293e3
Extracted sleep method to e2e framework module
no issue

- The sleep method has been used in 8 modules reimplementing the same thing over and over again. It's usually a sign of async event processing outside of the request/response loop. It's good to have a single point of implementation for a "hack" like this, so we could track it easier and address the even processing delay in a more optimal way centrally if it ever becomes a bottleneck
2022-12-05 17:26:29 +07:00
Elena Baidakova
0caf8bff18
Renamed all references to "Flagged as spam email" (#15938)
closes TryGhost/Team#2352
2022-12-05 12:07:26 +04:00
Elena Baidakova
f09ed78af2
Fixing the misalignment of avatar between member activity and member detail (#15939)
closes TryGhost/Team#2356
2022-12-05 11:59:17 +04:00
renovate[bot]
82722bbf43
Update dependency fastq to v1.14.0 2022-12-05 04:20:14 +00:00
renovate[bot]
b8ab57b692 Update dependency expect to v29 2022-12-05 11:16:46 +07:00
renovate[bot]
7f169cdd96 Update dependency html-validate to v7.10.1 2022-12-05 10:21:00 +07:00
renovate[bot]
1e2c45f208 Update dependency terser to v5.16.1 2022-12-05 10:20:15 +07:00
renovate[bot]
cdca9d73b3
Update Test & linting packages 2022-12-02 23:05:46 +00:00
Sam Lord
00d223991d Improved browser test CI integration
refs: https://github.com/TryGhost/Toolbox/issues/481
2022-12-02 17:04:04 +00:00
Sam Lord
7bfe5db716 Ensure tests pass when pointing at a remote server
no issue

This will need some work, since we are introducing a 500ms delay to wait for a network request to return. Ideally the tier expander should eventually populate itself.
2022-12-02 17:04:04 +00:00
Sam Lord
47526bc175 Fixed Portal test in browser suite
no issue
2022-12-02 17:04:04 +00:00
Sam Lord
40903c3136 Fixed browser-based tests in local context
no issue

Local tests can now setup Stripe during the global setup process, and the webhook server is run out-of-process.
Running tests in CI against localhost will use environment variables to setup Stripe.
Providing a test URL will avoid setting up Stripe and will assume that it is already done.
2022-12-02 17:04:04 +00:00
Daniel Lockyer
bc0b1f6adc Added CI for running Playwright tests
🚧
2022-12-02 17:04:04 +00:00
Sam Lord
668e523ab4 Allow playwright tests to run locally and remotely
no issue

This commit allows tests to run remotely by replacing selectors with production-suitable ones (no [data-test...]).

It also allows running locally with Stripe webhooks by adding a new global setup function.
2022-12-02 17:04:04 +00:00
Rishabh
e74ba81276 Refined email debug screen error handling
refs https://github.com/TryGhost/Team/issues/2327
2022-12-02 21:29:07 +05:30
Simon Backx
6ae9b49e73 Added post title to email debug page 2022-12-02 16:51:51 +01:00
Peter Zimon
cd5a85021a Fixed member name alignment on email debug screen
refs. https://github.com/TryGhost/Team/issues/2327

- on the first two tabs of the email debug screen, the member email wasn't aligned properly when there was no name for a member
2022-12-02 16:16:01 +01:00
Rishabh
ddb61c3b3c Wired static expand error logic on email debug
refs https://github.com/TryGhost/Team/issues/2327

- wires the static handling of error message on debug screen with real error
2022-12-02 20:41:08 +05:30
Ghost CI
d9ed6bcdb8 v5.25.0 2022-12-02 15:00:48 +00:00
Peter Zimon
768ba2be50 Minor UI fixes on email debug screen
refs. https://github.com/TryGhost/Team/issues/2327
2022-12-02 15:49:23 +01:00
Peter Zimon
c7600407bd Fixed text color bug in box button links 2022-12-02 15:46:52 +01:00
Simon Backx
ea72934c41
Improved email concurrency sending (#15923)
no issue

Send 10 batches at the same time
2022-12-02 15:30:02 +01:00
Peter Zimon
f562d19f3c Updated error display styles for error debug
refs. https://github.com/TryGhost/Team/issues/2327

- Some minor CSS style changes were needed for errors on the email debug screen. Also we weren't showing any message i - for whatever reason - there was no data for batches.
2022-12-02 15:13:07 +01:00
renovate[bot]
c7d10c2d49 Update Node.js to v18 2022-12-02 14:07:37 +00:00
Simon Backx
fc12767917 Wired up retry button on debug page 2022-12-02 14:57:03 +01:00
Peter Zimon
e0c52d0670 Added static expand error logic to email debug
refs. https://github.com/TryGhost/Team/issues/2327

- The length of the error messages for temporary and permanent failure tabs on the email debug screen can be arbitrary. This degrades scannability and limits the number of displayed rows in the list. Adding an expand button to the error message makes sense since the errors might repeat and the error code + the beginning of the message can be enough to understand them. Also this allows more rows to be displayed per screen.
2022-12-02 14:49:28 +01:00
Simon Backx
b81cc13e48 Fixed email batches and recipient pagination 2022-12-02 14:49:21 +01:00
Simon Backx
928a73c536 Fixed email debug page always showing error + breadcrumb 2022-12-02 14:45:06 +01:00
Peter Zimon
9b276e6aa2 Added empty state handling to email debug tabs
refs. https://github.com/TryGhost/Team/issues/2327

- the lists and tables were completely empty when there was no error or some data was missing
2022-12-02 13:34:30 +01:00
Rishabh
cee94217a8 Fixed lint 2022-12-02 16:22:59 +05:30
Rishabh
d82cfb1d57 Updated static error message on debug screen
refs https://github.com/TryGhost/Team/issues/2327

- updates major error message on email debug screen from the email model
2022-12-02 16:12:48 +05:30
Simon Backx
1958d0db63
Removed spaces and quotes from replacement ids (#15921)
fixes https://github.com/TryGhost/Team/issues/2350
2022-12-02 10:49:01 +01:00
Simon Backx
6fbda0730d Added unit test for paywall and segments 2022-12-02 10:48:29 +01:00
Simon Backx
53b5c152d9 Added email event storage unit tests
refs https://github.com/TryGhost/Team/issues/2339
2022-12-02 10:21:39 +01:00
Rishabh Garg
a8a879ef53
Wired email debug screen with API (#15919)
refs https://github.com/TryGhost/Team/issues/2327

- wires email debug screen with real data from API
- fetches email batch data for showing all batches along with those errored
- fetches all recipient failures - temporary and permanent
- shows email settings that was used for sending out the email
2022-12-02 14:38:40 +05:30
Simon Backx
2a3a72e4d5
Added email debug API (#15915)
fixes https://github.com/TryGhost/Team/issues/2346

- Adds email batch browse endpoint
- Adds email recipient failures browse endpoint
- Adds new fixtures and E2E tests for the new API
- Added support for snapshot tests to have 'nullable' types.
2022-12-02 09:44:32 +01:00
renovate[bot]
46bb38b18a Update sentry-javascript monorepo to v7.23.0 2022-12-02 11:59:31 +07:00
Hannah Wolfe
79dbdff054 Fixed error logging in importer
refs: https://github.com/TryGhost/Toolbox/issues/431

- the error logging was only outputting 'Content import was unsuccessful' and not outputting the associated error
2022-12-01 19:14:18 +00:00
Rishabh Garg
f9161876b3
Updated unit test coverage for email service (#15913)
refs https://github.com/TryGhost/Team/issues/2339

- adds unit test for email renderer, segmenter and sending service
2022-12-02 00:33:28 +05:30
James Morris
c74857052f Released Portal v2.20.3 2022-12-01 19:01:06 +00:00
James Morris
2405b59f55 Added in the suppression check to stop link from showing on Portal home
refs https://github.com/TryGhost/Team/issues/2348
2022-12-01 18:59:25 +00:00
James Morris
50383316c0 Attempting to add a single newsletter solution for FAQ to get around lack of back stack
refs https://github.com/TryGhost/Team/issues/2348
2022-12-01 18:30:50 +00:00
James Morris
7c392a6d30 Released Portal v2.20.2 2022-12-01 17:48:33 +00:00
James Morris
9953722bcc Fixing unused variable that was making linting failed
refs https://github.com/TryGhost/Team/issues/2348
2022-12-01 17:42:50 +00:00
James Morris
b64ce8fcb6 Removed a broken test from portal to do with suppressions
refs https://github.com/TryGhost/Team/issues/2348
2022-12-01 17:42:50 +00:00
James Morris
6b4b7f207f Adds brand new FAQs and links to Portal based on support documents
- Adds links and new modals for two new FAQs
- Has some checks for suppressions based on member property email_suppressions
- Using different technique for back buttons to simulate bigger stack

refs https://github.com/TryGhost/Team/issues/2348
2022-12-01 17:42:50 +00:00
e.baidakova
6b7d313415 fixup! Added email suppression FAQ modal 2022-12-01 17:42:50 +00:00
e.baidakova
23ded6fb67 Added email suppression FAQ modal 2022-12-01 17:42:50 +00:00
Peter Zimon
7df63d67b4 Added static "Settings" tab to debug screen
refs. https://github.com/TryGhost/Team/issues/2327

- there was only a placeholder for the Settings tab, this adds the structure so we can test and wire in dynamic data
2022-12-01 18:14:55 +01:00
Kevin Ansfield
a855973ac6 Wired up top-of-document handling in Lexical editor
closes https://github.com/TryGhost/Team/issues/2285

- added passthrough of `cursorDidExitAtTop` action so the editor can trigger title input focus on key commands that trigger the cursor to leave the top of document
2022-12-01 16:46:06 +00:00
Peter Zimon
a51f3a124d Added static batch errors to error debug
refs. https://github.com/TryGhost/Team/issues/2327

- the batch errors tab content was just a placeholder, this adds static version to be able to test and wire it in
2022-12-01 17:30:13 +01:00
Simon Backx
0182965aa3 Updated batch sending to log errors separately
fixes https://github.com/TryGhost/Team/issues/2347

Makes sure we can use the error code
2022-12-01 16:35:54 +01:00
Peter Zimon
dee00e36a0 Added static UI to email debug screen
refs. https://github.com/TryGhost/Team/issues/2327

- static UI was needed on the email debug screen for testing and backend wiring
2022-12-01 15:13:48 +01:00
Fabien "egg" O'Carroll
6849a4ef66 Removed mock data from event fetcher
closes https://github.com/TryGhost/Team/issues/2277

This data is no longer needed since we wired up to the mailgun implementation
2022-12-01 20:19:59 +07:00
Fabien "egg" O'Carroll
c5b233ac65 Moved the filtering of suppressed emails behind a flag check
We want to be able to release this code without restricting the
sending of emails on our end, so this logic needs to be behind a
feature flag
2022-12-01 20:14:30 +07:00
Fabien "egg" O'Carroll
2350cacf3a Wired up MailgunEmailSuppressionList
This switches out the in-memory implementation for the mailgun one and
is the final piece in wirign up everything to real data.
2022-12-01 20:14:30 +07:00
Fabien "egg" O'Carroll
a25fdf4052 Added MailgunEmailSuppressionList
refs https://github.com/TryGhost/Team/issues/2253
refs https://github.com/TryGhost/Team/issues/2254
refs https://github.com/TryGhost/Team/issues/2255

This is the implementation of the EmailSuppressionList specific to
Mailgun, it listens for the new events and stores suppressions based
on those.
2022-12-01 20:14:30 +07:00
Fabien "egg" O'Carroll
5e72e42d32 Moved InMemoryEmailSuppressionList to own file
This cleans up the service file so we can make the switch to a Mailgun specific
implementation later.
2022-12-01 20:14:30 +07:00
Fabien "egg" O'Carroll
c6c962d5d6 Added methods for removing suppressions from Mailgun
refs https://github.com/TryGhost/Team/issues/2255

These methods will be used by the Mailgun implementation of EmailSuppressionList
so that emails are removed from both our internal list and Mailguns.
2022-12-01 20:14:30 +07:00
Simon Backx
4c166e11df
Added E2E tests for batch sending (#15910)
refs https://github.com/TryGhost/Team/issues/2339

- Includes a new pattern in the job manager that allows us to properly
await jobs.
- Added new convenience mocking methods to stub settings
- Tests the main flows for bulk sending:
    - Sending in multiple batches
    - Sending to multiple segments
    - Handling a failed batch and retrying that batch
- Fixes bug in batch generation (ordering not working)

In a different PR I'll add more detailed tests.
2022-12-01 13:43:49 +01:00
Rishabh Garg
a5ca64f693
Added basic email debug design (#15914)
refs https://github.com/TryGhost/Team/issues/2327

As part of improving visibility for email failures, this change adds a new debug screen that allows visualising the email failures for a post. The screen is hidden on the UI for now and only accessible via URL directly.

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2022-12-01 17:58:37 +05:30
Fabien "egg" O'Carroll
12219fed65 Handled receiving duplicate SpamComplaintEvents
We need to check for both ER_DUP_ENTRY and SQLITE_CONSTRAINT because
different DB engines give us back different error codes.
2022-12-01 17:27:06 +07:00
Fabien "egg" O'Carroll
c0e91c73d3 Added unique constraint to email_spam_complaint_events table
We can fetch the same event multiple times from Mailgun so we need to
be able to protect against inserting duplicate events in the
database. This will allow us to catch duplicate errors on insert when
handling complaint events.
2022-12-01 17:27:02 +07:00
Fabien "egg" O'Carroll
f9fdee1b28 Wired up storage of EmailSpamComplaintEvents
refs https://github.com/TryGhost/Team/issues/2337

This also removes the code which unsubscribes members from newsletters because
that is not the spec of the feature.
2022-12-01 17:26:59 +07:00
Fabien "egg" O'Carroll
9c691f3ea9 Added support for EmailSpamComplaintEvent to activity feed
We need to add relations and filterRelations to the model so that we can
correctly filter events by post_id and member_id
2022-12-01 17:26:24 +07:00
Naz
04d9cbb1eb Removed unused members settings module
no issue

- This module is marked for deletion with a todo comment.  It also popped up as least covered place in the codebase, because it was never used.
2022-12-01 16:12:09 +07:00
Simon Backx
d8187123af
Added storage for email failures (#15901)
fixes https://github.com/TryGhost/Team/issues/2332

Saves events in the database and collects error information.

Do note that we can emit the same events multiple times, and as a result
out of order. That means we should correctly handle that a delivered
event might be fired after a permanent failure. So a delivered event is
ignored if the email is already marked as failed. Also delivered_at is
reset to null when we receive a permanent failure.
2022-12-01 10:00:53 +01:00
Kevin Ansfield
a1ee04b08f Wired up title->editor keyboard handling in Lexical editor
closes https://github.com/TryGhost/Team/issues/2286

- use the `registerAPI` prop to get access to a basic API for focusing and inserting paragraphs
- replaced commented mobiledoc based title key handling with lexical handling
2022-11-30 22:04:02 +00:00
Elena Baidakova
95c3a68c34
Updated the filter naming in Post Analytics (#15898)
closes TryGhost/Team#2329
- Replace 'Received' on 'Sent' in member's filter
- Moved links for feedback analytics from chart to table
2022-11-30 17:39:37 +04:00
Simon Backx
26d51687b1
Implemented email previews and tests using new email flow (#15899)
fixes https://github.com/TryGhost/Team/issues/2330

Uses new flow for previewing and testing emails (only if email stability
flag is enabled)
2022-11-30 13:56:28 +01:00
Rishabh Garg
42f9d392a3
Added mailgun provider for sending emails (#15896)
closes https://github.com/TryGhost/Team/issues/2309

- adds new mailgun provider to send out batch emails
- updates sending service to send email id for mailgun provider, allows tagging mail with email id
2022-11-30 16:21:58 +05:30
Naz
0cfef77a01
Removed db schema config from e2e test coverage
refs a2d487e074

- Same reasoning as in referenced commit: "Database schema definition file is a special type of "configuration" file containing mostly static declarations. This sort of code should not be tested by unit tests, rather by e2e tests"
2022-11-30 17:08:47 +07:00
Naz
130f379176
Added "frontend/helpers" to coverage ignore list
refs https://github.com/TryGhost/Toolbox/issues/486

- Frontend helpers are extremely hard to cover fully in e2e tests and are better suited to be covered by unit tests (which they have very hight coverage with)
2022-11-30 17:06:27 +07:00
Naz
aa8fe65665
Added "testmode" app to coverage ignore list
refs https://github.com/TryGhost/Toolbox/issues/486

- Testmode is a special app used for manual testing and has no value in code coverage reports
2022-11-30 16:45:22 +07:00
Naz
80decf8303
Fixed invalid query strings in tests
closes https://github.com/TryGhost/Team/issues/2324

- It seemed like the "limit" query parameter did not work properly returning multiple entries from the endpoint. In reality the whole query string was ignored because of an error in the "filter" part of the query ^_^
2022-11-30 13:31:06 +07:00
Naz
65d910f43b
Increased timeout for the import job test
refs 9fe1274fbe

- Temporary fix to let the CI pass the test. Needs investigation into why MySQL is so much slower comparing to SQLite
2022-11-30 13:25:18 +07:00
Daniel Lockyer
52fc66762a
Updated .npmignore with new files
- these files should not be included in the published package as they're
  for development purposes
2022-11-30 12:40:47 +07:00
renovate[bot]
40c4ae4e00 Update dependency @babel/plugin-proposal-decorators to v7.20.5 2022-11-30 12:28:57 +07:00
renovate[bot]
491cf44f52 Update dependency @sinonjs/fake-timers to v10 2022-11-30 12:26:53 +07:00
renovate[bot]
d6a9b464b3 Update dependency jwks-rsa to v3 2022-11-30 12:24:08 +07:00
renovate[bot]
8682100e58 Update dependency @types/mocha to v10.0.1 2022-11-30 12:23:06 +07:00
Naz
9fe1274fbe
Fixed member import job test
refs https://github.com/TryGhost/Team/issues/2326

-  The job takes considerably longer to run with MySQL, so needed a longer sleep time. It's a temporary fix to unblock a broken build. We should investigate why the job takes so long to run on MySQL
2022-11-30 11:15:12 +07:00
Naz
ff1c17d661
Bumped e2e test coverage thresholds
refs fc9f8aebc1

- With integration & regression test suites included in the e2e coverage reports the coverage has jumped up nicely. We should keep the threshold as hight as possible from accidentally reducing the coverage quality
2022-11-30 10:41:32 +07:00
Naz
fc9f8aebc1
Fixed ci test runs
refs 3e0ec26408

- The refed commit excluded integration/regression test suites from CI test runs by accident
2022-11-30 10:39:32 +07:00
renovate[bot]
fc16bf97da Update dependency postcss-cli to v10.1.0 2022-11-30 10:09:41 +07:00
renovate[bot]
b05434ca91
Update metascraper to v5.32.2 2022-11-29 17:02:07 +00:00
Kevin Ansfield
457c672c6a
Added URL transform for image cards in Lexical documents (#15890)
refs https://github.com/TryGhost/Team/issues/2225

- updated the `formatOnWrite` transform map for posts to include the new `nodes` and `transformMap` options used by `urlUtils` for transforming node payload data
- added `nodes` to the `lexicalLib` module that pulls in our default nodes to be passed in to the URL transform utilities
- added `urlTransformMap` to the `lexicalLib` module that maps transform type and data type to URL transform utility functions that accept a single URL argument
2022-11-29 16:57:01 +00:00
Elena Baidakova
86abab4f1d
Remove member's activity double scrolling (#15897)
closes TryGhost/Team#2325
2022-11-29 16:08:11 +04:00
Fabien "egg" O'Carroll
ba5b8ea33d Added email_spam_complaint_events table and model
refs https://github.com/TryGhost/Team/issues/2318

As with our other events, we've disabled destroy and edit static methods
on the bookshelf model.
2022-11-29 18:13:12 +07:00
Fabien "egg" O'Carroll
83be54af42 Added suppressions table and model
refs https://github.com/TryGhost/Team/issues/2317

This table is used for persisting the email suppression list.
We don't have a member_id column because emails, not members are suppressed.
2022-11-29 18:12:24 +07:00
Simon Backx
f5045b9bf7
Added email renderer implementation draft (#15877)
fixes https://github.com/TryGhost/Team/issues/2308

- Still has some missing pieces, but mostly works.
- Uses new handlebars template for emails
- When sending emails with the new email stability flag enabled, one
test email is now sent via the default smtp ghost mailer.
2022-11-29 11:27:17 +01:00
Simon Backx
f4fdb4fa6c
Added new email event processor (#15879)
fixes https://github.com/TryGhost/Team/issues/2310

This moves the processing of the events from the event-processor to a
new email-event-processor in the email-service package.

- The `EmailEventProcessor` only translates events from
providerId/emailId to their known emailId, memberId and recipientId, and
dispatches the corresponding events.
- Since `EmailEventProcessor` runs in a separate worker thread, we can't
listen for the dispatched events on the main thread. To accomplish this
communication, the events dispatched from the `EmailEventProcessor`
class are 'posted' via the postMessage method and redispatched on the
main thread.
- A new `EmailEventStorage` class reacts to the email events and stores
it in the database. This code mostly corresponds to the (now deleted)
subclass of the old `EmailEventProcessor`
- Updating a members last_seen_at timestamp has moved to the
lastSeenAtUpdater.
- Email events no longer store `ObjectID` because these are not
encodable across threads via postMessage
- Includes new E2E tests that test the storage of all supported Mailgun
events. Note that in these tests we run the processing on the main
thread instead of on a separate thread (couldn't do this because
stubbing is not possible across threads)

There are some missing pieces that will get added in later PRs (this PR
focuses on porting the existing functionality):
- Handling temporary failures/bounces
- Capturing the error messages of bounce events
2022-11-29 11:15:19 +01:00
Fabien 'egg' O'Carroll
a95cc4e7ac
Lowered minimum function coverage tests (#15894)
refs https://github.com/TryGhost/Ghost/pull/15877
refs https://github.com/TryGhost/Ghost/pull/15892

We've been running into issues with unit test coverage in the references
PR's and have tried adding unit tests, but the problem persists. We're
lowering this to unblock development.
2022-11-29 16:55:53 +07:00
Rishabh
64ac47f4ef Added table to store email recipient failures
refs https://github.com/TryGhost/Team/issues/2291

When sending out mails to individual recipients, its possible that recipient gets a temporary or permanent failure for receiving the mail. Temporary failures can generally get resolved after a bit when the recipient’s mail server accepts the email, unlike permanent failures. For both customer visibility and easier debugging on what went wrong while delivering to a particular recipient, we’ll store the permanent/temporary failure for a recipient.

- migration adds a new table that stores the failure information for the recipients
2022-11-29 15:19:36 +05:30
Naz
a2d487e074
Removed db schema config from test coverage
refs https://ghost.slack.com/archives/C02G9E68C/p1669707419081529?thread_ts=1669702577.532999&cid=C02G9E68C
refs https://github.com/TryGhost/Toolbox/issues/117

- Database schema definition file is a special type of "configuration" file containing mostly static declarations. This sort of code should not be tested by unit tests, rather by e2e tests
2022-11-29 14:50:28 +07:00
Naz
5dd6cb909f
Tweaked code coverage config for e2e tests
refs https://github.com/TryGhost/Toolbox/issues/475
refs https://github.com/TryGhost/Toolbox/issues/117

- The frontend/src folded would never get picked up by a code coverage tooling as scripts there are dynamically minimized and served from the server
- There's nothing to cover under frontend/public
- Logic behind these changes is the same as in second referenced issue
2022-11-29 14:22:27 +07:00
Simon Backx
709b40144d Added JSDoc for GhostMailer replyTo message option
no issue
2022-11-28 18:37:51 +01:00
Ghost CI
4a3ac50a82 Merged v5.24.2 into main 2022-11-28 17:36:37 +00:00
Ghost CI
a176d1d36f v5.24.2 2022-11-28 17:36:34 +00:00
Simon Backx
2a832645dd Added getNoReplyAddress settings helper
no issue

New settings method used for https://github.com/TryGhost/Ghost/pull/15877, which shouldn't belong in the member service like it currently is.
2022-11-28 18:28:15 +01:00
Simon Backx
6e72767a50
Fixed verification trigger not working for large imports (#15887)
fixes https://github.com/TryGhost/Team/issues/2326

When importing more than 500 members, we didn't testImportThreshold at
the right time. It was called too early because the importing job was
not awaited. This also adds an E2E test for this case.
2022-11-28 18:22:10 +01:00
Elena Baidakova
1b784b5ec5
Added events to Post Analytics page (#15886)
closes TryGhost/Team#2313
- Added Sent event to Post analytics and Members feed. Now post can be
Sent or Received or Bounced.
- Excluded Delivered event from Sent filter on backend.
2022-11-28 17:43:35 +04:00
Elena Baidakova
fbf761b0ac
Fixed post title in the filter dropdown on the Members page (#15884)
closes TryGhost/Team#2265
2022-11-28 16:47:50 +04:00
Ghost CI
d9b4057fe1 Merged v5.24.1 into main 2022-11-28 11:51:06 +00:00
Ghost CI
2a28fa411b v5.24.1 2022-11-28 11:51:02 +00:00
Naz
60d066b243
🔒 Disabled editable relations by default
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-9gh8-wp53-ccc6
refs https://github.com/TryGhost/Toolbox/issues/465

- Bookshelf relations allows us to edit relational records by default, which was used liberally in the codebase.
- Not having a clear track record of editable relations left the model layer prone to triggering unwanted nested saves and created a vulnerability where members were able to edit newsletter settings.
- With explicit editable relations it's easier to keep track of relations having editable access to related records. Makes the relational data modification pattern safer to use too.
- Anyone running 5.x should update to 5.24.1

Credits: Dave McDaniel and other members of [Cisco Talos](https://talosintelligence.com/vulnerability_reports)
2022-11-28 18:40:26 +07:00
Naz
22738b1b50 🔒 Disabled editable relations by default
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-9gh8-wp53-ccc6
refs https://github.com/TryGhost/Toolbox/issues/465

- Bookshelf relations allows us to edit relational records by default, which was used liberally in the codebase.
- Not having a clear track record of editable relations left the model layer prone to triggering unwanted nested saves and created a vulnerability where members were able to edit newsletter settings.
- With explicit editable relations it's easier to keep track of relations having editable access to related records. Makes the relational data modification pattern safer to use too.
- Anyone running 5.x should update to 5.24.1

Credits: Dave McDaniel and other members of [Cisco Talos](https://talosintelligence.com/vulnerability_reports)
2022-11-28 18:39:39 +07:00
Sam Lord
60b924f173 Use headless mode by default for Playwright tests
no issue

The setting `headless: false` is superceded by using `PWDEBUG=1` as an
environment variable during debug sessions / while working on tests.
2022-11-28 10:52:38 +00:00
Elena Baidakova
1161ab98f9
Rename column to Sent on Dashboard (#15883)
closes TryGhost/Team#2321
2022-11-28 11:22:35 +04:00
Ghost CI
e1279c74b4 v5.24.0 2022-11-25 15:00:47 +00:00
Kevin Ansfield
d4ea9c877d Fixed editor key commands throwing errors when range has no section
closes Sentry ADMIN-CC8
closes Sentry ADMIN-DDM
closes Sentry ADMIN-C9F

- there are situations where the editor range when key commands are triggered does not have a head section which then throws errors due to the commands assuming there will always be a section present
- added a guard to key commands that use the head section to abort early and fall back to default Mobiledoc behaviour when the section is missing
2022-11-25 08:56:38 +00:00
Gabriel Ribeiro
64329d716e
Fixed missing amp-youtube properties (#15880)
fixes: https://github.com/TryGhost/Ghost/issues/15878

- Fix `amp-youtube` component, add mandatory `width` and `height`
properties. Also change the `layout` property to `responsive`, so that
the width adapts to mobile devices.

---

Error log:
`The mandatory attribute 'height' is missing in tag 'amp-youtube'.`

Documentation `amp-youtube`:
https://amp.dev/documentation/components/amp-youtube
2022-11-25 07:26:33 +00:00
renovate[bot]
68d3faf77c
Update dependency terser to v5.16.0 2022-11-24 19:01:01 +00:00
Sam Lord
7e02568cec Fixed PlayWright config
no issue

Using multiple workers could cause Stripe to be removed from one test while another test was using it.
2022-11-24 18:16:43 +00:00
Sam Lord
8b80233ae6 Added sample Portal test to PlayWright suite
refs: https://github.com/TryGhost/Toolbox/issues/479
2022-11-24 17:47:04 +00:00
Elena Baidakova
0bdccb6497
Update member activity dropdown (#15875)
closes TryGhost/Team#2250
2022-11-24 20:21:43 +04:00
Sam Lord
6fe5023e91 Added working Playwright tests
refs: https://github.com/TryGhost/Toolbox/issues/479
2022-11-24 15:11:40 +00:00
Kevin Ansfield
ef71d52ec0 Fixed Cannot read properties of null (reading 'offsetHeight') errors in markdown card
closes sentry ADMIN-CAV

- the mobile nav element is not always displayed so we should assume we can read it's `offsetHeight` property
2022-11-24 12:52:16 +00:00
Kevin Ansfield
37d9e8bb8b Fixed Cannot set properties of null (setting 'scrollTop') errors in <GhHtmlIframe>
closes sentry ADMIN-C7S

- we can't guarantee that the iframe being swapped to has rendered yet at the time we swap iframes so we need a guard around the `contentDocument.body` property existing before setting it's `scrollTop` value
2022-11-24 12:52:16 +00:00
Rishabh
c5abef057c Stored new source data for emails
refs https://github.com/TryGhost/Team/issues/2280
refs 9b0c21e0a2

As part of the email stability work, we added new `source` and `source_type` columns to `email` table, which allows us to store the email source information. The source for all existing emails before the stability work was always `html`, while newer emails will store `mobiledoc` or `lexical` directly.

While the `source` for all existing emails was populated with the `html` as part of above migration, we also need to store the right `source` for all new emails created till the feature is under a flag.

This change updates the current email flow to also store `source` with html data, so it can be used in future with new email service and allows removing old `html` column.
2022-11-24 16:08:02 +05:30
e.baidakova
f5e1e6296c Add suppression modal to Portal
closes TryGhost/Team#2256
- Users can remove themselves from the suppression list from the profile in Portal.
2022-11-24 13:58:27 +04:00
e.baidakova
69c2af1ffe Split AccountHomePage file on separate files
closes TryGhost/Team#2256
- Moved components to separate file for better navigation.
2022-11-24 13:58:27 +04:00
e.baidakova
991e628022 Add ability to use absolute paths for import
closes TryGhost/Team#2264
- Instead of relative paths, we can use absolute. It helps to keep code cleaner and don't worry about import when doing refactoring.
Relative paths require rewriting them in case a file is moved to another directory.
2022-11-24 13:58:27 +04:00
e.baidakova
f151d223c3 Add ability to import css files
closes TryGhost/Team#2256
- Now we can write css in separate files and then import them as string.
2022-11-24 13:58:27 +04:00
Fabien "egg" O'Carroll
a88201089e Updated dev dependency to use pinned version
This is the standard for our deps in packages.
2022-11-24 13:58:12 +07:00
Fabien "egg" O'Carroll
90c9a03319 Added @tryghost/email-events package
refs https://github.com/TryGhost/Team/issues/2253
refs https://github.com/TryGhost/Team/issues/2254

This package is analogous to the @tryghost/member-events package. The
events here will be consumed by the EmailSuppressionList
implementation and used to add emails to said list. They'll be
dispatched by the code which handles events received from Mailgun.
2022-11-24 13:56:35 +07:00
Elena Baidakova
54f075b330
Update the suppression notice front-end (#15869)
closes TryGhost/Team#2288
2022-11-24 10:02:57 +04:00
renovate[bot]
e48072e471 Update dependency bson-objectid to v2.0.4 2022-11-24 11:24:07 +07:00
renovate[bot]
a26cbacfd6 Update dependency @playwright/test to v1.28.1 2022-11-24 10:03:08 +07:00
Hannah Wolfe
e4dbf9b0fd Updated error fallbacks to generic error message
refs: https://github.com/TryGhost/Team/issues/1121

- We've decided on one  preferred message for unexpected errors
- We want to use this everywhere where we don't know what to display
- We now have a GENERIC_ERROR_MESSAGE constant that we should use
2022-11-23 21:49:40 +00:00
Hannah Wolfe
907319a507 Renamed mw-error-handler test file to match lib
- minor inconsistency in naming was tripping me up
2022-11-23 21:49:40 +00:00
Elena Baidakova
e1ba0f6a2d
Fixed member avatar size (#15871)
closes TryGhost/Team#2279
2022-11-23 20:01:23 +04:00
Hannah Wolfe
32353f2920 Removed detail rule from showAPIError
refs: https://github.com/TryGhost/Team/issues/1121

- showAPIError is a method intended for formatting errors from the Ghost API
- Ghost API Errors do not have a detail field, therefore this code was redundant
- there are also no related tests
- removing now because I'm trying to cleanup and streamline all our error handling code
2022-11-23 15:56:58 +00:00