Commit Graph

6 Commits

Author SHA1 Message Date
Hannah Wolfe
6161f94910
Updated to use assert/strict everywhere (#17047)
refs: https://github.com/TryGhost/Toolbox/issues/595

We're rolling out new rules around the node assert library, the first of which is enforcing the use of assert/strict. This means we don't need to use the strict version of methods, as the standard version will work that way by default.

This caught some gotchas in our existing usage of assert where the lack of strict mode had unexpected results:
- Url matching needs to be done on `url.href` see aa58b354a4
- Null and undefined are not the same thing,  there were a few cases of this being confused
- Particularly questionable changes in [PostExporter tests](c1a468744b) tracked [here](https://github.com/TryGhost/Team/issues/3505).
- A typo see eaac9c293a

Moving forward, using assert strict should help us to catch unexpected behaviour, particularly around nulls and undefineds during implementation.
2023-06-21 09:56:59 +01:00
Simon Backx
db589b1ad4 Fixed random unit test failure for revue importer
refs https://github.com/TryGhost/Ghost/actions/runs/4477418718/jobs/7868921949

This test used the current time, and this resulted in a `AssertionError [ERR_ASSERTION]: '2023-03-21T09:28:29.837Z' == '2023-03-21T09:28:29.838Z'` in rare situations.
2023-03-21 10:46:13 +01:00
Paul Davis
8db947cd24
Trim generated post slug length in Revue importer (#16065)
refs: 5f90baf6fe

- Ghost has a character limit on post slugs of 191 characters,
- Sometimes, the slug that is generated from the title in Revue content is longer than this, causing the import to fail. 
- This PR trims that generated post slug to 190 characters.
2023-01-03 20:15:32 +00:00
Hannah Wolfe
3ee0b813b6
Updated to use proper members importer for Revue (#16018)
refs:
5f90baf6fe

- The OG implementation of importing revue subscribers was very naive
- This sures it up to use our proper member importer, which makes sure
everything works perfectly:
  - adds an import label
  - ensures members are subscribed to newsletters

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-12-15 20:29:08 +00:00
Paul Davis
ecd2083745
Handle blockquotes & empty paragraphs (#16019)
refs: 5f90baf6fe

- Blockquotes without any wrapping tag get converted to Mobiledoc weirdly. Wrapping them in `<p>` tags helps solve that
- Also removes empty paragraph tags which cause unwanted large blank spaces in content
- Remove internal #revue from Revue content
2022-12-15 19:28:48 +00:00
Hannah Wolfe
5f90baf6fe
Added Revue Importer (#16012)
refs: https://www.getrevue.co/app/offboard

- Revue is stopping all paid subscriptions on 20th Dec, and shutting down on Jan 18th.
- This update allows Ghost to accept and handle the zip file Revue are providing as an export in Labs > Importer
- It will import posts (as best as we can with the data provided) and subscribers as free members
- At present it doesn't import paid subscribers, as we don't have that info, but you can disconnect Revue from your Stripe account to prevent all your subscriptions being cancelled & there's the option this can be fixed later
- There will be further updates to polish up this tooling - this is just a first pass to try to get something in people's hands

Co-authored-by: Paul Davis <PaulAdamDavis@users.noreply.github.com>
2022-12-15 17:22:54 +00:00