Commit Graph

12592 Commits

Author SHA1 Message Date
Naz
6b07d4b2a0 🐛 Fixed __GHOST_URL__ appearing in generated excerpts
refs https://github.com/TryGhost/Team/issues/467
refs a6f5eb71be

- When a generated excerpt is calculated for posts/page resources it uses raw model! to get the data. Model contains untranformed __GHOST_URL__ markup which has to be additionally processed before extracint an excerpt or use the transformed `plaintext` from available attributes (chose the latter to decrease complexity)
- Removed model dependency as `attrs` at this point of serialization should always contain the `plaintext` field. It's ugly and has an unsolved bug report here - https://github.com/TryGhost/Ghost/issues/10396. The reliance should be solved at some point, but definitely not a part of this issue
2021-03-17 19:12:40 +13:00
Daniel Lockyer
958775b068
v4.0.1 2021-03-16 01:10:02 +00:00
Daniel Lockyer
1a6c6d5686
Updated Ghost-Admin to v4.0.1 2021-03-16 01:10:02 +00:00
Austin Burdine
98c2fe8f0e 🐛 Fix maintenance page being excluded from npm build 2021-03-16 01:03:56 +00:00
Daniel Lockyer
6058ee3906
v4.0.0 2021-03-15 23:37:48 +00:00
Daniel Lockyer
80b3b7d792
Updated Ghost-Admin to v4.0.0 2021-03-15 23:37:47 +00:00
Daniel Lockyer
a22cf6a621
Updated Casper to v4.0.0 2021-03-15 23:37:47 +00:00
Kevin Ansfield
652fed6bd1
Fixed image and gallery cards not having srcset or sizes attributes (#12765)
no issue

- we run raw mobiledoc through the mobiledoc-html renderer and we now store URLs in raw mobiledoc as `__GHOST_URL__` relative. Those URLs were not passing the "local image" check in the renderer for image optimisation availability meaning the srcset and sizes output was skipped
- bumped library version to include a fix for the optimisation check
2021-03-15 21:38:27 +00:00
Daniel Lockyer
aef3524876
v4.0.0-rc.3 2021-03-15 13:13:21 +00:00
Daniel Lockyer
c452eb880a
Updated Ghost-Admin to v4.0.0-rc.3 2021-03-15 13:13:21 +00:00
Hannah Wolfe
0e87a1c045 🐛 Allowed for inviting contributors when staff is limited
refs: https://github.com/TryGhost/Team/issues/510
refs: e30b9735fa

- In the case that there is a staff user limit, and the limit is maxed out, it is no longer possible to invite new staff users
- However, Contributors are not considered staff users and therefore it should always be possible to invite new Contributors
2021-03-15 11:40:44 +00:00
Kevin Ansfield
19d5448101
🐛 Fixed complimentary members' content gating (#12761)
no issue

Comped members were not able to view paid-member content because content gating was only looking for `member.status === 'paid'` which doesn't take into consideration members on a "complimentary" plan.

- added front-end acceptance tests for member access to posts
- updated content-gating check to take comped members into consideration
2021-03-15 19:13:48 +13:00
Renovate Bot
e87ded8d72
Update dependency eslint to v7.22.0 2021-03-12 23:16:42 +00:00
Daniel Lockyer
efdea0bd61
v4.0.0-rc.2 2021-03-12 20:33:21 +00:00
Daniel Lockyer
c4bb7ae1d9
Updated Ghost-Admin to v4.0.0-rc.2 2021-03-12 20:33:20 +00:00
Daniel Lockyer
9b2faf4eda
Updated Casper to v4.0.0-rc.2 2021-03-12 20:33:20 +00:00
Renovate Bot
813cb6de1a Update dependency gscan to v4.0.1 2021-03-12 19:42:33 +00:00
Renovate Bot
b05f2b6178
Update dependency mocha to v8.3.2 2021-03-12 11:06:26 +00:00
Hannah Wolfe
67adfe6054 Updated fixture copy
closes: https://github.com/TryGhost/Team/issues/528

- This only changes one sentence slightly to a minor grammar issue 💪
2021-03-11 19:20:30 +00:00
Fabien 'egg' O'Carroll
fac62cd698
Fixed circular dependency warning for the proxy service (#12746)
no-issue

The handlebars template module is required by the proxy service, as part
of the definition of the proxy service's module.exports. By
destructuring the i18n property from the proxy service at the time the
template module is loaded, the i18n property was always undefined, as the
module.exports of the proxy service had not been set.

Bypassing the proxy, and requiring the i18n module directly eliminates the
circular dependency.


* Refactored handlebars template tests to use proxy

Since this module is intended to be used via the proxy, we should test
it in the same way. We have uncovered a circular dependency issue, which
would not be possible to catch in tests unless the tests were to go via
the proxy.

* Added breaking test for handlebars template function

This test highlights the issue caused by a circular dependency, we are
unable to throw an IncorrectUsageError because i18n is undefined.
2021-03-11 16:30:49 +00:00
Renovate Bot
970b0e62b4
Update dependency @sentry/node to v6.2.2 2021-03-11 10:31:59 +00:00
Renovate Bot
4359e21f3e
Update dependency @tryghost/helpers to v1.1.40 2021-03-10 23:15:25 +00:00
Daniel Lockyer
1155a3cd5d
Removed Casper-specific 4.0 code from CI
no issue

- the 4.0 Casper work is now in `main` and we don't need to switch
  branches any more
2021-03-10 21:49:02 +00:00
Daniel Lockyer
004966ea58
v4.0.0-rc.1 2021-03-10 21:43:12 +00:00
Daniel Lockyer
c05566c367
Updated Ghost-Admin to v4.0.0-rc.1 2021-03-10 21:43:12 +00:00
Daniel Lockyer
386fb64f8b
Updated Casper to v4.0.0-rc.1 2021-03-10 21:43:08 +00:00
Renovate Bot
8e7821d3ee Update dependency @tryghost/html-to-mobiledoc to v0.7.12 2021-03-10 20:15:31 +00:00
Kevin Ansfield
d3a553bab0 Bumped Koenig mobiledoc html renderer
no issue

- package is out of RC and ready for release
2021-03-10 19:09:42 +00:00
Fabien O'Carroll
394b845617 Bumped Members packages
no-issue

- packages are out of RC and ready for release
2021-03-10 18:51:34 +00:00
Fabien O'Carroll
8ffa944af7 Bumped gscan to 4.0.0
no-issue

- package is out of RC and ready for release
2021-03-10 18:48:37 +00:00
Fabien O'Carroll
97c55bee20 Bumped TryGhost/SDK packages
no-issue

- packages are out of RC and ready for release
2021-03-10 18:46:42 +00:00
Kevin Ansfield
90a9a04375 Bumped email analytics related packages
no issue

- packages are out of RC and ready for release
2021-03-10 18:03:27 +00:00
Kevin Ansfield
5c73446a93 Bumped Koenig related packages
no issue

- packages are out of RC and ready for release
2021-03-10 18:02:31 +00:00
Hannah Wolfe
fdc043227a Updated fixtures for Ghost v4.0
- With 4.0 we have a brand new version of Casper, new fixtures and new default settings
- Fixture posts cover the key features and give users an introduction to how to use their site
- This all comes from the marketing and design teams to refresh the look and feel of Ghost and give users the best possible onboarding experience
Note: this fixture overhaul includes
- new content for new 4.0 features
- regenerated post content using our updated mobiledoc structure
- a switch from British to US English
2021-03-10 17:37:16 +00:00
Rish
ec9988af77 Updated Portal to v1.0.0
no refs
2021-03-10 23:01:29 +05:30
Hannah Wolfe
66490d4f0a Added --trace-warnings to tests
- We've been getting warnings in our tests for some time now, but without --trace-warnings they are impossible to trackdown
- Add this flag for all tests so that we can see stack traces and maybe fix some of the issues
2021-03-10 17:23:30 +00:00
Peter Zimon
30bc751237 Updated 'Powered by' badge ref to 4.0 repo 2021-03-10 16:02:00 +01:00
Peter Zimon
acf6e235c7 Updated squircle ref to 4.0 repo 2021-03-10 15:53:59 +01:00
Hannah Wolfe
44060d3515 Refined navigation default settings for 4.0
refs 2bba9989db

- Note: this will require new fixtures so that the navigation links actually work
- These updates are all in aid of getting the best possible default setup and onboarding experinence for new Ghost users
2021-03-10 10:42:21 +00:00
Hannah Wolfe
2bba9989db Updated default settings for 4.0
- With 4.0 we have a brand new version of Casper, new fixtures and new default settings
- This all comes from the marketing and design teams to refresh the look and feel of Ghost

Note on accent color:

This commit changes the default accent colour again.

The intention is that new sites should get #FF1A75 (pink) as their default.
Any existing sites that do not have an accent colour set yet, should get #15171A (black) on upgrading to 4.0.

These are different as they are different experinces. Fresh sites will be guided to pick a color, so
a bright color is more visible and helps to see what can be done, whilst existing sites get a muted
black, that should be a sensible fall back color.
2021-03-09 20:19:59 +00:00
Renovate Bot
897ca83ff8 Update dependency knex-migrator to v4.0.2 2021-03-09 19:19:49 +00:00
Renovate Bot
5c966ef6e7 Update dependency @tryghost/admin-api-schema to v2.0.0-rc.3 2021-03-09 16:21:07 +00:00
Renovate Bot
6ce3ef43a7 Update dependency @tryghost/social-urls to v0.1.21 2021-03-09 16:20:51 +00:00
Renovate Bot
1e38392ce1 Update dependency @tryghost/html-to-mobiledoc to v0.7.11 2021-03-09 16:20:38 +00:00
Fabien 'egg' O'Carroll
15978689c0
Added default value to accent_color setting (#12743)
refs TryGhost/Team#535

We want to ensure that a site will always have a default value of
`'#15171A'` for the accent_color setting.

Since the boot process changed we have three cases to account for:

1. Setting does not exist
2. Setting exists with no value
3. Setting exists with a value

It is only in the case of 2. that we want the migration to update the
database with a default value.

In the case of 3. the site owner has already set a value, which we do
not want to override.

In the case of 1. the setting will be created (and populated with
default value) from the default-settings.json file, by the
populateDefaults method called from the settings service

We also update the accent_color setting to include a non-empty
validation, to ensure that the setting will always have a value, as
sites before 4.x may have an empty accent_color, we must update the
importer to set the default value if one is not present. Otherwise we
would run into validation errors and even if we didn't would have an
invalid database state.
2021-03-09 16:15:10 +00:00
Fabien 'egg' O'Carroll
52d1940460
Removed queries against information_schema (#12739)
no-issue

We were originally checking the state of the database, e.g. if a foreign
key constraint existed, so that we could conditionally act upon it. This
was to ensure that our migrations are idempotent.

Some database configurations, for example if you have many databases on
a single MySQL instance, would cause these information_schema queries to
take an exceptionally long time.

In order to speed up migrations, we instead attempt the action we want
to apply to the database, and then catch relevant errors to ensure the
migration is idempotent.

SQLite does not error when adding duplicate foreign or primary key
constraints, meaning that we must keep in pre-checks for these
operations, when running on SQLite

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2021-03-09 16:12:10 +00:00
Thibaut Patel
2eb5f19090 🐛 Fixed a foreign key to point to the right column
pr https://github.com/TryGhost/Ghost/pull/12713
2021-03-09 15:19:06 +01:00
Rish
6a512a50f9 Updated default accent color for content cta
refs https://github.com/TryGhost/Team/issues/535

Updates default accent color to be consistent everywhere with expected value as #15171A
2021-03-09 18:06:00 +05:30
Kevin Ansfield
cbbf5b4ad4
Fixed mobiledoc errors when upgrading from v1/v2 to v4 (#12741)
no issue

Upgrading from v1 or v2 can result in successful upgrades but with mobiledoc errors showing in the logs:

```
NAME: InternalServerError
MESSAGE: Mobiledoc card 'card-markdown' not found.
```

The errors do not signify a problem as long as the 4.0 migrations run because those rename the deprecated card before re-rendering.

- `@tryghost/kg-default-cards` dropped support for `card-markdown` cards. 4.0 migrations handled this by renaming all `card-markdown` cards to `markdown` before re-generating any content
- 2.0 and 3.0 also had migrations that re-generated content but they are run before the 4.0 card rename migration meaning that the mobiledoc renderer sees cards that it doesn't know about. The behaviour for unknown cards is to log an error and skip rendering of that card
- by NOOPing the 2.0 and 3.0 migrations we eliminate the incompatibility errors and reduce the amount of processing the upgrade needs to perform
2021-03-09 10:51:44 +00:00
Naz
a87d17e570 Updated utils for site endpoint response checks
refs 55dd16568b

- Fatfingered to add these files with a referenced commit
2021-03-09 22:12:05 +13:00