diff --git a/ghost/admin/app/components/posts-list/list-item.hbs b/ghost/admin/app/components/posts-list/list-item.hbs index fbf47f2d92..a3a21b58db 100644 --- a/ghost/admin/app/components/posts-list/list-item.hbs +++ b/ghost/admin/app/components/posts-list/list-item.hbs @@ -45,7 +45,7 @@ {{/unless}} {{else}} - +

{{#if @post.featured}} {{svg-jar "star-fill" class="gh-featured-post"}} @@ -206,7 +206,7 @@ {{else}} - + {{svg-jar "pen" title="Go to Editor"}} diff --git a/ghost/admin/app/routes/error404.js b/ghost/admin/app/routes/error404.js index 1dfcb35c41..a63a9d138d 100644 --- a/ghost/admin/app/routes/error404.js +++ b/ghost/admin/app/routes/error404.js @@ -1,9 +1,28 @@ import Route from '@ember/routing/route'; +import {inject as service} from '@ember/service'; export default class Error404Route extends Route { controllerName = 'error'; templateName = 'error'; + @service router; + + beforeModel(transition) { + // handle redirects for old routes + if (transition.to?.params?.path?.startsWith?.('editor-beta')) { + const [, type, postId] = transition.to.params.path.split('/'); + + const route = postId ? 'lexical-editor.edit' : 'lexical-editor.new'; + const models = [type]; + + if (postId) { + models.push(postId); + } + + return this.router.transitionTo(route, ...models); + } + } + model() { return { status: 404