From 126c9c02a8492847977af9687448a7d418ecf5de Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 16 Feb 2021 15:06:30 +0100 Subject: [PATCH] Merge pull request #3654 from overleaf/tm-remove-v1-connection-error-message Remove V1 connection error warning from projects dashboard GitOrigin-RevId: 0820adfe385362f2854381bce94db8e953251573 --- .../src/Features/Project/ProjectController.js | 13 ------- .../app/views/project/list/project-list.pug | 4 --- .../src/Project/ProjectControllerTests.js | 34 ------------------- 3 files changed, 51 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index b5cd9c0fab..350f9b3797 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -402,7 +402,6 @@ const ProjectController = { const timer = new metrics.Timer('project-list') const userId = AuthenticationController.getLoggedInUserId(req) const currentUser = AuthenticationController.getSessionUser(req) - let noV1Connection = false let institutionLinkingError async.parallel( { @@ -424,7 +423,6 @@ const ProjectController = { currentUser, (error, hasPaidSubscription) => { if (error != null && error instanceof V1ConnectionError) { - noV1Connection = true return cb(null, true) } cb(error, hasPaidSubscription) @@ -443,7 +441,6 @@ const ProjectController = { UserGetter.getUserFullEmails(userId, (error, fullEmails) => { if (error && error instanceof V1ConnectionError) { - noV1Connection = true return cb(null, result) } @@ -593,7 +590,6 @@ const ProjectController = { results.projects, userId ) - const warnings = ProjectController._buildWarningsList(noV1Connection) // in v2 add notifications for matching university IPs if (Settings.overleaf != null && req.ip !== user.lastLoginIp) { @@ -618,7 +614,6 @@ const ProjectController = { userEmails, hasSubscription: results.hasSubscription, institutionLinkingError, - warnings, zipFileSizeLimit: Settings.maxUploadSize } @@ -1049,14 +1044,6 @@ const ProjectController = { ) }, - _buildWarningsList(noConnection) { - return noConnection - ? [ - 'Error accessing Overleaf V1. Some of your projects or features may be missing.' - ] - : [] - }, - _buildPortalTemplatesList(affiliations) { if (affiliations == null) { affiliations = [] diff --git a/services/web/app/views/project/list/project-list.pug b/services/web/app/views/project/list/project-list.pug index 2f47f5b128..bfdb87871c 100644 --- a/services/web/app/views/project/list/project-list.pug +++ b/services/web/app/views/project/list/project-list.pug @@ -163,10 +163,6 @@ ) #{translate("delete_and_leave")} .row.row-spaced - each warning in warnings - .col-xs-12 - .alert.alert-warning(role="alert")= warning - .col-xs-12 .card.card-thin.project-list-card ul.list-unstyled.project-list.structured-list( diff --git a/services/web/test/unit/src/Project/ProjectControllerTests.js b/services/web/test/unit/src/Project/ProjectControllerTests.js index 6d0690254c..de5177016f 100644 --- a/services/web/test/unit/src/Project/ProjectControllerTests.js +++ b/services/web/test/unit/src/Project/ProjectControllerTests.js @@ -3,7 +3,6 @@ const path = require('path') const sinon = require('sinon') const { expect } = require('chai') const { ObjectId } = require('mongodb') -const Errors = require('../../../../app/src/Features/Errors/Errors') const MODULE_PATH = path.join( __dirname, @@ -490,39 +489,6 @@ describe('ProjectController', function() { this.ProjectController.projectListPage(this.req, this.res) }) - describe('when there is a v1 connection error', function() { - beforeEach(function() { - this.Features.hasFeature = sinon - .stub() - .withArgs('overleaf-integration') - .returns(true) - this.connectionWarning = - 'Error accessing Overleaf V1. Some of your projects or features may be missing.' - }) - - it('should show a warning when there is an error getting subscriptions from v1', function(done) { - this.LimitationsManager.hasPaidSubscription.yields( - new Errors.V1ConnectionError('error') - ) - this.res.render = (pageName, opts) => { - expect(opts.warnings).to.contain(this.connectionWarning) - done() - } - this.ProjectController.projectListPage(this.req, this.res) - }) - - it('should show a warning when there is an error getting full emails due to v1', function(done) { - this.UserGetter.getUserFullEmails.yields( - new Errors.V1ConnectionError('error') - ) - this.res.render = (pageName, opts) => { - expect(opts.warnings).to.contain(this.connectionWarning) - done() - } - this.ProjectController.projectListPage(this.req, this.res) - }) - }) - describe('front widget', function(done) { beforeEach(function() { this.settings.overleaf = {