From afa8495511d7239d22d10eaf7d96b93eac6ada9f Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Thu, 18 Aug 2016 16:57:41 +0000 Subject: [PATCH] Add a notice when worklists or boards are private or archived The archived notice also provides a way for worklist/board owners to quickly unarchive the worklist or board. Change-Id: Ida9c9960a8a2a5a35a7bc587bd43b8434ef6d28e --- .../controller/board_detail_controller.js | 10 ++++++++ src/app/boards/template/detail.html | 22 +++++++++++++++++ .../controller/worklist_detail_controller.js | 7 +++++- src/app/worklists/template/detail.html | 24 ++++++++++++++++++- src/theme/base/boards_worklists.less | 4 ++++ 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/src/app/boards/controller/board_detail_controller.js b/src/app/boards/controller/board_detail_controller.js index 3addee4e..faa3c6bc 100644 --- a/src/app/boards/controller/board_detail_controller.js +++ b/src/app/boards/controller/board_detail_controller.js @@ -139,6 +139,16 @@ angular.module('sb.board').controller('BoardDetailController', }); }; + $scope.unarchive = function() { + $scope.board.archived = false; + $scope.board.$update().then(function() { + angular.forEach($scope.board.lanes, function(lane) { + lane.worklist.archived = false; + Worklist.update(lane.worklist); + }); + }); + }; + /** * Open a modal to handle archiving the board. */ diff --git a/src/app/boards/template/detail.html b/src/app/boards/template/detail.html index ed71baa8..2538472b 100644 --- a/src/app/boards/template/detail.html +++ b/src/app/boards/template/detail.html @@ -14,6 +14,28 @@ ~ under the License. -->
+
+

+ + This board is archived. + It can still be interacted with, but won't show up in search results. +

+
+ +
+
+
+ + This board is private. + + Edit this board to change the privacy settings. + +
diff --git a/src/app/worklists/controller/worklist_detail_controller.js b/src/app/worklists/controller/worklist_detail_controller.js index 28d637e4..2c32a36b 100644 --- a/src/app/worklists/controller/worklist_detail_controller.js +++ b/src/app/worklists/controller/worklist_detail_controller.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Codethink Limited + * Copyright (c) 2015-2016 Codethink Limited * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain @@ -83,6 +83,11 @@ angular.module('sb.worklist').controller('WorklistDetailController', }); }; + $scope.unarchive = function() { + $scope.worklist.archived = false; + $scope.worklist.$update(); + }; + /** * Toggle edit mode on the worklist. If going on->off then * save changes. diff --git a/src/app/worklists/template/detail.html b/src/app/worklists/template/detail.html index 8899b1bf..fe43e0b9 100644 --- a/src/app/worklists/template/detail.html +++ b/src/app/worklists/template/detail.html @@ -1,5 +1,5 @@