diff --git a/core/frontend/services/routing/controllers/entry.js b/core/frontend/services/routing/controllers/entry.js index 10fc1c72ef..0e8520c015 100644 --- a/core/frontend/services/routing/controllers/entry.js +++ b/core/frontend/services/routing/controllers/entry.js @@ -41,7 +41,7 @@ module.exports = function entryController(req, res, next) { debug('redirect. is edit url'); const resourceType = entry.page ? 'page' : 'post'; - return urlUtils.redirectToAdmin(302, res, `/editor/${resourceType}/${entry.id}`); + return urlUtils.redirectToAdmin(302, res, `/#/editor/${resourceType}/${entry.id}`); } /** diff --git a/core/frontend/services/routing/controllers/preview.js b/core/frontend/services/routing/controllers/preview.js index 96eb36e671..e6e1cf7932 100644 --- a/core/frontend/services/routing/controllers/preview.js +++ b/core/frontend/services/routing/controllers/preview.js @@ -43,7 +43,7 @@ module.exports = function previewController(req, res, next) { const resourceType = post.page ? 'page' : 'post'; // CASE: last param of the url is /edit, redirect to admin - return urlUtils.redirectToAdmin(302, res, `/editor/${resourceType}/${post.id}`); + return urlUtils.redirectToAdmin(302, res, `/#/editor/${resourceType}/${post.id}`); } else if (req.params.options) { // CASE: unknown options param detected, ignore return next(); diff --git a/test/frontend-acceptance/default_routes_spec.js b/test/frontend-acceptance/default_routes_spec.js index 7a298db61d..6eae9713ef 100644 --- a/test/frontend-acceptance/default_routes_spec.js +++ b/test/frontend-acceptance/default_routes_spec.js @@ -160,7 +160,7 @@ describe('Default Frontend routing', function () { describe('Post edit', function () { it('should redirect to editor', function (done) { request.get('/welcome/edit/') - .expect('Location', /ghost\/editor\/\w+/) + .expect('Location', /ghost\/#\/editor\/\w+/) .expect('Cache-Control', testUtils.cacheRules.public) .expect(302) .end(doEnd(done)); diff --git a/test/regression/site/frontend_spec.js b/test/regression/site/frontend_spec.js index 66ccbb98dc..568a1b23f4 100644 --- a/test/regression/site/frontend_spec.js +++ b/test/regression/site/frontend_spec.js @@ -170,7 +170,7 @@ describe('Frontend Routing', function () { it('should redirect to editor', function (done) { request.get('/static-page-test/edit/') - .expect('Location', /ghost\/editor\/\w+/) + .expect('Location', /ghost\/#\/editor\/\w+/) .expect('Cache-Control', testUtils.cacheRules.public) .expect(302) .end(doEnd(done)); diff --git a/test/unit/services/routing/controllers/entry_spec.js b/test/unit/services/routing/controllers/entry_spec.js index 8ca4d00cdf..b335133a4d 100644 --- a/test/unit/services/routing/controllers/entry_spec.js +++ b/test/unit/services/routing/controllers/entry_spec.js @@ -6,7 +6,7 @@ const urlService = require('../../../../../core/frontend/services/url'); const urlUtils = require('../../../../../core/shared/url-utils'); const controllers = require('../../../../../core/frontend/services/routing/controllers'); const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const EDITOR_URL = `/editor/post/`; +const EDITOR_URL = `/#/editor/post/`; describe('Unit - services/routing/controllers/entry', function () { let req; diff --git a/test/unit/services/routing/controllers/preview_spec.js b/test/unit/services/routing/controllers/preview_spec.js index 48bd0eebb6..bbc9161580 100644 --- a/test/unit/services/routing/controllers/preview_spec.js +++ b/test/unit/services/routing/controllers/preview_spec.js @@ -8,7 +8,7 @@ const controllers = require('../../../../../core/frontend/services/routing/contr const helpers = require('../../../../../core/frontend/services/routing/helpers'); const urlService = require('../../../../../core/frontend/services/url'); const urlUtils = require('../../../../../core/shared/url-utils'); -const EDITOR_URL = '/editor/post/'; +const EDITOR_URL = '/#/editor/post/'; describe('Unit - services/routing/controllers/preview', function () { let secureStub;