Commit Graph

15867 Commits

Author SHA1 Message Date
Renovate Bot
9089abcc5c Update dependency @tryghost/package-json to v1.0.17 2022-03-28 16:27:54 +01:00
Daniel Lockyer
32e2d15880
Split apart DB init queries in tests
refs https://github.com/TryGhost/Toolbox/issues/213

- `better-sqlite3` doesn't like multiple queries in the same statement
  so we can make the change here to split them up ahead of the switch
2022-03-28 16:17:17 +01:00
Daniel Lockyer
65fa8c12b5
Refactored database check to use utility
refs https://github.com/TryGhost/Toolbox/issues/213

- this removes another hardcoded string check that would have been
  incorrect when we switch the sqlite client to better-sqlite3
2022-03-28 16:12:32 +01:00
Renovate Bot
bf6188e331 Update peter-evans/create-or-update-comment digest to 26f0786 2022-03-28 14:30:20 +01:00
Daniel Lockyer
e37b93feee
Fixed env specific default configuration files missing from build
refs 15d9a77092

- in the referenced commit, we moved `core/server/config` to
  `core/shared/config`
- this commit didn't update the `.npmignore` exclusion so the folder
  wasn't included in the release zip
- this commit fixes that
2022-03-28 13:35:54 +01:00
Rishabh
b5cf019840 Fixed multiple mobile size bugs for Portal 2022-03-28 17:46:06 +05:30
Renovate Bot
8b0676d9ff
Update metascraper 2022-03-28 00:57:30 +00:00
Renovate Bot
73322e218d
Update dependency eslint to v8.12.0 2022-03-25 23:38:56 +00:00
Daniel Lockyer
dd174bf3f5 v4.41.3 2022-03-25 16:00:32 +00:00
Daniel Lockyer
f24ea42697 Updated Admin to v4.41.3 2022-03-25 16:00:32 +00:00
Renovate Bot
6340fbf408
Update dependency metascraper-logo-favicon to v5.27.2 2022-03-24 23:46:14 +00:00
Renovate Bot
b19878144e
Update metascraper to v5.27.1 2022-03-24 19:54:42 +00:00
Hannah Wolfe
a31069d49d
Removed unnecessary use of rewire
refs: https://github.com/TryGhost/Ghost/commit/e68cb8b31

- I found that some of the places we use rewire are totally unnecessary
- Rewire seems to mess with coverage sometimes
- It's also a code smell in general so I've ripped it out where possible
2022-03-24 19:32:06 +00:00
Hannah Wolfe
45de9b0efc
Fixed filename casing in canary API
refs: 0ef5a5c97a

- As per the previous commit, our mixed filename casing inadvertently resulted in a bug
- The casing in the codebase is meant to be kebab-case always, so fixing this everywhere that's relevant to the API whilst there's a good reason
2022-03-24 17:25:53 +00:00
Hannah Wolfe
0ef5a5c97a
Fixed members connect endpoint returning JSON
refs: https://github.com/TryGhost/Toolbox/issues/245
refs: https://github.com/TryGhost/Team/issues/1360

- As a result of my changes in https://github.com/TryGhost/Ghost/commit/3bd4d098 the members connect endpoint had started returning JSON
- This is because the members connect endpoint relied on the old default behaviour of the serializer being to return no response, whereas now it does our default JSON response format
- I had written a tool to iterate over all endpoints and ensure that they all had explicit serializers before changing the default behaviour, but it missed this endpoint due to the snake case naming
- I have double checked and this was the only missed endpoint, the only other one was member_signin_urls.permissions but that was not a true endpoint and was removed in https://github.com/TryGhost/Ghost/commit/202696382
- Note: the snapshot file for this test was generated from running the test against https://github.com/TryGhost/Ghost/commit/e6b92aed9 - one commit before I added the new default behaviour.
  - Without the new serializer this test fails on main
  - With the new serialzier, this test passes again, showing the response format has gone back to what we expect
2022-03-24 17:09:23 +00:00
Hannah Wolfe
202696382f
Removed extraneous permission flag in member signin urls
- This doesn't affect permissions, only permissions inside an endpoint config block does that
- Rather it creates an extra unused "endpoint" called member_signin_urls.permissions
- same as https://github.com/TryGhost/Ghost/commit/b53296c4d
2022-03-24 16:14:06 +00:00
Renovate Bot
a6edd37721 Update dependency cookie-session to v2 2022-03-24 12:56:56 +00:00
Hannah Wolfe
6976a3a9f2
Added labels test for empty browse response
- Added a simple test to prove the response is in the correct format when there is no results
2022-03-24 12:52:47 +00:00
Simon Backx
a7566c8503
Added e2e tests for offers API (#14335)
refs https://github.com/TryGhost/Team/issues/1429

Includes tests for all endpoints of the offers API
2022-03-24 13:41:48 +01:00
Renovate Bot
1c22710a43 Update dependency @tryghost/members-events-service to v0.3.2 2022-03-24 12:28:15 +00:00
Renovate Bot
4eb2ebb1a9 Update dependency @tryghost/member-events to v0.4.1 2022-03-24 12:27:07 +00:00
Renovate Bot
708d26a1a4 Update dependency @tryghost/members-ssr to v1.0.23 2022-03-24 12:26:24 +00:00
Renovate Bot
9f69bcbca9 Update dependency grunt-shell to v4 2022-03-24 12:14:29 +00:00
Renovate Bot
96503862bf Update peter-evans/create-or-update-comment digest to 704bc87 2022-03-24 12:07:09 +00:00
Daniel Lockyer
173a81dab6 Updated internal packages v2
- these packages are owned by us but these bumps don't contain
  any code changes - usually just dependency bumps
- this commit bumps all those packages
2022-03-24 12:03:12 +00:00
Renovate Bot
c73c6b40f8 Lock file maintenance 2022-03-24 11:31:45 +00:00
Rishabh
7e6cae2ef2 Revert "Refined UI/UX for Portal"
The new visual update to Portal needs more refinements before going live, this reverts commit b405e37be9.
2022-03-24 16:34:47 +05:30
Daniel Lockyer
d5d0bcb3f5
Updated internal packages
- these packages are owned by us but these bumps don't contain any code
  changes - usually just dependency bumps
- this commit bumps all those packages
2022-03-24 10:14:27 +00:00
Daniel Lockyer
d0497a6e40
Added theme-service-init metric during boot
refs https://github.com/TryGhost/Toolbox/issues/254

- it's useful for us to know how long it takes the theme service to
  init, especially as it is dealing with a lot of user-provided files
  outside of the Ghost codebase
2022-03-24 09:20:52 +00:00
Simon Backx
6bd1806650
Fixed same redirectManager used in offer service between tests (#14340)
refs https://ghost.slack.com/archives/C02G9E68C/p1647599592576139
refs https://ghost.slack.com/archives/C02G9E68C/p1647620250625909

Issue: `Cannot destructure property 'fromRegex' of 'this.redirectsredirectId]' as it is undefined.` is being thrown, only when running all tests.
Cause: duplicate redirects are added to a redirectManager, and not cleared correctly in the redirectManager, which throws an error when removing one of the duplicate redirects.

Because the same redirectManager is used, multiple event listeners are connected to the same redirectManager. So when the offer service has been initialised multiple times, multiple listeners are added, which create a redirect for every newly created offer... to the same redirectManager.
So there are three possible fixes for the same problem (would be best to fix them all):
- Create a new redirectManager every time the offer service is initialised
- Figure out a way to remove DomainEvents subscribers between tests
- Don't add the same redirect id multiple times to redirectIds in addRedirect from the express-dynamic-redirects package

This commit contains a fix for the first solution.

It also moved the offers service initialising before the frontend (to `initServicesForFrontend`)
2022-03-24 10:18:52 +01:00
Renovate Bot
d5942943a5 Update dependency @tryghost/validator to v0.1.17 2022-03-24 08:51:10 +00:00
Daniel Lockyer
bb6831c003
Updated lockfile 2022-03-24 08:36:59 +00:00
Renovate Bot
bfbc829c09 Update dependency @playwright/test to v1.20.1 2022-03-24 07:54:46 +00:00
Naz
7d03194e55 Added detection of "ghost-api" use in theme config
refs https://github.com/TryGhost/Toolbox/issues/241

- The `engines.ghost-api` property has been deprecated and the support for it will be dropped in Ghost v5 due to versionless nature of the Content API.
- When uploading a new theme or activating existing one that uses ghost-api in it's config a warning will be shown to the user
2022-03-24 15:27:40 +13:00
Renovate Bot
fb41cfa335
Update dependency @sentry/node to v6.19.2 2022-03-23 20:26:41 +00:00
Rishabh
b405e37be9 Refined UI/UX for Portal
With tiers going GA, this change brings a massive visual overhaul to Portal for almost all pages and flows, along with adding consistency between different multiple tier flows. It also overhauls the tests to match our new UI/UX for Portal.
2022-03-23 21:22:52 +05:30
Rishabh
6978892c57 Merged v4.41.2 into main
v4.41.2
2022-03-23 21:08:06 +05:30
Daniel Lockyer
974fb050cf v4.41.2 2022-03-23 15:06:02 +00:00
Daniel Lockyer
6bf2985dd5 Updated Admin to v4.41.2 2022-03-23 15:06:02 +00:00
Thibaut Patel
0ddd10fad0 🐛 Fixed two issues with offers
refs https://github.com/TryGhost/Team/issues/1437

- The discount was no longer showing up on the account page when the member had an active discount.
- The redemption counter on the offers page was not incrementing.
- The root cause was that messages sent on the internal bus were not reaching the internal bus listener, due to the unexpected duplication of the internal bus.
2022-03-23 19:40:44 +05:30
Hannah Wolfe
2b6b31ee14
Removed unnecessary authors serializer
refs: https://github.com/TryGhost/Toolbox/issues/245

- we don't need this serializer because the default serializer will call the authors mapper
- added an author mapper which is just an alias for users. I did this in a named file, not in index.js
  - because we want to change the api framework to load files automatically without needing index files.
  - makes sense to hold off that deeper change until we only have one api version else we have to change old APIs
2022-03-23 14:09:24 +00:00
Hannah Wolfe
9db1694647 Removed unnecessary tags serializer
refs: https://github.com/TryGhost/Toolbox/issues/245

- we don't need this serializer because the default serializer will call the tags mapper
- for now I've changed, rather than removed the tag serializer test as this shows default works the same!
2022-03-23 13:23:23 +00:00
Hannah Wolfe
b28beed755 Removed unnecessary integrations serializer
refs: https://github.com/TryGhost/Toolbox/issues/245

- we don't need this serializer because the default serializer will call the integrations mapper
2022-03-23 13:23:23 +00:00
Hannah Wolfe
30f3dea1e7 Removed unnecessary action serializer
refs: https://github.com/TryGhost/Toolbox/issues/245

- we don't need this serializer because the default serializer will call the actions mapper
2022-03-23 13:23:23 +00:00
Hannah Wolfe
396dd5f7f9 Removed unnecessary labels mapper & serializer
refs: https://github.com/TryGhost/Toolbox/issues/245

- There's no need for a mapper or serializer as labels uses the default behaviour
- Added a full suite of tests, consolidating from regression and using the new framework to prove nothing is broken
2022-03-23 13:23:23 +00:00
Hannah Wolfe
e68cb8b314
Improved settings cache unit tests
- settings cache was appearing as untested because we use rewire!
- rewire was totally unnecessary in this case, so I removed it
- updated to 100% test coverage whilst there, including removing one unreachable branch
- commented some undesirable behaviour I found whilst trying to reach all branches
- I don't want to change the behaviour to return false correctly without having a reason beyond improving coverage
2022-03-23 11:37:52 +00:00
Thibaut Patel
bc05998662 🐛 Fixed two issues with offers
refs https://github.com/TryGhost/Team/issues/1437

- The discount was no longer showing up on the account page when the member had an active discount.
- The redemption counter on the offers page was not incrementing.
- The root cause was that messages sent on the internal bus were not reaching the internal bus listener, due to the unexpected duplication of the internal bus.
2022-03-23 11:53:16 +01:00
Rishabh
4acdd0de7c Merged v4.41.1 into main
v4.41.1
2022-03-23 14:10:20 +05:30
Daniel Lockyer
60af28269c v4.41.1 2022-03-23 08:24:59 +00:00
Daniel Lockyer
51a6bc969a Updated Admin to v4.41.1 2022-03-23 08:24:59 +00:00