Commit Graph

32965 Commits

Author SHA1 Message Date
Sam Lord
64d94c8c8c Prevent posts-legacy tests from logging errors
refs: https://github.com/TryGhost/Toolbox/issues/389

The newsletter fixtures no longer errors when accessing the test image, and tests which intentionally error now stub the logging call
2023-03-03 18:25:53 +00:00
Sam Lord
a0acccc088 Prevent errors in E2E tests where front-end is disabled and Ghost Admin accesses themes
refs: https://github.com/TryGhost/Toolbox/issues/389
2023-03-03 18:25:53 +00:00
Steve Larson
3e18715caa added twitter embed tests
refs TryGhost/Team#2663
-added basic coverage for twitter embeds
2023-03-03 10:54:03 -06:00
Ghost CI
349e46c454 v5.37.0 2023-03-03 16:00:38 +00:00
Ghost CI
dfde0acf12 🎨 Updated Casper to v5.4.7 2023-03-03 16:00:37 +00:00
Naz
1f95fd50df
Fixed Revue import
refs https://github.com/TryGhost/Toolbox/issues/523

- When importing a zip with Revue data and no "files" or "media" the importer blew up. This is due to a bug where the files from the root directory are still being copied over (the should not be!)
- Added protective extra ".data" check to make sure code doest not blow up when there's no data property to be processed
2023-03-03 17:46:02 +08:00
Naz
29b3da26c3
Added ExternalMediaInliner package scaffolding
refs https://github.com/TryGhost/Toolbox/issues/524

- This is groundwork to contain logic related to external media scraping/inlining for posts.
2023-03-03 17:07:50 +08:00
renovate[bot]
ddd43b7daf Update dependency @playwright/test to v1.31.2 2023-03-03 09:18:21 +01:00
Naz
901485c47b
Added media inlining button in settings>labs
refs https://github.com/TryGhost/Toolbox/issues/524

- Having a button in Admin UI allows to manually trigger media inlining job once import has been processed.
- Added a "start" button hidden behind labs calling Admin API endpoint that starts external media inlining job.
2023-03-03 14:41:24 +08:00
Naz
de87479fb9
Bootstrapped media inlining trigger endpoint
refs https://github.com/TryGhost/Toolbox/issues/524

- Added an endpoint to Admin API under `POST /db/media/inline` that accepts `domains` as JSON payload triggering media inlining job
2023-03-03 14:26:52 +08:00
Naz
da78e235dd
Added media inliner service scaffolding
refs https://github.com/TryGhost/Toolbox/issues/524

- This is groundwork to build up on when adding media inlining functionality. This service will be used by the API to trigger post's content processing and media inlining.
2023-03-03 14:10:30 +08:00
Naz
a479b719ea
Added media inliner feature alpha flag
refs https://github.com/TryGhost/Toolbox/issues/524

- This flag will be used to test the trigger to external media inliner job
- The Admin UI is still unclear so sticking it behind the flag for some experimentation before shipping the feature
2023-03-03 10:54:01 +08:00
Djordje Vlaisavljevic
7bc7881088 Added a temporary fix for wrapping multiple mentions dropdown
refs https://github.com/TryGhost/Team/issues/2606
2023-03-02 20:06:53 +00:00
Djordje Vlaisavljevic
c6185017be Added mentions widget empty state
refs https://github.com/TryGhost/Team/issues/2608
2023-03-02 20:06:53 +00:00
Djordje Vlaisavljevic
683a0726df Added dark mode hover state
refs https://github.com/TryGhost/Team/issues/2608
2023-03-02 20:06:53 +00:00
Kevin Ansfield
7c84ef8c2d
Wired up click-to-refresh upgrade banner
closes https://github.com/TryGhost/Team/issues/2400

- used semver comparison to detect when the app version is less than the content-version header in any API response to toggle `upgradeStatus.requiresRefresh` that is used to conditionally show the upgrade banner
- only works on minors as we don't store the full Ghost patch version in `config.APP.version`
2023-03-02 18:39:38 +00:00
Djordje Vlaisavljevic
72f41bcc1c Fixed text wrapping issues
refs https://github.com/TryGhost/Team/issues/2606
2023-03-02 14:58:57 +00:00
Djordje Vlaisavljevic
bb1ea96cdb Updated recent mentions dashboard widget design
refs https://github.com/TryGhost/Team/issues/2608
2023-03-02 14:58:57 +00:00
Djordje Vlaisavljevic
d3f93066d8 Added dark mode design for mentions
refs https://github.com/TryGhost/Team/issues/2606
2023-03-02 14:58:57 +00:00
Djordje Vlaisavljevic
5e9fe95443 Updated recent mentions dashboard widget design
refs https://github.com/TryGhost/Team/issues/2608
2023-03-02 14:58:57 +00:00
Djordje Vlaisavljevic
a911366dae Updated multiple mentions dropdown design
refs https://github.com/TryGhost/Team/issues/2606
2023-03-02 14:58:57 +00:00
Ghost CI
65f02b7342 Merged v5.36.1 into main 2023-03-02 12:17:31 +00:00
Ghost CI
b0b8d15338 v5.36.1 2023-03-02 12:17:28 +00:00
Steve Larson
4fc131c49d
updated external request format
refs TryGhost/Team#2663
-got version upgrade broke this request
-moved to new format
2023-03-02 12:00:35 +00:00
Daniel Lockyer
6b1966ad9b Updated sinon dependency
- this is being done manually instead of merging the Renovate PR because
  the PR bundles another bump which doesn't pass yet
2023-03-02 12:43:42 +01:00
Daniel Lockyer
91e507d6f1
Removed Firefox from Admin CI runs
refs https://ghost.slack.com/archives/C02G9E68C/p1677753889082979

- Firefox tests have historically been flaky in CI and a real
  distraction when developing
- Firefox is, unfortunately :(, not a widely used browser at only 2.9%
  of global market share
- we've not had any Firefox-specific bugs that were detected in CI for
  a very long time, so it doesn't add anything anyway
2023-03-02 11:54:01 +01:00
Daniel Lockyer
50d467b1e8 Removed non-recommended Node version DB tests for SQLite3
- given SQLite3 is only supported for development, we don't really care about
  running tests on Node versions which aren't the recommended version
- this saves 2 jobs per CI run, which helps improve the health of CI in
  general
2023-03-02 11:36:26 +01:00
Naz
a701724903
Renamed content file importer test
refs https://github.com/TryGhost/Toolbox/issues/523

- Test was not renamed after the "image" module changed it's name to "ContentFileImporter"
2023-03-02 17:59:36 +08:00
Naz
ab3959f3f2
Added document file support to the zip importer
refs https://github.com/TryGhost/Toolbox/issues/523

- When migrating or importing ZIP files into Ghost there's often a need to include document files.
- When document files are present in the imported zip file they are now copied across and processed along with the rest of import files: json, images, csvs, etc.
- The importer also searches for use of the document files in the imported "posts" substituting the links with local ones
- The document files importer recognizes media files inside of "files" or "content/files" folders present in the zip.
- The supported media file extensions are same as for file upload widget:
".pdf",".json",".jsonld",".odp",".ods",".odt",".ppt",".pptx",".rtf",".txt",".xls",".xlsx",".xml"

with following content-types:
"application/pdf", "application/json", "application/ld+json", "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.text", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/rtf", "text/plain", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/xml", "application/atom+xml"
2023-03-02 17:54:19 +08:00
Naz
116e69afcd
Refactored importer's content file handler
refs https://github.com/TryGhost/Toolbox/issues/523

- Renamed variables that were too media-specific
2023-03-02 17:54:19 +08:00
Naz
cd49992cd9
Added generic file import handler
refs https://github.com/TryGhost/Toolbox/issues/523
refs c2534e3c86/packages/mg-assetscraper/lib/AssetScraper.js (L14-L16)
refs https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

- Importer needs to process and recognize document files like pdfs, presentations etc to be able to import them into sites file storage.
- The handler allows a new root directory "files" to place imported documents
- The handler adds validation and processing for following file extensions:
".pdf",
".json",
".jsonld",
".odp",
".ods",
".odt",
".ppt",
".pptx",
".rtf",
".txt",
".xls",
".xlsx",
".xml"
- With following content types:
"application/pdf",
"application/json",
"application/ld+json",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.oasis.opendocument.spreadsheet",
"application/vnd.oasis.opendocument.text",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/rtf",
"text/plain",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/xml",
"application/atom+xml"
2023-03-02 17:54:18 +08:00
Naz
b0b80d672d
Refactored content file handler constructor
refs https://github.com/TryGhost/Toolbox/issues/523

- To support generic "file" import handling the content file handler needs more configuration options for properties like type, extensions, content path etc. This refactor makes the handler configurable and reusable for any type of file import
2023-03-02 17:54:18 +08:00
Naz
bf215be0f8
Renamed media import handler to file handler
refs https://github.com/TryGhost/Toolbox/issues/523

- We need to process generic files like .pdf, .md, etc. on the importer "handler" stage.
- The media handler can process more than just media files after few refactorings. Renaming it to a generic content file handler indicates it can process any type of content file.
- In future we can substitute the built-in "images" import handler with this generic content file handler.
2023-03-02 17:54:18 +08:00
renovate[bot]
caac055bdc Update mock-knex digest to d8b93b1 2023-03-02 10:17:13 +01:00
Daniel Lockyer
6460522352
Pinned dependencies
- these should be pinned because Ghost is an application and we like to
  know what versions of dependencies we're running
2023-03-02 09:47:16 +01:00
renovate[bot]
9f08732039 Update @tryghost 2023-03-02 09:47:02 +01:00
Ronald Langeveld
7c805b7176 Revert "Added new created tier e2e test"
This reverts commit dc98868961.
2023-03-02 16:39:17 +08:00
Barno
389362f463
Replaced Promise.props() function with .all() in Members stats
refs https://github.com/TryGhost/Ghost/issues/14882

- this helps remove uses of Bluebird within Ghost

Co-authored-by: Carol-Barno <cbarno@innovexsolutions.co.ke>
2023-03-02 09:28:36 +01:00
Ronald Langeveld
dc98868961 Added new created tier e2e test
ref https://github.com/TryGhost/Team/issues/1446

- Added e2e test to check if a new tier can be added successfully.
2023-03-02 16:11:12 +08:00
renovate[bot]
e01d8a6f1d Update sentry-javascript monorepo to v7.40.0 2023-03-02 09:07:07 +01:00
Naz
59d0a1dd71
Added a comment about strict content/media imports
refs https://github.com/TryGhost/Toolbox/issues/523

- Making "content/media" a strict requirement for the import folder structure breaks the importer (glob library does not expand a subdirectory pattern). Unless it become a strict requirement we can use general content directory matching in combination with file extensions.
2023-03-02 14:35:37 +08:00
Naz
0c111cfe6b
Refactored media file import path calculation
refs https://github.com/TryGhost/Toolbox/issues/523

- The naming was referring to "image", which is a leftover from a copy-paste.
- It's much nicer to read a skimmable, columnar urlJoin method parameters instead of one long line
2023-03-02 14:35:37 +08:00
Naz
2361669bb6
Added media file support to the zip importer
refs https://github.com/TryGhost/Toolbox/issues/523

- When migrating or importing ZIP files into Ghost there's often a need to include more than just post content and images.
- When media files are present in the imported zip file they are now copied across and processed along with the rest of import files: json, images, csvs, etc.
- The importer also searches for use of the media files in the imported "posts" substituting the links with local ones
- The media importer recognizes media files inside of "media" or "content/media" folders present in the zip. The supported media file extensions are same as for media upload widget:
".mp4", ".webm", ".ogv", ".mp3", ".wav", ".ogg", ".m4a"

with following content-types:
 "video/mp4", "video/webm", "video/ogg", "audio/mpeg", "audio/vnd.wav", "audio/wave", "audio/wav", "audio/x-wav", "audio/ogg", "audio/mp4", "audio/x-m4a"
2023-03-02 14:35:37 +08:00
Naz
49553e5942
Renamed "image" importer to generic ContentFileImporter
refs https://github.com/TryGhost/Toolbox/issues/523

- This is ground work before introducing a "media" content type importer
- Previous "image" file name was not describing well what the importer was capable of doing
2023-03-02 14:35:37 +08:00
Ronald Langeveld
6361f27ec1
🐛 Fixed broken link filter params (#16351)
closes https://github.com/TryGhost/Team/issues/2403

- Fixes the links in `list-item.hbs` rendereing the url filter params with brackets
eg `['postid']` where the filter UI requires the filter params not to
have brackets to allow it to render with the filter pre-selected.
- The API handles both with and without brackets.
2023-03-02 13:45:44 +08:00
Steve Larson
3a9adcbc01 updated external request format
refs TryGhost/Team#2663
-got version upgrade broke this request
-moved to new format
2023-03-01 14:51:42 -06:00
Daniel Lockyer
a9c0a64fd2
Merged package .gitignore files into top-level file
fixes https://github.com/TryGhost/Toolbox/issues/480

- this is a bit tricky because the files are a mess but I think this
  covers everything and deduplicates having multiple .gitignore files
  across the repo so we can focus on keeping the definitions in one
2023-03-01 18:31:05 +01:00
Sam Lord
90ef8f008e Prevent error logs from occuring in Ghost unit test suite
refs: https://github.com/TryGhost/Toolbox/issues/389
2023-03-01 16:37:46 +00:00
renovate[bot]
dd0a3be7e9
Update dependency @babel/plugin-proposal-decorators to v7.21.0 (#16161)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@babel/plugin-proposal-decorators](https://babel.dev/docs/en/next/babel-plugin-proposal-decorators)
([source](https://togithub.com/babel/babel)) | [`7.20.7` ->
`7.21.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-proposal-decorators/7.20.7/7.21.0)
|
[![age](https://badges.renovateapi.com/packages/npm/@babel%2fplugin-proposal-decorators/7.21.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@babel%2fplugin-proposal-decorators/7.21.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@babel%2fplugin-proposal-decorators/7.21.0/compatibility-slim/7.20.7)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@babel%2fplugin-proposal-decorators/7.21.0/confidence-slim/7.20.7)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>babel/babel</summary>

###
[`v7.21.0`](https://togithub.com/babel/babel/blob/HEAD/CHANGELOG.md#v7210-2023-02-20)

[Compare
Source](https://togithub.com/babel/babel/compare/v7.20.13...v7.21.0)

##### 🚀 New Feature

- `babel-core`, `babel-helper-create-class-features-plugin`,
`babel-plugin-proposal-class-properties`,
`babel-plugin-proposal-private-methods`,
`babel-plugin-proposal-private-property-in-object`
- [#&#8203;15435](https://togithub.com/babel/babel/pull/15435) feat:
Implement `privateFieldsAsSymbols` assumption for classes
([@&#8203;fwienber](https://togithub.com/fwienber))
- `babel-helper-create-regexp-features-plugin`,
`babel-plugin-proposal-regexp-modifiers`, `babel-standalone`
- [#&#8203;15226](https://togithub.com/babel/babel/pull/15226) feat:
Support regexp modifiers proposal
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
- `babel-cli`, `babel-core`, `babel-generator`,
`babel-plugin-transform-destructuring`,
`babel-plugin-transform-modules-commonjs`,
`babel-plugin-transform-react-jsx`, `babel-traverse`
- [#&#8203;15022](https://togithub.com/babel/babel/pull/15022) feat:
Generate sourcemaps of friendly call frames
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
-   `babel-parser`, `babel-types`
- [#&#8203;15384](https://togithub.com/babel/babel/pull/15384) \[ts]
Support `const` modifier in type parameters
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))
- `babel-generator`, `babel-helpers`, `babel-parser`,
`babel-plugin-proposal-decorators`, `babel-plugin-syntax-decorators`,
`babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`
- [#&#8203;15405](https://togithub.com/babel/babel/pull/15405) Implement
decorators as presented at `2023-01` TC39 meeting
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))
-   `babel-parser`
- [#&#8203;15114](https://togithub.com/babel/babel/pull/15114) Parser
option to allow `new.target` outside functions
([@&#8203;overlookmotel](https://togithub.com/overlookmotel))
- [#&#8203;15320](https://togithub.com/babel/babel/pull/15320) Add
`annexb: false` parser option to disable Annex B
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))
-   `babel-core`
- [#&#8203;15283](https://togithub.com/babel/babel/pull/15283) feat:
Support `.cts` as configuration file
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
- `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`
- [#&#8203;15381](https://togithub.com/babel/babel/pull/15381) \[ts]
Support `export type * from`
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))

##### 🐛 Bug Fix

-   `babel-plugin-transform-typescript`
- [#&#8203;15379](https://togithub.com/babel/babel/pull/15379) \[ts5.0]
Better inlining of constants in enums
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
-   `babel-core`
- [#&#8203;15366](https://togithub.com/babel/babel/pull/15366) handling
circular/shared structures in deep-clone
([@&#8203;azizghuloum](https://togithub.com/azizghuloum))
- `babel-helper-create-class-features-plugin`,
`babel-plugin-proposal-class-properties`,
`babel-plugin-proposal-class-static-block`,
`babel-plugin-proposal-private-methods`,
`babel-plugin-transform-classes`, `babel-plugin-transform-new-target`
- [#&#8203;15406](https://togithub.com/babel/babel/pull/15406) Preserve
class elements comments in class transform
([@&#8203;JLHwung](https://togithub.com/JLHwung))
- `babel-parser`, `babel-plugin-transform-flow-comments`,
`babel-plugin-transform-flow-strip-types`, `babel-types`
- [#&#8203;15414](https://togithub.com/babel/babel/pull/15414) \[ts] Fix
restrictions for optional parameters
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))

##### 💅 Polish

-   `babel-parser`
- [#&#8203;15400](https://togithub.com/babel/babel/pull/15400) polish:
improve "`await` as identifier" error in modules
([@&#8203;JLHwung](https://togithub.com/JLHwung))

##### 🏠 Internal

-   `babel-core`
- [#&#8203;15137](https://togithub.com/babel/babel/pull/15137) Improve
CJS compat with ESM-based `@babel/core`
([@&#8203;nicolo-ribaudo](https://togithub.com/nicolo-ribaudo))

##### 🔬 Output optimization

-   `babel-plugin-transform-typescript`
- [#&#8203;15418](https://togithub.com/babel/babel/pull/15418) \[ts]
Handle exponentiation operator in constant folding
([@&#8203;ehoogeveen-medweb](https://togithub.com/ehoogeveen-medweb))

###
[`v7.20.13`](https://togithub.com/babel/babel/blob/HEAD/CHANGELOG.md#v72013-2023-01-21)

[Compare
Source](https://togithub.com/babel/babel/compare/v7.20.7...v7.20.13)

##### 🐛 Bug Fix

- `babel-helpers`, `babel-plugin-proposal-decorators`,
`babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`
- [#&#8203;15332](https://togithub.com/babel/babel/pull/15332) Ensure
class decorators can access decorated non-static members
([@&#8203;JLHwung](https://togithub.com/JLHwung))
-   `babel-plugin-transform-typescript`
- [#&#8203;15349](https://togithub.com/babel/babel/pull/15349) fix:
Preserve `import {type T} from 'x'` when `onlyRemoveTypeImports:true`
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
- [#&#8203;15344](https://togithub.com/babel/babel/pull/15344) fix:
Properties that are `abstract` should not be initialized.
([@&#8203;liuxingbaoyu](https://togithub.com/liuxingbaoyu))
-   `babel-parser`
- [#&#8203;15338](https://togithub.com/babel/babel/pull/15338) Allow
negative number in ambient const initializer
([@&#8203;JLHwung](https://togithub.com/JLHwung))

##### ↩️ Revert

- `babel-plugin-transform-react-inline-elements`,
`babel-plugin-transform-react-jsx-development`,
`babel-plugin-transform-react-jsx`
- [#&#8203;15355](https://togithub.com/babel/babel/pull/15355) Reverts
"Re-use common JSX element transform for <>...\</>"
([@&#8203;JLHwung](https://togithub.com/JLHwung))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDguNCIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4xIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-01 15:44:09 +00:00
Sanne de Vries
2c34d0841c Updated copy for "Click to update" banner
Refs https://github.com/TryGhost/Team/issues/2400
2023-03-01 15:41:13 +01:00