mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Added lexical editor feature flag
no issue - adds `lexicalEditor` alpha labs flag and associated toggle in Admin - when feature flag is enabled the new post/page routes will load the lexical editor instead of the mobiledoc editor
This commit is contained in:
parent
e957c6d3a1
commit
48aaa53770
@ -1,6 +1,18 @@
|
||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default class NewRoute extends AuthenticatedRoute {
|
||||
@service feature;
|
||||
@service router;
|
||||
|
||||
beforeModel(transition) {
|
||||
super.beforeModel(...arguments);
|
||||
|
||||
if (this.feature.lexicalEditor) {
|
||||
return this.transitionTo('lexical-editor.new', transition.to.params.type);
|
||||
}
|
||||
}
|
||||
|
||||
model(params, transition) {
|
||||
let {type: modelName} = params;
|
||||
|
||||
@ -13,7 +25,7 @@ export default class NewRoute extends AuthenticatedRoute {
|
||||
}
|
||||
|
||||
// there's no specific controller for this route, instead all editor
|
||||
// handling is done on the editor route/controler
|
||||
// handling is done on the editor route/controller
|
||||
setupController(controller, newPost) {
|
||||
let editor = this.controllerFor('editor');
|
||||
editor.setPost(newPost);
|
||||
|
@ -66,6 +66,7 @@ export default class FeatureService extends Service {
|
||||
@feature('emailAlerts') emailAlerts;
|
||||
@feature('emailClicks') emailClicks;
|
||||
@feature('sourceAttribution') sourceAttribution;
|
||||
@feature('lexicalEditor') lexicalEditor;
|
||||
|
||||
_user = null;
|
||||
|
||||
|
@ -265,6 +265,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gh-expandable-block">
|
||||
<div class="gh-expandable-header">
|
||||
<div>
|
||||
<h4 class="gh-expandable-title">Lexical editor</h4>
|
||||
<p class="gh-expandable-description">
|
||||
Makes lexical editor the default when creating new posts/pages.
|
||||
</p>
|
||||
</div>
|
||||
<div class="for-switch">
|
||||
<GhFeatureFlag @flag="lexicalEditor" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -33,7 +33,8 @@ const ALPHA_FEATURES = [
|
||||
'urlCache',
|
||||
'beforeAfterCard',
|
||||
'emailClicks',
|
||||
'sourceAttribution'
|
||||
'sourceAttribution',
|
||||
'lexicalEditor'
|
||||
];
|
||||
|
||||
module.exports.GA_KEYS = [...GA_FEATURES];
|
||||
|
Loading…
Reference in New Issue
Block a user