mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -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;
|
showSettingsMenu = false;
|
||||||
hostLimitError = null;
|
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
|
// koenig related properties
|
||||||
wordcount = null;
|
wordcount = null;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,16 @@ export default AuthenticatedRoute.extend({
|
||||||
this.ui.set('isFullScreen', true);
|
this.ui.set('isFullScreen', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setupController(controller, model, transition) {
|
||||||
|
if (transition.from?.name === 'posts.analytics') {
|
||||||
|
controller.fromAnalytics = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
resetController(controller) {
|
||||||
|
controller.fromAnalytics = false;
|
||||||
|
},
|
||||||
|
|
||||||
deactivate() {
|
deactivate() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.ui.set('isFullScreen', false);
|
this.ui.set('isFullScreen', false);
|
||||||
|
|
|
@ -16,23 +16,35 @@
|
||||||
>
|
>
|
||||||
<div class="flex items-center pe-auto h-100">
|
<div class="flex items-center pe-auto h-100">
|
||||||
{{#if this.ui.isFullScreen}}
|
{{#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}}>
|
{{#if this.fromAnalytics }}
|
||||||
<span>
|
<LinkTo @route="posts.analytics" @model={{this.post}} class="gh-btn-editor gh-editor-back-button">
|
||||||
{{svg-jar "arrow-left"}}
|
<span>
|
||||||
{{capitalize (pluralize this.post.displayName)}}
|
{{svg-jar "arrow-left"}}
|
||||||
</span>
|
Analytics
|
||||||
</LinkTo>
|
</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}}
|
{{/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>
|
</div>
|
||||||
|
|
||||||
<section class="flex items-center pe-auto h-100">
|
<section class="flex items-center pe-auto h-100">
|
||||||
|
|
Loading…
Add table
Reference in a new issue