Show warning message if V1 connection fails

This commit is contained in:
Alasdair Smith 2017-11-15 17:19:37 +00:00
parent 24ceaffd3a
commit f3583b1702
2 changed files with 8 additions and 1 deletions

View file

@ -151,7 +151,9 @@ module.exports = ProjectController =
ProjectGetter.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel archived owner_ref tokens', cb
v1Projects: (cb) ->
Modules.hooks.fire "findAllV1Projects", user_id, (error, projects = []) ->
cb error, projects[0] # hooks.fire returns an array of results, only need first
if error? and error.message == 'No V1 connection'
return cb(null, projects: [], tags: [], noConnection: true)
return cb(error, projects[0]) # hooks.fire returns an array of results, only need first
hasSubscription: (cb)->
LimitationsManager.userHasSubscriptionOrIsGroupMember currentUser, cb
user: (cb) ->
@ -179,6 +181,7 @@ module.exports = ProjectController =
user: user
hasSubscription: results.hasSubscription[0]
isShowingV1Projects: results.v1Projects?
noV1Connection: results.v1Projects?.noConnection
}
if Settings?.algolia?.app_id? and Settings?.algolia?.read_only_api_key?

View file

@ -114,6 +114,10 @@
) #{translate("delete_forever")}
.row.row-spaced
if noV1Connection
.col-xs-12
.alert.alert-warning No V1 Connection
.col-xs-12
.card.card-thin.project-list-card
ul.list-unstyled.project-list.structured-list(