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:
parent
28e4eb60ae
commit
8ae28ed309
3 changed files with 43 additions and 16 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
>
|
||||
<div class="flex items-center pe-auto h-100">
|
||||
{{#if this.ui.isFullScreen}}
|
||||
{{#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"}}
|
||||
|
@ -23,16 +31,20 @@
|
|||
</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>
|
||||
|
||||
<section class="flex items-center pe-auto h-100">
|
||||
|
|
Loading…
Add table
Reference in a new issue