0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Copied "from analytics" changes over to lexical editor

no issue

- changes were made to the default editor to adjust the header nav options when accessed from an analytics page but they weren't copied over to the duplicate editor route/controller we use for the in-development lexical editor
This commit is contained in:
Kevin Ansfield 2022-11-11 09:48:07 +00:00
parent 28e4eb60ae
commit 8ae28ed309
3 changed files with 43 additions and 16 deletions

View file

@ -115,6 +115,11 @@ export default class LexicalEditorController extends Controller {
showSettingsMenu = false;
hostLimitError = null;
/**
* Flag used to determine if we should return to the analytics page or to the posts/pages overview
*/
fromAnalytics = false;
// koenig related properties
wordcount = null;

View file

@ -25,6 +25,16 @@ export default AuthenticatedRoute.extend({
this.ui.set('isFullScreen', true);
},
setupController(controller, model, transition) {
if (transition.from?.name === 'posts.analytics') {
controller.fromAnalytics = true;
}
},
resetController(controller) {
controller.fromAnalytics = false;
},
deactivate() {
this._super(...arguments);
this.ui.set('isFullScreen', false);

View file

@ -16,23 +16,35 @@
>
<div class="flex items-center pe-auto h-100">
{{#if this.ui.isFullScreen}}
<LinkTo @route={{pluralize this.post.displayName }} class="gh-btn-editor gh-editor-back-button" data-test-link={{pluralize this.post.displayName}}>
<span>
{{svg-jar "arrow-left"}}
{{capitalize (pluralize this.post.displayName)}}
</span>
</LinkTo>
{{#if this.fromAnalytics }}
<LinkTo @route="posts.analytics" @model={{this.post}} class="gh-btn-editor gh-editor-back-button">
<span>
{{svg-jar "arrow-left"}}
Analytics
</span>
</LinkTo>
{{else}}
<LinkTo @route={{pluralize this.post.displayName }} class="gh-btn-editor gh-editor-back-button" data-test-link={{pluralize this.post.displayName}}>
<span>
{{svg-jar "arrow-left"}}
{{capitalize (pluralize this.post.displayName)}}
</span>
</LinkTo>
{{/if}}
{{/if}}
{{#if (or (not this.ui.isFullScreen) (not this.fromAnalytics) this.post.didEmailFail) }}
<div class="gh-editor-post-status">
<span>
<GhEditorPostStatus
@post={{this.post}}
@publishManagement={{publishManagement}}
@hasDirtyAttributes={{this.hasDirtyAttributes}}
@isSaving={{or this.autosaveTask.isRunning this.saveTasks.isRunning}}
@openUpdateFlow={{publishManagement.openUpdateFlow}}
/>
</span>
</div>
{{/if}}
<div class="gh-editor-post-status">
<span>
<GhEditorPostStatus
@post={{this.post}}
@hasDirtyAttributes={{this.hasDirtyAttributes}}
@isSaving={{or this.autosaveTask.isRunning this.saveTasks.isRunning}}
@openUpdateFlow={{publishManagement.openUpdateFlow}}
/>
</span>
</div>
</div>
<section class="flex items-center pe-auto h-100">