Przeglądaj źródła

Show warnings on project list for some V1 data

Alasdair Smith 8 lat temu
rodzic
commit
7d58427485

+ 11 - 1
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:

+ 2 - 2
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