From f3583b17021daeb65f19e197932c351b3edd8cc0 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Wed, 15 Nov 2017 17:19:37 +0000 Subject: [PATCH] Show warning message if V1 connection fails --- .../web/app/coffee/Features/Project/ProjectController.coffee | 5 ++++- services/web/app/views/project/list/project-list.pug | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index a4d8ab0274..bbff14d2a1 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -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? diff --git a/services/web/app/views/project/list/project-list.pug b/services/web/app/views/project/list/project-list.pug index 806e2d97e8..0db4f49400 100644 --- a/services/web/app/views/project/list/project-list.pug +++ b/services/web/app/views/project/list/project-list.pug @@ -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(