diff --git a/services/web/README.md b/services/web/README.md
index 0ada4e0e6f..5bdedbe03e 100644
--- a/services/web/README.md
+++ b/services/web/README.md
@@ -97,7 +97,7 @@ make test_acceptance_app_stop_service
During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI:
```
-make acceptance_test_run MOCHA_ARGS='--grep=AuthorizationManager'
+make test_acceptance_run MOCHA_GREP='AuthorizationManager'
```
To run only the acceptance tests for a single module do:
diff --git a/services/web/app/src/Features/TokenAccess/TokenAccessController.js b/services/web/app/src/Features/TokenAccess/TokenAccessController.js
index 12bda2b969..e2eea0f873 100644
--- a/services/web/app/src/Features/TokenAccess/TokenAccessController.js
+++ b/services/web/app/src/Features/TokenAccess/TokenAccessController.js
@@ -14,7 +14,6 @@ let TokenAccessController
const ProjectController = require('../Project/ProjectController')
const AuthenticationController = require('../Authentication/AuthenticationController')
const TokenAccessHandler = require('./TokenAccessHandler')
-const Features = require('../../infrastructure/Features')
const Errors = require('../Errors/Errors')
const logger = require('logger-sharelatex')
const settings = require('settings-sharelatex')
@@ -280,11 +279,7 @@ module.exports = TokenAccessController = {
_handleV1Project(token, userId, redirectPath, res, next) {
if (userId == null) {
- if (Features.hasFeature('force-import-to-v2')) {
- return res.render('project/v2-import', { loginRedirect: redirectPath })
- } else {
- return res.redirect(302, `/sign_in_to_v1?return_to=${redirectPath}`)
- }
+ return res.render('project/v2-import', { loginRedirect: redirectPath })
} else {
return TokenAccessHandler.getV1DocInfo(token, userId, function(
err,
@@ -299,17 +294,13 @@ module.exports = TokenAccessController = {
if (doc_info.exported) {
return next(new Errors.NotFoundError())
}
- if (Features.hasFeature('force-import-to-v2')) {
- return res.render('project/v2-import', {
- projectId: token,
- hasOwner: doc_info.has_owner,
- name: doc_info.name || 'Untitled',
- hasAssignment: doc_info.has_assignment,
- brandInfo: doc_info.brand_info
- })
- } else {
- return res.redirect(302, `/sign_in_to_v1?return_to=${redirectPath}`)
- }
+ return res.render('project/v2-import', {
+ projectId: token,
+ hasOwner: doc_info.has_owner,
+ name: doc_info.name || 'Untitled',
+ hasAssignment: doc_info.has_assignment,
+ brandInfo: doc_info.brand_info
+ })
})
}
}
diff --git a/services/web/app/src/infrastructure/Features.js b/services/web/app/src/infrastructure/Features.js
index 2c8eb95339..6a0a2f6934 100644
--- a/services/web/app/src/infrastructure/Features.js
+++ b/services/web/app/src/infrastructure/Features.js
@@ -55,8 +55,6 @@ module.exports = Features = {
)
case 'redirect-sl':
return Settings.redirectToV2 != null
- case 'force-import-to-v2':
- return Settings.forceImportToV2
default:
throw new Error(`unknown feature: ${feature}`)
}
diff --git a/services/web/app/views/project/list/modals.pug b/services/web/app/views/project/list/modals.pug
index f0dc4bbb78..f34f67c565 100644
--- a/services/web/app/views/project/list/modals.pug
+++ b/services/web/app/views/project/list/modals.pug
@@ -332,46 +332,3 @@ script(type="text/ng-template", id="userProfileModalTemplate")
.modal-footer
button.btn.btn-info(ng-click="done()") #{translate("done")}
-script(type="text/ng-template", id="v1ImportModalTemplate")
- .modal-header
- button.close(ng-click="dismiss()") ×
- h3 Move Project to Overleaf v2
-
- .modal-body.v1-import-wrapper
- .v1-import-row
- .v1-import-col.v1-import-col--left
- img.v1-import-img(
- src="/img/v1-import/v2-editor.png"
- alt="The new V2 editor."
- )
- .v1-import-col
- h2.v1-import-title #[strong Warning:] Some Overleaf v1 features aren't supported yet
- p We are still working hard to bring some Overleaf v1 features to the v2 editor. In v2:
- ul
- li There is no CiteULike integration
- li Some Journals and Services in the Submit menu don't support direct submissions yet
- .v1-import-cta
- p
- strong Please note: you cannot move this project back to v1 once you have moved it to v2.
- p Are you sure you want to move #[strong {{project.name}}] into Overleaf v2?
-
- .modal-footer.v1-import-footer
- form(
- async-form="v1Import",
- name="v1ImportForm",
- action="{{'/overleaf/project/'+ project.id + '/import'}}"
- method="POST"
- ng-cloak
- )
- input(name='_csrf', type='hidden', value=csrfToken)
- form-messages(for="v1ImportForm")
- if settings.overleaf && settings.overleaf.host
- a.btn.btn-primary.v1-import-btn(
- ng-href='/sign_in_to_v1?return_to=/{{project.id}}'
- ng-class="{disabled: v1ImportForm.inflight || v1ImportForm.response.success}"
- ) No thanks, open in v1
- input.btn.btn-primary.v1-import-btn(
- type="submit",
- value="Yes, move project to v2"
- ng-disabled="v1ImportForm.inflight || v1ImportForm.response.success"
- )
diff --git a/services/web/app/views/project/list/v1-item.pug b/services/web/app/views/project/list/v1-item.pug
index ed5e6741e5..96fea07904 100644
--- a/services/web/app/views/project/list/v1-item.pug
+++ b/services/web/app/views/project/list/v1-item.pug
@@ -7,19 +7,7 @@ td.project-list-table-name-cell(ng-if-start="project.isV1Project")
tooltip-append-to-body="true"
)
span.project-list-table-name
- if hasFeature('force-import-to-v2')
- a.projectName(href='/{{project.id}}') {{project.name}}
- else
- button.btn.btn-link.projectName(
- ng-click="openV1ImportModal(project)"
- stop-propagation="click"
- ng-show="project.accessLevel == 'owner'"
- ) {{project.name}}
- a.projectName(
- href='/sign_in_to_v1?return_to=/{{project.id}}'
- target="_blank"
- ng-hide="project.accessLevel == 'owner'"
- ) {{project.name}}
+ a.projectName(href='/{{project.id}}') {{project.name}}
td.project-list-table-owner-cell
span.owner {{ownerName(project)}}
diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug
index 1f5f462f07..86e866d073 100644
--- a/services/web/app/views/user/settings.pug
+++ b/services/web/app/views/user/settings.pug
@@ -225,19 +225,11 @@ block content
div.modal-body#delete-account-modal
p !{translate("delete_account_warning_message_3")}
if settings.createV1AccountOnLogin && settings.overleaf
- if settings.forceImportToV2
- p
- strong
- | Your Overleaf v2 projects will be deleted if you delete your account.
- | If you want to remove any remaining Overleaf v1 projects in your account,
- | please first make sure they are imported to Overleaf v2.
- else
- p
- strong
- | This will also delete your user account on #[a(href='/sign_in_to_v1?return_to=/dash%3Fprefer-v1-dash%3D1' target="_blank") Overleaf v1].
- | If you want to remove your projects from Overleaf v1, you must do this before you
- | delete your account by going to your My Projects page in Overleaf v1, moving your
- | projects to the Trash, and then from there either ‘leaving’ or ‘purging’ them, as appropriate.
+ p
+ strong
+ | Your Overleaf v2 projects will be deleted if you delete your account.
+ | If you want to remove any remaining Overleaf v1 projects in your account,
+ | please first make sure they are imported to Overleaf v2.
if settings.overleaf && !hasPassword
p
diff --git a/services/web/public/src/main/project-list/project-list.js b/services/web/public/src/main/project-list/project-list.js
index 8934e2966f..d63b7f3593 100644
--- a/services/web/public/src/main/project-list/project-list.js
+++ b/services/web/public/src/main/project-list/project-list.js
@@ -699,19 +699,6 @@ define(['base', 'main/project-list/services/project-list'], function(App) {
return (window.location = path)
}
- $scope.openV1ImportModal = project =>
- $modal.open({
- templateUrl: 'v1ImportModalTemplate',
- controller: 'V1ImportModalController',
- size: 'lg',
- windowClass: 'v1-import-modal',
- resolve: {
- project() {
- return project
- }
- }
- })
-
const markTagAsSelected = id => {
for (let tag of $scope.tags) {
if (tag._id === id) {
diff --git a/services/web/test/acceptance/src/TokenAccessTests.js b/services/web/test/acceptance/src/TokenAccessTests.js
index 082628e73c..14f862fb40 100644
--- a/services/web/test/acceptance/src/TokenAccessTests.js
+++ b/services/web/test/acceptance/src/TokenAccessTests.js
@@ -861,25 +861,21 @@ describe('TokenAccess', function() {
this.owner,
unimportedV1Token,
(response, body) => {
- expect(response.statusCode).to.equal(302)
- return expect(response.headers.location).to.equal(
- '/sign_in_to_v1?return_to=/123abc'
- )
+ expect(response.statusCode).to.equal(200)
+ expect(body).to.contain('has not been imported to v2 yet.')
},
done
)
})
- it('should redirect read only token to v1', function(done) {
+ it('should show import project page', function(done) {
const unimportedV1Token = 'abcd'
return try_read_only_token_access(
this.owner,
unimportedV1Token,
(response, body) => {
- expect(response.statusCode).to.equal(302)
- return expect(response.headers.location).to.equal(
- '/sign_in_to_v1?return_to=/read/abcd'
- )
+ expect(response.statusCode).to.equal(200)
+ expect(body).to.contain('has not been imported to v2 yet.')
},
done
)
diff --git a/services/web/test/unit/src/TokenAccess/TokenAccessControllerTests.js b/services/web/test/unit/src/TokenAccess/TokenAccessControllerTests.js
index 531f769c61..2df17a9db2 100644
--- a/services/web/test/unit/src/TokenAccess/TokenAccessControllerTests.js
+++ b/services/web/test/unit/src/TokenAccess/TokenAccessControllerTests.js
@@ -424,15 +424,16 @@ describe('TokenAccessController', function() {
)
})
- it('should redirect to v1', function(done) {
- expect(this.res.redirect.callCount).to.equal(1)
- expect(
- this.res.redirect.calledWith(
- 302,
- '/sign_in_to_v1?return_to=/123abc'
- )
- ).to.equal(true)
- return done()
+ it('should not redirect to v1', function(done) {
+ expect(this.res.redirect.callCount).to.equal(0)
+ done()
+ })
+
+ it('should show project import page', function(done) {
+ expect(this.res.render.calledWith('project/v2-import')).to.equal(
+ true
+ )
+ done()
})
})
@@ -1102,6 +1103,7 @@ describe('TokenAccessController', function() {
this.req = new MockRequest()
this.res = new MockResponse()
this.res.redirect = sinon.stub()
+ this.res.render = sinon.stub()
this.next = sinon.stub()
this.req.params['read_only_token'] = 'abcd'
this.TokenAccessHandler.findProjectWithReadOnlyToken = sinon
@@ -1110,22 +1112,21 @@ describe('TokenAccessController', function() {
this.TokenAccessHandler.checkV1ProjectExported = sinon
.stub()
.callsArgWith(1, null, false)
- return this.TokenAccessController.readOnlyToken(
+ this.TokenAccessController.readOnlyToken(
this.req,
this.res,
this.next
)
})
- it('should redirect to v1', function(done) {
- expect(this.res.redirect.callCount).to.equal(1)
- expect(
- this.res.redirect.calledWith(
- 302,
- '/sign_in_to_v1?return_to=/read/abcd'
- )
- ).to.equal(true)
- return done()
+ it('should not redirect to v1', function(done) {
+ expect(this.res.redirect.callCount).to.equal(0)
+ done()
+ })
+
+ it('should show project import page', function(done) {
+ expect(this.res.render.calledWith('project/v2-import')).to.equal(true)
+ done()
})
})
@@ -1756,22 +1757,24 @@ describe('TokenAccessController', function() {
exists: true,
exported: false
})
- return this.TokenAccessController.readOnlyToken(
+ this.res.render = sinon.stub()
+ this.TokenAccessController.readOnlyToken(
this.req,
this.res,
this.next
)
})
- it('should redirect to v1', function(done) {
- expect(this.res.redirect.callCount).to.equal(1)
- expect(
- this.res.redirect.calledWith(
- 302,
- `/sign_in_to_v1?return_to=/read/${this.readOnlyToken}`
- )
- ).to.equal(true)
- return done()
+ it('should not redirect to v1', function(done) {
+ expect(this.res.redirect.callCount).to.equal(0)
+ done()
+ })
+
+ it('should show project import page', function(done) {
+ expect(this.res.render.calledWith('project/v2-import')).to.equal(
+ true
+ )
+ done()
})
})
@@ -1810,22 +1813,24 @@ describe('TokenAccessController', function() {
exists: true,
exported: false
})
- return this.TokenAccessController.readOnlyToken(
+ this.res.render = sinon.stub()
+ this.TokenAccessController.readOnlyToken(
this.req,
this.res,
this.next
)
})
- it('should redirect to v1', function(done) {
- expect(this.res.redirect.callCount).to.equal(1)
- expect(
- this.res.redirect.calledWith(
- 302,
- `/sign_in_to_v1?return_to=/read/${this.readOnlyToken}`
- )
- ).to.equal(true)
- return done()
+ it('should not redirect to v1', function(done) {
+ expect(this.res.redirect.callCount).to.equal(0)
+ done()
+ })
+
+ it('should show project import page', function(done) {
+ expect(this.res.render.calledWith('project/v2-import')).to.equal(
+ true
+ )
+ done()
})
})