Commit Graph

12620 Commits

Author SHA1 Message Date
Thibaut Patel
70627d84a7 Removed redundant code for handling orphaned webhooks
issue https://github.com/TryGhost/Team/issues/526
refs https://github.com/TryGhost/Team/issues/477
2021-03-22 15:48:51 +01:00
Naz
a71d5dc633 Renamed importer spec to match tested version
refs https://github.com/TryGhost/Team/issues/555

- Export/Import test suite clean up ctd. See previous commits for context
- Next up will introduce v3 and "latest" tests to be able to check how importer behaves when import files are used from a particular version
2021-03-23 00:42:22 +13:00
Naz
d30ecf70c0 Added latest export body generator
refs https://github.com/TryGhost/Team/issues/555

- Export/Import test suite clean up ctd. See previous commits for context
- Main goal here was to update latest JSON export data. Also hardened tests to make sure this fixture is updated whenever the endpoint changes structure
2021-03-23 00:42:22 +13:00
Naz
046c3445ce Renamed "lts" importer spec to "legacy"
refs https://github.com/TryGhost/Team/issues/555

- This name suits way better to describe what's actually being tested
2021-03-23 00:42:22 +13:00
Naz
efbaa4401e Renamed export body generator functions to match their versions
refs https://github.com/TryGhost/Team/issues/555

- This is a continuation of importer/exporter test suite cleanup. Check previous commits for more context
2021-03-23 00:42:22 +13:00
Naz
341b2bb604 Moved importer utils to general exporter utils
refs https://github.com/TryGhost/Team/issues/555

- Check previous commit for more context. This changeset is part of importer/exporter cleanup effort.
2021-03-23 00:42:22 +13:00
Naz
cc8fe3ad43 Removed importer suite assertion with no specific meaning
refs https://github.com/TryGhost/Team/issues/555

- Follow up to previous commit. Read it for full context.
2021-03-23 00:42:22 +13:00
Naz
653863bf0e Extracted v1 spec out of importer test suite
refs https://github.com/TryGhost/Team/issues/555

- Follow up to previous commit. Read it for full context.
- This step splits existing importer test suite into separate files based on current "describe sections". This is done to get the test suite size to somewhat comprehensive shape
2021-03-23 00:42:22 +13:00
Naz
0bc33d6816 Extracted LTS spec out of importer test suite
refs https://github.com/TryGhost/Team/issues/555

- Follow up to previous commit. Read it for full context.
- This step splits existing importer test suite into separate files based on current "describe sections". This is done to get the test suite size to somewhat comprehensive shape
2021-03-23 00:42:22 +13:00
Naz
4f83716cfe Extracted importer test suite utils
refs https://github.com/TryGhost/Team/issues/555

- As part of testing upcoming 4.0 release was looking into a robust way to test imports. The importer test suite is humongous, so started with small extractions.
- The goal is to have readable and easy to create version-specific "exports" that would allow for more convenient testing
2021-03-23 00:42:22 +13:00
Renovate Bot
7deeb41a36
Update dependency @tryghost/kg-markdown-html-renderer to v4.0.1 2021-03-22 06:28:50 +00:00
Renovate Bot
91ba7b998e
Update dependency @tryghost/kg-card-factory to v2.2.1 2021-03-22 01:43:23 +00:00
Kevin Ansfield
9ac7ed5f3b
🐛 Fixed images not having srcset or sizes attributes (#12800)
closes https://github.com/TryGhost/Team/issues/567

- bumped `@tryghost/kg-default-cards` with a version containing a bugfix for detecting absolute URLs as local content images when they match the site url supplied as an option when rendering
- this bug surfaced because of the change in https://github.com/TryGhost/Ghost/pull/12787 - the renderer is now seeing absolute URLs when passed content from the model layer rather than `__GHOST_URL__` URLs. We didn't hit it in 3.x because that was passing content with relative URLs.
2021-03-20 22:17:43 +00:00
Renovate Bot
eb5f7a8e2d
Update dependency @sentry/node to v6.2.3 2021-03-19 18:30:58 +00:00
Daniel Lockyer
cb6a585bab
v4.1.0 2021-03-18 17:40:06 +00:00
Daniel Lockyer
83774e1bac
Updated Ghost-Admin to v4.1.0 2021-03-18 17:40:06 +00:00
Daniel Lockyer
8ca740bf6d
Updated Casper to v4.0.1 2021-03-18 17:40:06 +00:00
Peter Zimon
b3b6a603af
New logo in Admin (#12768)
refs https://github.com/TryGhost/Team/issues/547

- replaced link to static/squircle to orb
2021-03-18 17:27:27 +00:00
Kevin Ansfield
afbe0c27fb
🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787)
closes https://github.com/TryGhost/Team/issues/552

Refactors URL transforms so they take place at the model layer rather than the API serializer layer. Continuation of the pattern created for the settings model in https://github.com/TryGhost/Ghost/pull/12738

- Added checks to all front-end tests to ensure output does not contain the magic replacement string
  - includes failing acceptance test for `__GHOST_URL__` appearing in sitemaps
- Removed all transform-ready URL transforms from API serializers
  - input serializers transform image urls relative->absolute to keep absolute-urls as the consistent "outside of the database" format
  - output serializers should not need to perform any URL transforms as that will be done at the model layer
- Added url transforms to models layer
  - removes knowledge from the API serializers which shouldn't need to know how data is stored internally in the database
  - makes absolute urls the consistent "outside of the database" URL format
  - adds transform step to the sitemap generator because the data used for that is fetched directly via knex which will not run through the bookshelf `parse()` methods
2021-03-18 17:16:37 +00:00
Rishabh Garg
1a84b8d81b
🐛 Fixed unable to delete member (#12784)
closes https://github.com/TryGhost/Team/issues/557

After updating to v4 on SQLite from v3, we were unable to delete members due to a foreign key mismatch error. This is because the migrations which recreates the tables for `members_stripe_customers_subscriptions` and `members_stripe_customers` doesn't add back the unique constraint which is needed by FKs for reference.

The migration creates the missing UNIQUE constraints on the tables.
2021-03-18 22:20:58 +05:30
Hannah Wolfe
60ab97cf03 Fixed Ghost hiding config errors behind a crash
refs: https://github.com/TryGhost/Team/issues/558

- we can't use our logging lib to log a config error, because logging requires config to work
- we have to use console, as there's nothing else available at this point
- we can't even use notify to tell CLI a bad thing happened here, because that also requires config and logging
- there is no precedent or ref material for the code 999
   - it's just meant to be a clearly different code to -1/1/2/3 we've used elsewhere
   - it signifies that things went so wrong we weren't even able to handle the error gracefully with logging
2021-03-18 16:32:51 +00:00
Fabien 'egg' O'Carroll
d19452147d
🐛 Fixed @price template data to work with price helper (#12764)
closes https://github.com/TryGhost/Team/issues/545

The price helper requires an object with amount & currency properties to
work correctly. This updates the @price data object to expose these.

In order to maintain backward compatibility with using the @price data
as primitive number values, we add a valueOf method which returns the
legacy dollar amount value.

This means you can use {{price @price.monthly}} OR
{{@price.monthly}} - the second of which will output the dollar
amount.

A new theme fixture was added to test both usages of the @price data
2021-03-18 16:13:10 +00:00
Fabien 'egg' O'Carroll
8318391d4c
Fixed typo in migration to add backupContent permission (#12777)
refs https://github.com/TryGhost/Team/issues/553

This was introduced in https://github.com/TryGhost/Ghost/commit/79c3709f

This migration has a `noop` for the down, as we never want to revert
Ghost to a broken state
2021-03-18 14:52:12 +00:00
Thibaut Patel
ba511445df Fixed broken tests from previous commit
commit 63d55570a3
2021-03-17 16:18:48 +01:00
Thibaut Patel
63d55570a3 💥 Removed the /redirects/json route alias
no issue

This route had been deprecated and wasn't used anymore. You should switch to `GET /redirects/download` and `POST /redirects/upload` instead.
2021-03-17 15:58:28 +01:00
Daniel Lockyer
35e45dbe7b
Added CI check to test updates from v3
no issue

- now we've officially released v4, we need to check updates from v3
- this commit adds a test copied from the other tests above
- also renames the steps from Upgrade to Update to match internal terminology
2021-03-17 11:52:26 +00:00
Kevin Ansfield
7b1aa38841
🐛 Fixed AMP validation warning from accent color style tag (#12771)
closes https://github.com/TryGhost/Ghost/issues/12770

AMP pages can't contain bare `<style>` tags, they need to have an attribute like `<style amp-custom>` and there can only be a single `<style amp-custom>` tag in the output.

- removed accent color style tag output from `{{ghost_head}}` (aliased as `{{amp_ghost_head}}`) when in an AMP context
- added a new `{{amp_style}}` helper that can be used to inject styles into the AMP template
  - outputs `:root {--ghost-accent-color: #abc123}` style if an accent color is set
2021-03-17 11:49:42 +00:00
Naz
b5de4f4cf5 Reverted dropped model usage in post serializer
refs 6b07d4b2a0

- The model is needed here, because it contains full set of fields. In some cases, like email-preview, the "plaintext" field is not present in "attrs" which causes the logic to fail.
- This should be sorted along with https://github.com/TryGhost/Ghost/issues/10396
2021-03-17 20:01:12 +13:00
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