diff --git a/ghost/admin/.lint-todo b/ghost/admin/.lint-todo index 7a19a83d61..920a6bc85f 100644 --- a/ghost/admin/.lint-todo +++ b/ghost/admin/.lint-todo @@ -566,3 +566,4 @@ add|ember-template-lint|no-invalid-interactive|1|103|1|103|f5a46b2538fbf79a40f26 add|ember-template-lint|no-invalid-interactive|5|53|5|53|9647ef6afba919b2af04fe551b0fdf0fb63be849|1680652800000|1691020800000|1696204800000|app/components/gh-context-menu.hbs remove|ember-template-lint|no-invalid-interactive|1|103|1|103|f5a46b2538fbf79a40f2683ff1151ca60e0fa0ca|1680652800000|1691020800000|1696204800000|app/components/gh-context-menu.hbs add|ember-template-lint|no-invalid-interactive|1|103|1|103|534029ab0ba1b74eff4a2f31c8b4dd9f1460316a|1681430400000|1691798400000|1696982400000|app/components/gh-context-menu.hbs +add|ember-template-lint|no-action|7|49|7|49|141d456b03124abca146e58e4ae15825fdd040bb|1681689600000|1692057600000|1697241600000|app/components/modal-post-history.hbs diff --git a/ghost/admin/app/components/modal-post-history.hbs b/ghost/admin/app/components/modal-post-history.hbs new file mode 100644 index 0000000000..3b88c2aad1 --- /dev/null +++ b/ghost/admin/app/components/modal-post-history.hbs @@ -0,0 +1,18 @@ +{{!-- template-lint-disable no-invalid-interactive --}} + diff --git a/ghost/admin/app/components/modal-post-history.js b/ghost/admin/app/components/modal-post-history.js new file mode 100644 index 0000000000..e755aa8d09 --- /dev/null +++ b/ghost/admin/app/components/modal-post-history.js @@ -0,0 +1,5 @@ +import ModalComponent from 'ghost-admin/components/modal-base'; + +export default ModalComponent.extend({ + +}); diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index cdf9a9e16b..7da0015dc7 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -23,6 +23,7 @@ import {isArray as isEmberArray} from '@ember/array'; import {isHostLimitError, isServerUnreachableError, isVersionMismatchError} from 'ghost-admin/services/ajax'; import {isInvalidError} from 'ember-ajax/errors'; import {inject as service} from '@ember/service'; +import {tracked} from '@glimmer/tracking'; const DEFAULT_TITLE = '(Untitled)'; @@ -115,6 +116,7 @@ export default class LexicalEditorController extends Controller { shouldFocusTitle = false; showSettingsMenu = false; + @tracked showPostHistory = false; /** * Flag used to determine if we should return to the analytics page or to the posts/pages overview @@ -397,6 +399,16 @@ export default class LexicalEditorController extends Controller { }); } + @action + openPostHistory() { + this.showPostHistory = true; + } + + @action + closePostHistory() { + this.showPostHistory = false; + } + /* Public tasks ----------------------------------------------------------*/ // separate task for autosave so that it doesn't override a manual save diff --git a/ghost/admin/app/templates/lexical-editor.hbs b/ghost/admin/app/templates/lexical-editor.hbs index 17e8413983..b37c8f724f 100644 --- a/ghost/admin/app/templates/lexical-editor.hbs +++ b/ghost/admin/app/templates/lexical-editor.hbs @@ -52,7 +52,9 @@ {{#if (feature 'postHistory')}} - {{svg-jar "clock" class="w4 ml3"}} + {{/if}} {{#unless this.showSettingsMenu}} @@ -130,6 +132,15 @@ @close={{this.toggleReAuthenticateModal}} @modifier="action wide" /> {{/if}} + + {{#if (feature 'postHistory')}} + {{#if this.showPostHistory}} + + {{/if}} + {{/if}} {{/if}} {{outlet}} diff --git a/ghost/admin/tests/integration/components/modal-post-history-test.js b/ghost/admin/tests/integration/components/modal-post-history-test.js new file mode 100644 index 0000000000..9637150183 --- /dev/null +++ b/ghost/admin/tests/integration/components/modal-post-history-test.js @@ -0,0 +1,27 @@ +import {describe, it} from 'mocha'; +import {expect} from 'chai'; +import {find, render} from '@ember/test-helpers'; +import {hbs} from 'ember-cli-htmlbars'; +import {setupRenderingTest} from 'ember-mocha'; + +describe('Integration | Component | modal-post-history', function () { + setupRenderingTest(); + + it('renders', async function () { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + expect(find('h2').textContent.trim()).to.equal('Post History'); + + // Template block usage: + await render(hbs` + + template block text + + `); + + expect(find('h2').textContent.trim()).to.equal('Post History'); + }); +});