mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
Add error message on subscription dashboard if v1 is down (instead of returning a 500 error page) (#7947)
* Add error message on subscription dashboard if v1 is down GitOrigin-RevId: 8c8b5ac4d44cfd2c42101efe1d55a5993ca21eea
This commit is contained in:
@@ -11,7 +11,11 @@ const _ = require('underscore')
|
||||
const async = require('async')
|
||||
const SubscriptionHelper = require('./SubscriptionHelper')
|
||||
const { promisify } = require('../../util/promises')
|
||||
const { InvalidError, NotFoundError } = require('../Errors/Errors')
|
||||
const {
|
||||
InvalidError,
|
||||
NotFoundError,
|
||||
V1ConnectionError,
|
||||
} = require('../Errors/Errors')
|
||||
|
||||
function buildHostedLink(type) {
|
||||
return `/user/subscription/recurly/${type}`
|
||||
@@ -109,7 +113,15 @@ function buildUsersSubscriptionViewModel(user, callback) {
|
||||
SubscriptionLocator.getManagedGroupSubscriptions(user, cb)
|
||||
},
|
||||
currentInstitutionsWithLicence(cb) {
|
||||
InstitutionsGetter.getCurrentInstitutionsWithLicence(user._id, cb)
|
||||
InstitutionsGetter.getCurrentInstitutionsWithLicence(
|
||||
user._id,
|
||||
(error, institutions) => {
|
||||
if (error instanceof V1ConnectionError) {
|
||||
return cb(null, false)
|
||||
}
|
||||
cb(null, institutions)
|
||||
}
|
||||
)
|
||||
},
|
||||
managedInstitutions(cb) {
|
||||
InstitutionsGetter.getManagedInstitutions(user._id, cb)
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
each institution in currentInstitutionsWithLicence
|
||||
-hasDisplayedSubscription = true
|
||||
p
|
||||
| You have a
|
||||
|
|
||||
strong(ng-non-bindable) Professional
|
||||
|
|
||||
| #{settings.appName} account as a confirmed member of
|
||||
|
|
||||
strong(ng-non-bindable)= institution.name
|
||||
hr
|
||||
if currentInstitutionsWithLicence === false
|
||||
.alert.alert-warning
|
||||
p Sorry, something went wrong. Subscription information related to institutional affiliations may not be displayed. Please try again later.
|
||||
else
|
||||
each institution in currentInstitutionsWithLicence
|
||||
-hasDisplayedSubscription = true
|
||||
p
|
||||
| You have a
|
||||
|
|
||||
strong(ng-non-bindable) Professional
|
||||
|
|
||||
| #{settings.appName} account as a confirmed member of
|
||||
|
|
||||
strong(ng-non-bindable)= institution.name
|
||||
hr
|
||||
|
||||
Reference in New Issue
Block a user