From 5d9dd893b3064258b1dc7c7513103a6c7efc0d0f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 19 Jun 2023 11:12:06 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20beta=20editor=20HTML?= =?UTF-8?q?=20cards=20auto-closing=20tags=20when=20rendering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Team/issues/3462 refs https://github.com/TryGhost/Koenig/commit/a49f296c08a6fbc84b1f399989a21c5fd23400d5 - bumps `@tryghost/kg-default-nodes` and `@tryghost/kg-lexical-html-renderer` with support for "raw" html values in rendered card output --- ghost/admin/jsconfig.json | 15 +-------------- ghost/core/package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/ghost/admin/jsconfig.json b/ghost/admin/jsconfig.json index a5e091c1fe..f408cac8c2 100644 --- a/ghost/admin/jsconfig.json +++ b/ghost/admin/jsconfig.json @@ -1,14 +1 @@ -{ - "compilerOptions": { - "target":"es6", - "experimentalDecorators":true - }, - "exclude": [ - "node_modules", - "bower_components", - "tmp", - "vendor", - ".git", - "dist" - ] -} +{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file diff --git a/ghost/core/package.json b/ghost/core/package.json index c87a31104f..fa0ba1b88c 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -104,8 +104,8 @@ "@tryghost/kg-card-factory": "4.0.8", "@tryghost/kg-default-atoms": "4.0.1", "@tryghost/kg-default-cards": "9.1.0", - "@tryghost/kg-default-nodes": "0.0.63", - "@tryghost/kg-lexical-html-renderer": "0.1.63", + "@tryghost/kg-default-nodes": "0.0.64", + "@tryghost/kg-lexical-html-renderer": "0.1.64", "@tryghost/kg-mobiledoc-html-renderer": "6.0.8", "@tryghost/limit-service": "1.2.6", "@tryghost/link-redirects": "0.0.0", diff --git a/yarn.lock b/yarn.lock index c8fd93c4d0..6578010868 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6964,10 +6964,10 @@ lodash "^4.17.21" luxon "^3.0.0" -"@tryghost/kg-default-nodes@0.0.63", "@tryghost/kg-default-nodes@^0.0.63": - version "0.0.63" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.63.tgz#5e5a27ab195a131632c061baa59d804e29674c72" - integrity sha512-C2iGRFVfsFSqfMQrQEFnp8YM3aeW8v7nTIAYk/G5UY8KdQjmXT2air4GO7CbPic2rqSPyID0hh3sSEBRv2U3pA== +"@tryghost/kg-default-nodes@0.0.64", "@tryghost/kg-default-nodes@^0.0.64": + version "0.0.64" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.64.tgz#ea9adf63f3dc0889a9d7333d31b12d2906c0a641" + integrity sha512-uqp1na1ET1NJtlpCbsWITfpByt39Z46OXRBthXHEjUkopeMs1vZciT+/V9xK9Quv/Oqm9Z0Jpio1gn8tYSqRNw== dependencies: "@tryghost/kg-clean-basic-html" "^3.0.19" "@tryghost/kg-markdown-html-renderer" "^6.0.8" @@ -6977,10 +6977,10 @@ lodash "^4.17.21" luxon "^3.3.0" -"@tryghost/kg-lexical-html-renderer@0.1.63": - version "0.1.63" - resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.63.tgz#590f582daee638233dbbce8b3219b076130fe9a8" - integrity sha512-pzGfRlm6lBs05nE2sLeKyqWPU/0EBjSQG1dkPh80+TAKuxSZbuHSjtfLcEQ1/+xUaCdxyhwPfml4yUnpde99vw== +"@tryghost/kg-lexical-html-renderer@0.1.64": + version "0.1.64" + resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.64.tgz#10489b0fe99b50076e2d24b5d40111d77945a28a" + integrity sha512-SqvwrmiWPVXqvsHkpicO+36LlTaTV/YvBp9/y2HLgcHKZlPwF8PYXLva5216J4sVEEAoymb4s9x7FSLeg87Qpg== dependencies: "@lexical/clipboard" "^0.11.0" "@lexical/code" "^0.11.0" @@ -6988,7 +6988,7 @@ "@lexical/link" "^0.11.0" "@lexical/list" "^0.11.0" "@lexical/rich-text" "^0.11.0" - "@tryghost/kg-default-nodes" "^0.0.63" + "@tryghost/kg-default-nodes" "^0.0.64" jsdom "^22.1.0" lexical "^0.11.0" prettier "^2.7.1" From 3070e505f57072d74bf3d0de54fe83b26f10018d Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 19 Jun 2023 14:20:40 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20beta=20editor=20caus?= =?UTF-8?q?ing=20left-aligned=20images=20in=20some=20themes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Team/issues/3499 - bumps `@tryghost/kg-default-nodes` and `@tryghost/kg-lexical-html-renderer` to fix missing `kg-image` class on the `` element of rendered image cards --- ghost/core/package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ghost/core/package.json b/ghost/core/package.json index fa0ba1b88c..900586ea25 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -104,8 +104,8 @@ "@tryghost/kg-card-factory": "4.0.8", "@tryghost/kg-default-atoms": "4.0.1", "@tryghost/kg-default-cards": "9.1.0", - "@tryghost/kg-default-nodes": "0.0.64", - "@tryghost/kg-lexical-html-renderer": "0.1.64", + "@tryghost/kg-default-nodes": "0.0.65", + "@tryghost/kg-lexical-html-renderer": "0.1.65", "@tryghost/kg-mobiledoc-html-renderer": "6.0.8", "@tryghost/limit-service": "1.2.6", "@tryghost/link-redirects": "0.0.0", diff --git a/yarn.lock b/yarn.lock index 6578010868..2f7925e939 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6964,10 +6964,10 @@ lodash "^4.17.21" luxon "^3.0.0" -"@tryghost/kg-default-nodes@0.0.64", "@tryghost/kg-default-nodes@^0.0.64": - version "0.0.64" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.64.tgz#ea9adf63f3dc0889a9d7333d31b12d2906c0a641" - integrity sha512-uqp1na1ET1NJtlpCbsWITfpByt39Z46OXRBthXHEjUkopeMs1vZciT+/V9xK9Quv/Oqm9Z0Jpio1gn8tYSqRNw== +"@tryghost/kg-default-nodes@0.0.65", "@tryghost/kg-default-nodes@^0.0.65": + version "0.0.65" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.65.tgz#3c02b95bb01bd6314b47a4631ad5db4edda6de8f" + integrity sha512-8PSWQAXdW5Eydd8mq7e3kvXpojA8u/AhgnuqCtQ+5eHZNZce2M5pls2n6WUgVXpJPCpLYT6IbpaGfyPno2DtLA== dependencies: "@tryghost/kg-clean-basic-html" "^3.0.19" "@tryghost/kg-markdown-html-renderer" "^6.0.8" @@ -6977,10 +6977,10 @@ lodash "^4.17.21" luxon "^3.3.0" -"@tryghost/kg-lexical-html-renderer@0.1.64": - version "0.1.64" - resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.64.tgz#10489b0fe99b50076e2d24b5d40111d77945a28a" - integrity sha512-SqvwrmiWPVXqvsHkpicO+36LlTaTV/YvBp9/y2HLgcHKZlPwF8PYXLva5216J4sVEEAoymb4s9x7FSLeg87Qpg== +"@tryghost/kg-lexical-html-renderer@0.1.65": + version "0.1.65" + resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.65.tgz#73faa1a5d417a26320be1da482de6d4ec2d42959" + integrity sha512-NHndXvnq4uaYog2UPFzDT0cyDL2k6ouzGOu17yxXhhjSq5WhX+t5iJ7e90uOq3/dPhfJwGS/JQoJ/3nV2Jhhdw== dependencies: "@lexical/clipboard" "^0.11.0" "@lexical/code" "^0.11.0" @@ -6988,7 +6988,7 @@ "@lexical/link" "^0.11.0" "@lexical/list" "^0.11.0" "@lexical/rich-text" "^0.11.0" - "@tryghost/kg-default-nodes" "^0.0.64" + "@tryghost/kg-default-nodes" "^0.0.65" jsdom "^22.1.0" lexical "^0.11.0" prettier "^2.7.1" From 2e3d2e11213e0933266ff9a513e941fde5d898a5 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 19 Jun 2023 15:22:22 +0100 Subject: [PATCH 3/5] Fixed "Beta feedback" not showing in beta editor when feature flag is switched off no issue - even when the editor beta is turned off, any post created in the beta will still open in the beta editor - the "beta feedback" text in the bottom right was disabled when the beta flag was disabled which meant it was difficult to tell when you were using the beta editor vs the original editor --- ghost/admin/app/templates/lexical-editor.hbs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ghost/admin/app/templates/lexical-editor.hbs b/ghost/admin/app/templates/lexical-editor.hbs index 050372997b..b78315188f 100644 --- a/ghost/admin/app/templates/lexical-editor.hbs +++ b/ghost/admin/app/templates/lexical-editor.hbs @@ -93,9 +93,7 @@ @registerAPI={{this.registerEditorAPI}} /> - {{#if (feature 'lexicalEditor')}} - - {{/if}} +
From 41cbc403533234f8ba6c35311ee51312040b1909 Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Mon, 19 Jun 2023 16:40:15 +0200 Subject: [PATCH 4/5] Moved collections initialisation behind labs flag (#17057) We ran into an issue where the large `published:true` query was affecting the boot time of large sites which had knock-on effects with availability. --- .../collections/built-in-collections.js | 15 ------ .../core/server/services/collections/index.js | 48 ++++++++++++------- .../test/e2e-api/admin/collections.test.js | 1 + 3 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 ghost/core/core/server/services/collections/built-in-collections.js diff --git a/ghost/core/core/server/services/collections/built-in-collections.js b/ghost/core/core/server/services/collections/built-in-collections.js deleted file mode 100644 index 892a52398a..0000000000 --- a/ghost/core/core/server/services/collections/built-in-collections.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = [{ - title: 'Index', - slug: 'index', - description: 'Collection with all posts', - type: 'automatic', - deletable: false, - filter: 'status:published' -}, { - title: 'Featured Posts', - slug: 'featured', - description: 'Collection of featured posts', - type: 'automatic', - deletable: false, - filter: 'featured:true' -}]; diff --git a/ghost/core/core/server/services/collections/index.js b/ghost/core/core/server/services/collections/index.js index a36dc250c6..2ad3fa4127 100644 --- a/ghost/core/core/server/services/collections/index.js +++ b/ghost/core/core/server/services/collections/index.js @@ -2,6 +2,7 @@ const { CollectionsService, CollectionsRepositoryInMemory } = require('@tryghost/collections'); +const labs = require('../../../shared/labs'); class CollectionsServiceWrapper { /** @type {CollectionsService} */ @@ -9,7 +10,6 @@ class CollectionsServiceWrapper { constructor() { const postsRepository = require('./PostsRepository').getInstance(); - const events = require('../../lib/common/events'); const collectionsRepositoryInMemory = new CollectionsRepositoryInMemory(); const collectionsService = new CollectionsService({ @@ -17,6 +17,36 @@ class CollectionsServiceWrapper { postsRepository: postsRepository }); + this.api = collectionsService; + } + + async init() { + if (!labs.isSet('collections')) { + return; + } + const existingBuiltins = await this.api.getAll({filter: 'slug:featured'}); + + if (!existingBuiltins.data.length) { + await this.api.createCollection({ + title: 'Index', + slug: 'index', + description: 'Collection with all posts', + type: 'automatic', + deletable: false, + filter: 'status:published' + }); + + await this.api.createCollection({ + title: 'Featured Posts', + slug: 'featured', + description: 'Collection of featured posts', + type: 'automatic', + deletable: false, + filter: 'featured:true' + }); + } + + const events = require('../../lib/common/events'); // @NOTE: these should be reworked to use the "Event" classes // instead of Bookshelf model events const updateEvents = require('./update-events'); @@ -24,23 +54,9 @@ class CollectionsServiceWrapper { // @NOTE: naive update implementation to keep things simple for the first version for (const event of updateEvents) { events.on(event, () => { - collectionsService.updateAutomaticCollections(); + this.api.updateAutomaticCollections(); }); } - - this.api = collectionsService; - } - - async init() { - const existingBuiltins = await this.api.getAll({filter: 'slug:featured'}); - - if (!existingBuiltins.data.length) { - const builtInCollections = require('./built-in-collections'); - - for (const collection of builtInCollections) { - await this.api.createCollection(collection); - } - } } } diff --git a/ghost/core/test/e2e-api/admin/collections.test.js b/ghost/core/test/e2e-api/admin/collections.test.js index b2de775122..d274cd21bc 100644 --- a/ghost/core/test/e2e-api/admin/collections.test.js +++ b/ghost/core/test/e2e-api/admin/collections.test.js @@ -52,6 +52,7 @@ describe('Collections API', function () { let agent; before(async function () { + mockManager.mockLabsEnabled('collections'); agent = await agentProvider.getAdminAPIAgent(); await fixtureManager.init('users', 'posts'); await agent.loginAsOwner(); From 69fddf8abe3afe38448f5c12d56ddc7e14c593b5 Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 06:54:10 +0000 Subject: [PATCH 5/5] v5.52.1 --- ghost/admin/package.json | 2 +- ghost/core/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 3b5176117c..a91881f0c8 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.52.0", + "version": "5.52.1", "description": "Ember.js admin client for Ghost", "author": "Ghost Foundation", "homepage": "http://ghost.org", diff --git a/ghost/core/package.json b/ghost/core/package.json index 900586ea25..9a844cb9ba 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.52.0", + "version": "5.52.1", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",