mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3654 from overleaf/tm-remove-v1-connection-error-message
Remove V1 connection error warning from projects dashboard GitOrigin-RevId: 0820adfe385362f2854381bce94db8e953251573
This commit is contained in:
parent
204117fcd1
commit
126c9c02a8
3 changed files with 0 additions and 51 deletions
|
@ -402,7 +402,6 @@ const ProjectController = {
|
||||||
const timer = new metrics.Timer('project-list')
|
const timer = new metrics.Timer('project-list')
|
||||||
const userId = AuthenticationController.getLoggedInUserId(req)
|
const userId = AuthenticationController.getLoggedInUserId(req)
|
||||||
const currentUser = AuthenticationController.getSessionUser(req)
|
const currentUser = AuthenticationController.getSessionUser(req)
|
||||||
let noV1Connection = false
|
|
||||||
let institutionLinkingError
|
let institutionLinkingError
|
||||||
async.parallel(
|
async.parallel(
|
||||||
{
|
{
|
||||||
|
@ -424,7 +423,6 @@ const ProjectController = {
|
||||||
currentUser,
|
currentUser,
|
||||||
(error, hasPaidSubscription) => {
|
(error, hasPaidSubscription) => {
|
||||||
if (error != null && error instanceof V1ConnectionError) {
|
if (error != null && error instanceof V1ConnectionError) {
|
||||||
noV1Connection = true
|
|
||||||
return cb(null, true)
|
return cb(null, true)
|
||||||
}
|
}
|
||||||
cb(error, hasPaidSubscription)
|
cb(error, hasPaidSubscription)
|
||||||
|
@ -443,7 +441,6 @@ const ProjectController = {
|
||||||
|
|
||||||
UserGetter.getUserFullEmails(userId, (error, fullEmails) => {
|
UserGetter.getUserFullEmails(userId, (error, fullEmails) => {
|
||||||
if (error && error instanceof V1ConnectionError) {
|
if (error && error instanceof V1ConnectionError) {
|
||||||
noV1Connection = true
|
|
||||||
return cb(null, result)
|
return cb(null, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,7 +590,6 @@ const ProjectController = {
|
||||||
results.projects,
|
results.projects,
|
||||||
userId
|
userId
|
||||||
)
|
)
|
||||||
const warnings = ProjectController._buildWarningsList(noV1Connection)
|
|
||||||
|
|
||||||
// in v2 add notifications for matching university IPs
|
// in v2 add notifications for matching university IPs
|
||||||
if (Settings.overleaf != null && req.ip !== user.lastLoginIp) {
|
if (Settings.overleaf != null && req.ip !== user.lastLoginIp) {
|
||||||
|
@ -618,7 +614,6 @@ const ProjectController = {
|
||||||
userEmails,
|
userEmails,
|
||||||
hasSubscription: results.hasSubscription,
|
hasSubscription: results.hasSubscription,
|
||||||
institutionLinkingError,
|
institutionLinkingError,
|
||||||
warnings,
|
|
||||||
zipFileSizeLimit: Settings.maxUploadSize
|
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) {
|
_buildPortalTemplatesList(affiliations) {
|
||||||
if (affiliations == null) {
|
if (affiliations == null) {
|
||||||
affiliations = []
|
affiliations = []
|
||||||
|
|
|
@ -163,10 +163,6 @@
|
||||||
) #{translate("delete_and_leave")}
|
) #{translate("delete_and_leave")}
|
||||||
|
|
||||||
.row.row-spaced
|
.row.row-spaced
|
||||||
each warning in warnings
|
|
||||||
.col-xs-12
|
|
||||||
.alert.alert-warning(role="alert")= warning
|
|
||||||
|
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
.card.card-thin.project-list-card
|
.card.card-thin.project-list-card
|
||||||
ul.list-unstyled.project-list.structured-list(
|
ul.list-unstyled.project-list.structured-list(
|
||||||
|
|
|
@ -3,7 +3,6 @@ const path = require('path')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb')
|
||||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
|
||||||
|
|
||||||
const MODULE_PATH = path.join(
|
const MODULE_PATH = path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
@ -490,39 +489,6 @@ describe('ProjectController', function() {
|
||||||
this.ProjectController.projectListPage(this.req, this.res)
|
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) {
|
describe('front widget', function(done) {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.settings.overleaf = {
|
this.settings.overleaf = {
|
||||||
|
|
Loading…
Reference in a new issue