From 7d584274857193acf69352f65e03f1901af956e0 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 30 Nov 2017 16:59:13 +0000 Subject: [PATCH 1/2] Show warnings on project list for some V1 data --- .../coffee/Features/Project/ProjectController.coffee | 12 +++++++++++- services/web/app/views/project/list/project-list.pug | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 9d9b7d9a13..801459d4c5 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -170,6 +170,8 @@ module.exports = ProjectController = return notification projects = ProjectController._buildProjectList results.projects, results.v1Projects?.projects user = results.user + warnings = ProjectController._buildWarningsList results.v1Projects + ProjectController._injectProjectOwners projects, (error, projects) -> return next(error) if error? viewModel = { @@ -181,7 +183,7 @@ module.exports = ProjectController = user: user hasSubscription: results.hasSubscription[0] isShowingV1Projects: results.v1Projects? - noV1Connection: results.v1Projects?.noConnection + warnings: warnings } if Settings?.algolia?.app_id? and Settings?.algolia?.read_only_api_key? @@ -427,6 +429,14 @@ module.exports = ProjectController = project.owner = users[project.owner_ref.toString()] callback null, projects + _buildWarningsList: (v1ProjectData = {}) -> + warnings = [] + if v1ProjectData.noConnection + warnings.push 'No V1 Connection' + if v1ProjectData.hasHiddenV1Projects + warnings.push "Looks like you've got a lot of V1 projects! Some of them may be hidden on V2. To view them all, use the V1 dashboard." + return warnings + defaultSettingsForAnonymousUser = (user_id)-> id : user_id ace: diff --git a/services/web/app/views/project/list/project-list.pug b/services/web/app/views/project/list/project-list.pug index 0db4f49400..491fef168c 100644 --- a/services/web/app/views/project/list/project-list.pug +++ b/services/web/app/views/project/list/project-list.pug @@ -114,9 +114,9 @@ ) #{translate("delete_forever")} .row.row-spaced - if noV1Connection + each warning in warnings .col-xs-12 - .alert.alert-warning No V1 Connection + .alert.alert-warning= warning .col-xs-12 .card.card-thin.project-list-card From 5b8c9b2f4cab965021647eba097bf995d19f284a Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 11:00:13 +0000 Subject: [PATCH 2/2] Add aria role to warning --- services/web/app/views/project/list/project-list.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list/project-list.pug b/services/web/app/views/project/list/project-list.pug index 491fef168c..6f568a7b40 100644 --- a/services/web/app/views/project/list/project-list.pug +++ b/services/web/app/views/project/list/project-list.pug @@ -116,7 +116,7 @@ .row.row-spaced each warning in warnings .col-xs-12 - .alert.alert-warning= warning + .alert.alert-warning(role="alert")= warning .col-xs-12 .card.card-thin.project-list-card