Merge pull request #2826 from overleaf/ns-project-import-flow-deletion

Project import flow deletion

GitOrigin-RevId: 08ffc156eb158235d4ccacba2b3ed504cd9978f0
This commit is contained in:
nate stemen 2020-05-20 09:02:50 -04:00 committed by Copybot
parent 5fca56d4e6
commit 2479cb485a
4 changed files with 15 additions and 74 deletions

View file

@ -64,11 +64,10 @@ async function _handleV1Project(token, userId) {
}
return {
v1Import: {
status: 'canImport',
status: 'canDownloadZip',
projectId: token,
hasOwner: docInfo.has_owner,
name: docInfo.name || 'Untitled',
hasAssignment: docInfo.has_assignment,
brandInfo: docInfo.brand_info
}
}

View file

@ -14,7 +14,7 @@ block content
.editor.full-size
div
|  
a(href="/project" style="font-size: 2rem; margin-left: 1rem; color: #ddd;")
a(href="/project", style="font-size: 2rem; margin-left: 1rem; color: #ddd;")
i.fa.fa-arrow-left
.loading-screen(
@ -77,72 +77,18 @@ block content
href="/login?redir={{ currentPath() }}"
) Log In To Move Project
div(ng-if="v1ImportData.status == 'canImport'")
div(ng-if="v1ImportData.hasOwner")
p.text-center.row-spaced-small
| #[strong() {{ getProjectName() }}] has not yet been moved into
| the new version of Overleaf. You will need to move it in order
| to continue working on it. It should only take a few seconds.
div(ng-if="v1ImportData.status == 'canDownloadZip'")
p.text-center.row-spaced.small
| #[strong() {{ getProjectName() }}] has not yet been moved into
| the new version of Overleaf. This project was created
| anonymously and therefore cannot be automatically imported.
| Please download a zip file of the project and upload that to
| continue editing it. If you would like to delete this project
| after you have made a copy, please contact support.
form(
async-form="v2Import"
name="v2ImportForm"
action="{{ buildFormImportPath(v1ImportData.projectId) }}"
method="POST"
ng-cloak
)
input(name='_csrf', type='hidden', value=csrfToken)
form-messages(for="v2ImportForm")
input.row-spaced.btn.btn-primary.text-center.center-block(
type="submit"
ng-value="v2ImportForm.inflight || v2ImportForm.response.success ? 'Moving to v2…' : 'Move Project and Continue'"
ng-disabled="v2ImportForm.inflight || v2ImportForm.response.success"
)
.row-spaced-small.text-center
a(href="{{ buildZipDownloadPath(v1ImportData.projectId) }}")
| Download project zip file
div(ng-if="!v1ImportData.hasOwner")
p.text-center.row-spaced.small
| #[strong() {{ getProjectName() }}] has not yet been moved into
| the new version of Overleaf. This project was created
| anonymously and therefore cannot be automatically imported.
| Please download a zip file of the project and upload that to
| continue editing it. If you would like to delete this project
| after you have made a copy, please contact support.
.row-spaced.text-center
a.btn.btn-primary(href="{{ buildZipDownloadPath(v1ImportData.projectId) }}")
| Download project zip file
.row-spaced.text-center
div(ng-if="v1ImportData.hasAssignment")
p
| #[span.fa.fa-exclamation-triangle]
| This project is an assignment, and the assignment toolkit is
| no longer supported in Overleaf v2. When you move it to
| Overleaf v2, it will become a normal project.
| #[a(href="https://www.overleaf.com/learn/how-to/Overleaf_v2_FAQ#assignment-tools") Please see our FAQ]
| for more information or contact your instructor if you haven't
| already submitted it.
div(ng-if="!v1ImportData.hasAssignment")
div(ng-switch="v1ImportData.brandInfo")
div(ng-switch-when="'f1000'")
p
| #[span.fa.fa-exclamation-triangle]
| This project is an F1000Research article, and our integration
| with F1000Research has changed in Overleaf v2.
| #[a(href="https://www.overleaf.com/learn/how-to/Overleaf_v2_FAQ#f1000research") Find out more about moving to Overleaf v2]
div(ng-switch-when="'wellcome'")
p
| #[span.fa.fa-exclamation-triangle]
| This project is an Wellcome Open Research article, and our
| integration with Wellcome Open Research has changed in
| Overleaf v2.
| #[a(href="https://www.overleaf.com/learn/how-to/Overleaf_v2_FAQ#f1000research") Find out more about moving to Overleaf v2]
div(ng-switch-default)
a(href="https://www.overleaf.com/learn/how-to/Overleaf_v2_FAQ")
| Find out more about moving to Overleaf v2
.row-spaced.text-center
a.btn.btn-primary(href="{{ buildZipDownloadPath(v1ImportData.projectId) }}")
| Download project zip file
block append foot-scripts

View file

@ -15,10 +15,6 @@ App.controller(
return $location.path()
}
$scope.buildFormImportPath = projectId => {
return `/overleaf/project/${projectId}/import`
}
$scope.buildZipDownloadPath = projectId => {
return `/overleaf/project/${projectId}/download/zip`
}

View file

@ -1368,7 +1368,7 @@ describe('TokenAccess', function() {
expect(response.statusCode).to.equal(200)
expect(body).to.deep.equal({
v1Import: {
status: 'canImport',
status: 'canDownloadZip',
projectId: this.tokens.readAndWrite,
hasOwner: true,
name: 'Test Project Import Example'
@ -1388,7 +1388,7 @@ describe('TokenAccess', function() {
expect(response.statusCode).to.equal(200)
expect(body).to.deep.equal({
v1Import: {
status: 'canImport',
status: 'canDownloadZip',
projectId: this.tokens.readOnly,
hasOwner: true,
name: 'Test Project Import Example'