From 8cb8b847866042d2bd59b99de13cf967d95dbe2d Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Tue, 13 Jun 2023 12:38:39 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20Post=20History=20for?= =?UTF-8?q?=20posts=20sent=20as=20an=20email=20(#16999)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/3458 From the discussion in slack, for all published/sent posts: Published only --> view history & restore Published & sent --> view history & restore Email only --> history hidden And for all unpublished/unsent posts: All states --> view history & restore. --- .../app/components/gh-post-settings-menu.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ghost/admin/app/components/gh-post-settings-menu.js b/ghost/admin/app/components/gh-post-settings-menu.js index ccb3743e79..167da5d189 100644 --- a/ghost/admin/app/components/gh-post-settings-menu.js +++ b/ghost/admin/app/components/gh-post-settings-menu.js @@ -145,14 +145,22 @@ export default class GhPostSettingsMenu extends Component { } get canViewPostHistory() { - let showPostHistory = this.post.lexical !== null - && this.post.emailOnly === false; - - if (this.post.isPublished === true) { - return showPostHistory && this.post.hasEmail === false; + // Can only view history for lexical posts + if (this.post.lexical === null) { + return false; } - return showPostHistory; + // Can view history for all unpublished/unsent posts + if (!this.post.isPublished && !this.post.isSent) { + return true; + } + + // Cannot view history for published posts if there isn't a web version + if (this.post.emailOnly) { + return false; + } + + return true; } willDestroyElement() { From 49f936b098f9d07d024e5288aa3cf446feedb8b0 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Wed, 14 Jun 2023 15:13:49 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20empty=20icon=20crash?= =?UTF-8?q?ing=20signup=20embed=20preview=20(#17022)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Team/issues/3471 - after adding and removing an icon, icon settings passed an undefined icon to the signup form's all-in-one style. The AIO conditions didn't take that into account and caused the entire component to crash. ### 🤖 Generated by Copilot at 9e1aea3 Fix signup form embed code generation when icon is not set. Add a check for `this.settings.icon` in `signup-form-embed.js` before replacing image path. --- .../admin/app/components/modals/settings/signup-form-embed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/modals/settings/signup-form-embed.js b/ghost/admin/app/components/modals/settings/signup-form-embed.js index 41735b5fe6..a5eb54fb73 100644 --- a/ghost/admin/app/components/modals/settings/signup-form-embed.js +++ b/ghost/admin/app/components/modals/settings/signup-form-embed.js @@ -101,7 +101,9 @@ export default class SignupFormEmbedModal extends Component { if (this.style === 'all-in-one') { // We serve twice the size of the icon to support high resolution screens // (note that you'll need to change the resolution in the backend config as well, as not all resolutions are supported) - options.icon = this.settings.icon.replace(/\/content\/images\//, '/content/images/size/w192h192/'); + if (this.settings.icon || !this.settings.icon === '') { + options.icon = this.settings.icon.replace(/\/content\/images\//, '/content/images/size/w192h192/'); + } options.title = this.settings.title; options.description = this.settings.description; From 3ee857a0ded43423bfa2feb8e4d80b99b940d344 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 14 Jun 2023 17:56:03 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8=20Added=20word=20count=20to=20?= =?UTF-8?q?beta=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Team/issues/3242 - the beta editor now provides `` for tracking word count so we can add the UI for it back --- ghost/admin/app/components/gh-koenig-editor-lexical.hbs | 1 + ghost/admin/app/components/koenig-lexical-editor.js | 8 +++++++- ghost/admin/app/controllers/lexical-editor.js | 6 +++--- ghost/admin/app/templates/lexical-editor.hbs | 8 ++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ghost/admin/app/components/gh-koenig-editor-lexical.hbs b/ghost/admin/app/components/gh-koenig-editor-lexical.hbs index 38a52d3fab..9526ed31d6 100644 --- a/ghost/admin/app/components/gh-koenig-editor-lexical.hbs +++ b/ghost/admin/app/components/gh-koenig-editor-lexical.hbs @@ -42,6 +42,7 @@ @onChange={{@onBodyChange}} @registerAPI={{this.registerEditorAPI}} @cursorDidExitAtTop={{this.focusTitle}} + @updateWordCount={{@updateWordCount}} /> {{!-- { return <_KoenigEditor {...props} />; }; +const WordCountPlugin = (props) => { + const {WordCountPlugin: _WordCountPlugin} = editorResource.read(); + return <_WordCountPlugin {...props} />; +}; + export default class KoenigLexicalEditor extends Component { @service ajax; @service feature; @@ -502,6 +507,7 @@ export default class KoenigLexicalEditor extends Component { onChange={this.args.onChange} registerAPI={this.args.registerAPI} /> + diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index a75061792f..2678c52684 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -127,7 +127,7 @@ export default class LexicalEditorController extends Controller { fromAnalytics = false; // koenig related properties - wordcount = null; + wordCount = 0; /* private properties ----------------------------------------------------*/ @@ -305,8 +305,8 @@ export default class LexicalEditorController extends Controller { } @action - updateWordCount(counts) { - this.set('wordCount', counts); + updateWordCount(count) { + this.set('wordCount', count); } @action diff --git a/ghost/admin/app/templates/lexical-editor.hbs b/ghost/admin/app/templates/lexical-editor.hbs index 972cf3b187..050372997b 100644 --- a/ghost/admin/app/templates/lexical-editor.hbs +++ b/ghost/admin/app/templates/lexical-editor.hbs @@ -75,7 +75,7 @@ @scrollContainerSelector=".gh-koenig-editor" @scrollOffsetBottomSelector=".gh-mobile-nav-bar" @onEditorCreated={{this.setKoenigEditor}} - @onWordCountChange={{this.updateWordCount}} + @updateWordCount={{this.updateWordCount}} @featureImage={{this.post.featureImage}} @featureImageAlt={{this.post.featureImageAlt}} @featureImageCaption={{this.post.featureImageCaption}} @@ -98,9 +98,9 @@ {{/if}}
- {{!--
- {{gh-pluralize this.wordCount.wordCount "word"}} -
--}} +
+ {{gh-pluralize this.wordCount "word"}} +
{{!-- Lexical --}} {{svg-jar "help"}}
From ab119ec96eddc9108159a49d3ebe7751ddb975b4 Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Jun 2023 08:11:43 +0000 Subject: [PATCH 4/4] v5.51.2 --- 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 78e3316d75..135774d5a1 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.51.1", + "version": "5.51.2", "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 910a624e12..8b70f72dd9 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.51.1", + "version": "5.51.2", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",