Commit Graph

16536 Commits

Author SHA1 Message Date
Naz
b996eadbd4 Renamed sodo search identification attribute
refs https://github.com/TryGhost/Team/issues/1665

- The search script should be uniquiely identifiable in DOM. Previously element for portal scipt element and search element both had `data-ghost` attributes` for identification. Having `data-sodo-search` makes naming unique
2022-07-04 16:44:01 +02:00
Naz
f6b2a83761 Added sodoSearch script output from ghost_head helper
no issue

- The sodoSearch needs to be injected into rendered HTML the same way portal scripts are.
- The feature is behind a `sodoSearch` alpha flag, so the scripts are injected conditionally
2022-07-04 16:44:01 +02:00
Simon Backx
3edbb364fe Renamed data-ghost attribute on comments script 2022-07-04 16:12:35 +02:00
Hannah Wolfe
ab0dc4769c
Removed straggling canary naming from comments
- we no longer have a versioned API, just an API :)
2022-07-04 15:44:58 +02:00
Kevin Ansfield
3da839e80e Fixed unit tests failing on unknown helper
refs dc49871837

- added the `comments` helper to the experimental helpers list
2022-07-04 15:42:18 +02:00
Kevin Ansfield
dc49871837 Added {{comments}} helper
refs https://github.com/TryGhost/Team/issues/1664

- added `comments:url` config for a similar setup to Portal
- added `{{comments}}` helper that's behind the `comments` labs flag
  - currently outputs a `<script>` tag that points to the comments script with API location+key data attributes
2022-07-04 15:34:01 +02:00
Daniel Lockyer
da3d32e2ed
Fixed straggling use of canary naming
refs c50658953c

- this was missed in the referenced commit
2022-07-04 14:21:29 +02:00
Kevin Ansfield
8b2ba86909 Updated labs API snapshot
refs 46669c7036

- API output changes when labs flags are changed so snapshot needs updating to match
2022-07-04 14:13:43 +02:00
Kevin Ansfield
46669c7036 Added comments labs flag
no issue

- alpha flag for commenting system
2022-07-04 14:07:41 +02:00
Naz
4e539137be Fixed broket test
refs 911ce4f29e

- Fixed the settings snapshot for a news labs flag
- Long term we should look into making the labs property match dynamically as it is updated quite often. We'll forget to update this snapshot!
2022-07-04 17:23:27 +08:00
Daniel Lockyer
c50658953c Renamed API canary/ folder to endpoints/
- now we only have one API version, it doesn't make sense to keep
  "canary" around
- renaming it to `endpoints/` makes more sense for this
- this commit renames the `core/server/api/canary/` folder to
  `core/server/api/endpoints/`
- it also fixes the naming in test titles and the various other places
  we relied on this
2022-07-04 11:14:37 +02:00
Naz
911ce4f29e Added sodoSearch labs flag
no issue

- alpha flag for .... you guessed it - SEARCH!
2022-07-04 17:03:46 +08:00
renovate[bot]
f24dfb409d
Update dependency eslint to v8.19.0 2022-07-04 02:12:22 +00:00
renovate[bot]
d73d9079cd Update dependency cssnano to v5.1.12 2022-07-01 07:00:33 -04:00
Renovate Bot
28eedce347 Update dependency jwks-rsa to v2.1.4 2022-07-01 07:00:03 -04:00
renovate[bot]
e7e987f298 Update dependency cli-progress to v3.11.2 2022-07-01 06:59:22 -04:00
renovate[bot]
a470ab22b8 Update dependency @playwright/test to v1.23.1 2022-07-01 06:59:08 -04:00
renovate[bot]
5bbfca01ea
Update dependency nock to v13.2.8 2022-06-30 21:27:59 +00:00
renovate[bot]
d8a27c78f5
Update metascraper to v5.29.14 2022-06-30 12:13:11 +00:00
renovate[bot]
464f4b6769
Update metascraper to v5.29.13 2022-06-29 18:09:52 +00:00
renovate[bot]
15294f4056
Update dependency metascraper to v5.29.12 2022-06-27 13:46:05 +00:00
renovate[bot]
630149e9c6
Update metascraper to v5.29.11 2022-06-21 11:45:54 +00:00
renovate[bot]
148bb7b506
Update metascraper to v5.29.10 2022-06-20 00:39:07 +00:00
renovate[bot]
b46e7deae5
Update dependency eslint to v8.18.0 2022-06-17 22:05:10 +00:00
Renovate Bot
e53bd0bfd5
Update dependency nock to v13.2.7 2022-06-15 03:00:51 +00:00
Daniel Lockyer
bf264c15e5 v5.2.3 2022-06-15 03:59:47 +01:00
Daniel Lockyer
506957be84 Updated Admin to v5.2.3 2022-06-15 03:59:46 +01:00
Fabien "egg" O'Carroll
b82dc7ae7c 🔒 Fixed RCE exploit with date helper & locale setting
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-7v28-g2pq-ggg8

A vulnerability in an upstream library means an attacker can abuse locale input
to execute arbitrary commands from a file that has previously been uploaded
using the file upload functionality in the post editor.
2022-06-14 22:50:22 -04:00
Renovate Bot
4c16cb9624
Update Test & linting packages 2022-06-06 03:00:14 +00:00
Daniel Lockyer
c6dabf13a3 v5.2.2 2022-06-03 17:50:37 +01:00
Daniel Lockyer
ea34d3600e Updated Admin to v5.2.2 2022-06-03 17:50:37 +01:00
Daniel Lockyer
fbda47062f 🎨 Updated Casper to v5.1.4 2022-06-03 17:50:36 +01:00
Matt Hanley
859d49626c
Updated mapping for stripe_products when product import is skipped (#14965)
refs d63e9256ea

- Following the ref'd commit, when migrating a site the default and free tiers would be skipped because they exist by default in the new site
- As the product is skipped, we don't have the ID available in the imported data to map the stripe_product to
- If the stripe_product isn't mapped, imported members won't be mapped to the correct tier
- This commit adds a lookup for the product by name and slug to restore the correct stripe_product mapping

Co-authored-by: Simon Backx <simon@ghost.org>
2022-06-03 17:31:53 +01:00
Matt Hanley
2ecb4acc85 Updated gscan 2022-06-03 16:09:34 +01:00
Matt Hanley
d63e9256ea
🐛 Fixed duplicate tiers being created on import (#14964)
- When importing tiers, duplicate tiers were being created with different slugs
2022-06-03 15:02:44 +01:00
Naz
b536cf5d9c Added e2e test coverage for post.added event
refs https://github.com/TryGhost/Toolbox/issues/320

- Wanted to verify if multiple webhook snapshot tests would play nicely together. They did!
- Also having few tests of the same type allows to detect patterns that could be extracted and reused later :)
2022-06-03 14:56:55 +08:00
Naz
9c3ed1a1f5 Added a hacky matcher to overcome 404 URL problem
refs https://github.com/TryGhost/Toolbox/issues/341
refs https://github.com/TryGhost/Toolbox/issues/320

- The snapshot for post's url property is causing test flakyness. The reason is due to the async nature of url processing in the URL Service (https://github.com/TryGhost/Ghost/issues/10360). Once the underlying issue is solved this hack could be removed.
- Having a snapshot tes even in this form is better than having none!
2022-06-03 11:57:39 +08:00
Naz
cb24a0d3f0 Fixed webhook snapshot test error output
refs https://github.com/TryGhost/Toolbox/issues/320

- When the snapshot test failed a misleading error was showing up. The bump fixed that bug.
2022-06-03 11:57:39 +08:00
Naz
3c7271ab76 Fixed post.published event test suite
refs https://github.com/TryGhost/Toolbox/issues/320

- Updated the test suite to use updated webhookMockReceiver.mock method and corrected previously incorrect snapshot
2022-06-03 11:57:39 +08:00
Naz
c30a8b82d1 Added webhooks tests to test:e2e command
refs https://github.com/TryGhost/Toolbox/issues/320

- Webhook tests are becoming a special type of tests and needed their own "home" to live in. Adding them to be a part of the e2e test command, so they are run the same way as the rest of e2e test suites
2022-06-03 11:57:39 +08:00
Naz
041a32934a Added webhook fixute utils
refs https://github.com/TryGhost/Toolbox/issues/320

- There will be more webhook e2e tests coming which require easy webhook fixture creation
2022-06-03 11:57:39 +08:00
Naz
c7e833545b Extracted webhook mock receiver into a package
refs https://github.com/TryGhost/Toolbox/issues/320

- Following the rule of having minimum code changes in the Ghost core codebase. This module belongs to "framework" along with other testing tools anyway.
- The bump includes a noteworthy changes - the "snapshotManager" was extracted into a separate exposed property of express-test API (maybe should be even it's own separate concept eventually, for now exposing it was enough). "snapshotManager" had to be exposed to be able to pass it to the webhook mock receiver - to use same instance configured with mocha hooks. snapshotManager has to be a singleton in the system to configure snapshots correctly through mochaHooks.
2022-06-03 11:57:39 +08:00
Naz
0f4aeaaa80 Added basic framework for webhook e2e tests
refs https://github.com/TryGhost/Toolbox/issues/320

- This is an **MVP** to be able to intercept and match webhook request
snapshots. The concept is similar to the one used in API E2E tests using
same "matchBodySnapshot" and other "match*" methods to test the webhook
**request** data
- Next up here would be:
1. Header matcher
2. Mocking more than one webhook (and doing something nicer with the way
the fixture data is inserted, does this logic belong to the mock-receiver?
2022-06-03 11:57:39 +08:00
Daniel Lockyer
6a3f61f62a Fixed database environment variables leaking across matrix runs
refs https://github.com/TryGhost/Toolbox/issues/244

- due to the way we currently set the env vars, they get applied across
  all matrix variations
- this means we're leaking the variables for SQLite to the MySQL test
  runs and this shows a warning because of how strict `mysql2` is
- this commit switches to optionally setting the env variables
- this is a partial workaround for fbcdacbd83/core/shared/config/utils.js (L55-L76) not seeming to work
2022-06-02 09:49:22 -04:00
Daniel Lockyer
fbcdacbd83 v5.2.1 2022-06-02 12:34:53 +01:00
Daniel Lockyer
e3223cd9a7 Updated Admin to v5.2.1 2022-06-02 12:34:53 +01:00
Naz
c9758112b3 🐛 Fixed an error when updating a user
closes https://github.com/TryGhost/Team/issues/1655
refs https://github.com/TryGhost/Ghost/commit/4bc14d2c4

- The API should always accept the input it returns. In this case it did not accept the input when it contained an unchanged roles property
- The problem here came from the referenced commit where we can now end up in the situation when the `roleToAssign` is just empty. It was an optimization to prevent a need to do ANY DB operation when none was needed.
2022-06-02 12:13:27 +01:00
Daniel Lockyer
264678e9be
Prevented certain GitHub Actions workflows from running on forks
fixes https://github.com/TryGhost/Toolbox/issues/285

- without this, some of the workflows that are only useful for the core
  team will run on forks
- this commit adds checks to ensure we're running on a repo maintained
  by the TryGhost organization for a handful of workflows
2022-06-01 17:54:26 -04:00
Daniel Lockyer
a6efdbf1db v5.2.0 2022-06-01 16:28:51 +01:00
Daniel Lockyer
06868f81c6 Updated Admin to v5.2.0 2022-06-01 16:28:51 +01:00