From 8c04ea8dc99e9b392f4039e8e5e6964d5a6d3453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 4 May 2017 10:58:35 +0200 Subject: [PATCH] Archive boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- css/style.css | 71 ++++++++++++++----- img/deck.svg | 1 + js/app/Config.js | 5 +- js/controller/BoardController.js | 2 +- js/controller/CardController.js | 5 +- js/controller/ListController.js | 39 +++++++++- js/filters/boardFilterAcl.js | 33 +++++++++ js/filters/cardFilter.js | 9 +-- js/filters/textColorFilter.js | 2 +- js/service/BoardService.js | 7 ++ ...xception.php => ArchivedItemException.php} | 4 +- lib/Controller/BoardController.php | 4 +- lib/Service/BoardService.php | 23 +++++- lib/Service/CardService.php | 45 ++++++++++-- lib/Service/LabelService.php | 18 ++++- lib/Service/StackService.php | 11 ++- templates/main.php | 4 +- templates/part.board.mainView.php | 25 +++---- templates/part.boardlist.php | 52 +++++++++++--- templates/part.card.php | 1 + templates/part.navigation.php | 8 ++- tests/unit/ExceptionsTest.php | 4 +- tests/unit/Service/CardServiceTest.php | 12 ++-- 23 files changed, 305 insertions(+), 80 deletions(-) create mode 100644 img/deck.svg create mode 100644 js/filters/boardFilterAcl.js rename lib/{CardArchivedException.php => ArchivedItemException.php} (88%) diff --git a/css/style.css b/css/style.css index ef639ac2f..0345bf781 100644 --- a/css/style.css +++ b/css/style.css @@ -65,6 +65,14 @@ button.button-inline:hover { * Navigation sidebar */ +.app-navigation-entry-menu ul { + flex-direction: row; +} + +.app-navigation-entry-utils-menu-button { + display: block !important; +} + .app-navigation-entry-utils-menu-share { display: flex !important; padding: 14px; @@ -318,8 +326,6 @@ button.button-inline:hover { .popovermenu { z-index: 999; opacity: 1; - margin-top: 25px; - margin-right: 3px; display: block; } @@ -614,23 +620,30 @@ button.button-inline:hover { .colorselect { overflow: hidden; - clear: both; - padding-top: 4px; - padding-left: 4px; + border-radius:3px; + flex-direction: row; + min-width: 240px; + height: 34px; + display: flex; + margin: 3px 3px 3px 0; } .colorselect .color { opacity: 0.7; - width: 27px; - height: 27px; - float: left; - margin-right: 2px; + height: 100%; + flex-grow: 1; border: none; } .colorselect .selected { + background-image: url(../../../core/img/actions/checkmark.svg); + background-position: center center; + background-repeat: no-repeat; opacity: 1.0; - border: 1px solid #333333; +} + +.colorselect .dark.selected { + background-image: url(../../../core/img/actions/checkmark-white.svg); } .labels .colorselect { @@ -662,6 +675,16 @@ button.button-inline:hover { cursor: pointer; display: block; } +#boardlist .app-popover-menu-utils { + width: 30px; + display: inline; + position: relative; +} + +.popovermenu ul { + display: flex !important; + flex-direction: column; +} #boardlist td { padding: 10px; @@ -680,16 +703,28 @@ button.button-inline:hover { .cell-board-title { width: 50%; - } -#boardlist .colorselect, -#boardlist input { - float: left; +#boardlist td form { + display: flex; + width: 100%; } -#boardlist .colorselect { - margin-top: 5px; +#boardlist td .colorselect { + flex-grow: 1; +} + +#boardlist td input[type=text] { + flex-grow: 2; +} + +#boardlist td input[type=submit] { + width: 32px; +} + +#boardlist .popovermenu { + top: 9px; + right: -36px; } /** @@ -925,6 +960,10 @@ button.button-inline:hover { * Custom icons */ +.icon-deck { + background-image: url(../img/deck.svg); +} + .icon-group { background-image: url('../../../settings/img/users.svg'); } diff --git a/img/deck.svg b/img/deck.svg new file mode 100644 index 000000000..9431bc06b --- /dev/null +++ b/img/deck.svg @@ -0,0 +1 @@ + diff --git a/js/app/Config.js b/js/app/Config.js index 3c3ae25b3..eafa2f7a8 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -39,7 +39,10 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid .state('list', { url: "/", templateUrl: "/boardlist.mainView.html", - controller: 'ListController' + controller: 'ListController', + params: { + filter: { value: '' } + } }) .state('board', { url: "/board/:boardId/:filter", diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index 87895e805..0ad8211d9 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -80,7 +80,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St } }; $scope.checkCanEdit = function () { - return !$scope.archived; + return !BoardService.getCurrent().archived; }; // filter cards here, as ng-sortable will not work nicely with html-inline filters diff --git a/js/controller/CardController.js b/js/controller/CardController.js index 9aa2e9812..424659160 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -48,9 +48,10 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo } }; $scope.cardEditDescriptionShow = function($event) { + if(BoardService.isArchived() || CardService.getCurrent().archived) { + return false; + } var node = $event.target.nodeName; - console.log($event); - console.log(BoardService); if($scope.card.archived || !$scope.boardservice.canEdit()) { console.log(node); } else { diff --git a/js/controller/ListController.js b/js/controller/ListController.js index 7389aab35..938c7f569 100644 --- a/js/controller/ListController.js +++ b/js/controller/ListController.js @@ -21,11 +21,13 @@ * */ -app.controller('ListController', function ($scope, $location, $filter, BoardService, $element, $timeout) { +app.controller('ListController', function ($scope, $location, $filter, BoardService, $element, $timeout, $stateParams) { $scope.boards = []; $scope.newBoard = {}; $scope.status = { - deleteUndo: [] + deleteUndo: [], + filter: $stateParams.filter ? $stateParams.filter : '', + sidebar: false }; $scope.colors = ['0082c9', '00c9c6','00c906', 'c92b00', 'F1DB50', '7C31CC', '3A3B3D', 'CACBCD']; $scope.boardservice = BoardService; @@ -42,9 +44,27 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ $scope.filterData = function () { angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted); + $scope.boardservice.sidebar = $filter('orderBy')($scope.boardservice.sorted, 'title'); + + if ($scope.status.filter === 'archived') { + var filter = {}; + filter[$scope.status.filter] = true; + $scope.boardservice.sorted = $filter('cardFilter')($scope.boardservice.sorted, filter); + } else if ($scope.status.filter === 'shared') { + $scope.boardservice.sorted = $filter('cardFilter')($scope.boardservice.sorted, {archived: false}); + $scope.boardservice.sorted = $filter('boardFilterAcl')($scope.boardservice.sorted); + } else { + $scope.boardservice.sorted = $filter('cardFilter')($scope.boardservice.sorted, {archived: false}); + } $scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title'); }; + $scope.$state = $stateParams; + $scope.$watch('$state.filter', function (name) { + $scope.status.filter = name; + $scope.filterData(); + }); + $scope.selectColor = function(color) { $scope.newBoard.color = color; }; @@ -72,11 +92,24 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ board.status.edit = false; }; + $scope.boardArchive = function (board) { + board.archived = true; + BoardService.update(board).then(function(data) { + $scope.filterData(); + }); + }; + + $scope.boardUnarchive = function (board) { + board.archived = false; + BoardService.update(board).then(function(data) { + $scope.filterData(); + }); + }; + $scope.boardDelete = function(board) { var boardId = board.id; $scope.status.deleteUndo[boardId] = 10; $scope.boardDeleteCountdown = function () { - console.log($scope.status); if($scope.status.deleteUndo[boardId] > 0) { $scope.status.deleteUndo[boardId]--; $timeout($scope.boardDeleteCountdown, 1000); diff --git a/js/filters/boardFilterAcl.js b/js/filters/boardFilterAcl.js new file mode 100644 index 000000000..ef023823f --- /dev/null +++ b/js/filters/boardFilterAcl.js @@ -0,0 +1,33 @@ +/* + * @copyright Copyright (c) 2017 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +app.filter('boardFilterAcl', function() { + return function(boards) { + var _result = []; + angular.forEach(boards, function(board){ + if(board.acl !== null && Object.keys(board.acl).length > 0) { + _result.push(board); + } + }); + return _result; + }; +}); \ No newline at end of file diff --git a/js/filters/cardFilter.js b/js/filters/cardFilter.js index c0f1657fb..0f50b7eed 100644 --- a/js/filters/cardFilter.js +++ b/js/filters/cardFilter.js @@ -24,15 +24,16 @@ app.filter('cardFilter', function() { return function(cards, rules) { - var _result = {}; + var _result = []; angular.forEach(cards, function(card){ var _card = card; - angular.some(rules, function(rule, condition) { - if(_card[rule]===condition) { + var keys = Object.keys(rules); + keys.some(function(key, condition) { + if(_card[key]===rules[key]) { _result.push(_card); } }); }); - return result; + return _result; }; }); \ No newline at end of file diff --git a/js/filters/textColorFilter.js b/js/filters/textColorFilter.js index 75b76827c..caaf53ae2 100644 --- a/js/filters/textColorFilter.js +++ b/js/filters/textColorFilter.js @@ -24,7 +24,7 @@ app.filter('textColorFilter', function() { return function (hex) { // RGB2HLS by Garry Tan // http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c - var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex); + var result = /^#?([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex); var color = result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), diff --git a/js/service/BoardService.js b/js/service/BoardService.js index b359b1730..8584c6310 100644 --- a/js/service/BoardService.js +++ b/js/service/BoardService.js @@ -190,6 +190,13 @@ app.factory('BoardService', function(ApiService, $http, $q){ return this.getCurrent().permissions['PERMISSION_SHARE']; } + BoardService.prototype.isArchived = function () { + if(!this.getCurrent() || this.getCurrent().archived) { + return true; + } + return false; + }; + service = new BoardService($http, 'boards', $q); return service; diff --git a/lib/CardArchivedException.php b/lib/ArchivedItemException.php similarity index 88% rename from lib/CardArchivedException.php rename to lib/ArchivedItemException.php index 4586f7813..352c9452f 100644 --- a/lib/CardArchivedException.php +++ b/lib/ArchivedItemException.php @@ -23,12 +23,12 @@ namespace OCA\Deck; -class CardArchivedException extends \Exception { +class ArchivedItemException extends \Exception { /** * Constructor * @param string $msg the error message */ - public function __construct($msg = "") { + public function __construct($msg = "Operation not allowed. Item is archived.") { parent::__construct($msg); } } \ No newline at end of file diff --git a/lib/Controller/BoardController.php b/lib/Controller/BoardController.php index 3a8df7c23..52c9641df 100644 --- a/lib/Controller/BoardController.php +++ b/lib/Controller/BoardController.php @@ -96,8 +96,8 @@ class BoardController extends Controller { * @param $color * @return \OCP\AppFramework\Db\Entity */ - public function update($id, $title, $color) { - return $this->boardService->update($id, $title, $color); + public function update($id, $title, $color, $archived) { + return $this->boardService->update($id, $title, $color, $archived); } /** diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index 5a8af4f88..4becadc61 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -23,9 +23,12 @@ namespace OCA\Deck\Service; +use OCA\Deck\ArchivedItemException; use OCA\Deck\Db\Acl; use OCA\Deck\Db\AclMapper; +use OCA\Deck\Db\IPermissionMapper; use OCA\Deck\Db\Label; +use OCP\AppFramework\Db\DoesNotExistException; use OCP\IL10N; use OCA\Deck\Db\Board; use OCA\Deck\Db\BoardMapper; @@ -80,6 +83,23 @@ class BoardService { return $board; } + public function isArchived($mapper, $id) { + try { + if ($mapper instanceof IPermissionMapper) { + $boardId = $mapper->findBoardId($id); + } else { + $boardId = $id; + } + if ($boardId === null) { + return false; + } + } catch (DoesNotExistException $exception) { + return false; + } + $board = $this->find($boardId); + return $board->getArchived(); + } + public function create($title, $userId, $color) { @@ -115,11 +135,12 @@ class BoardService { return $this->boardMapper->delete($this->find($id)); } - public function update($id, $title, $color) { + public function update($id, $title, $color, $archived) { $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_MANAGE); $board = $this->find($id); $board->setTitle($title); $board->setColor($color); + $board->setArchived($archived); $this->boardMapper->mapOwner($board); return $this->boardMapper->update($board); } diff --git a/lib/Service/CardService.php b/lib/Service/CardService.php index 7fd7a6b36..4e2a4a9d2 100644 --- a/lib/Service/CardService.php +++ b/lib/Service/CardService.php @@ -26,18 +26,22 @@ namespace OCA\Deck\Service; use OCA\Deck\Db\Card; use OCA\Deck\Db\CardMapper; use OCA\Deck\Db\Acl; -use OCA\Deck\CardArchivedException; use OCA\Deck\Db\StackMapper; +use OCA\Deck\StatusException; class CardService { private $cardMapper; + private $stackMapper; + private $permissionService; + private $boardService; - public function __construct(CardMapper $cardMapper, StackMapper $stackMapper, PermissionService $permissionService) { + public function __construct(CardMapper $cardMapper, StackMapper $stackMapper, PermissionService $permissionService, BoardService $boardService) { $this->cardMapper = $cardMapper; $this->stackMapper = $stackMapper; $this->permissionService = $permissionService; + $this->boardService = $boardService; } public function find($cardId) { @@ -51,6 +55,9 @@ class CardService { */ public function create($title, $stackId, $type, $order, $owner) { $this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->stackMapper, $stackId)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = new Card(); $card->setTitle($title); $card->setStackId($stackId); @@ -63,14 +70,20 @@ class CardService { public function delete($id) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } return $this->cardMapper->delete($this->cardMapper->find($id)); } public function update($id, $title, $stackId, $type, $order, $description, $owner) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($id); if ($card->getArchived()) { - throw new CardArchivedException(); + throw new StatusException('Operation not allowed. This card is archived.'); } $card->setTitle($title); $card->setStackId($stackId); @@ -83,9 +96,12 @@ class CardService { public function rename($id, $title) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($id); if ($card->getArchived()) { - throw new CardArchivedException(); + throw new StatusException('Operation not allowed. This card is archived.'); } $card->setTitle($title); return $this->cardMapper->update($card); @@ -93,12 +109,15 @@ class CardService { public function reorder($id, $stackId, $order) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $cards = $this->cardMapper->findAll($stackId); $result = []; $i = 0; foreach ($cards as $card) { if ($card->getArchived()) { - throw new CardArchivedException(); + throw new StatusException('Operation not allowed. This card is archived.'); } if ($card->id === $id) { $card->setOrder($order); @@ -121,6 +140,9 @@ class CardService { public function archive($id) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($id); $card->setArchived(true); return $this->cardMapper->update($card); @@ -128,6 +150,9 @@ class CardService { public function unarchive($id) { $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($id); $card->setArchived(false); return $this->cardMapper->update($card); @@ -135,18 +160,24 @@ class CardService { public function assignLabel($cardId, $labelId) { $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $cardId)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($cardId); if ($card->getArchived()) { - throw new CardArchivedException(); + throw new StatusException('Operation not allowed. This card is archived.'); } $this->cardMapper->assignLabel($cardId, $labelId); } public function removeLabel($cardId, $labelId) { $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); + if($this->boardService->isArchived($this->cardMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $card = $this->cardMapper->find($cardId); if ($card->getArchived()) { - throw new CardArchivedException(); + throw new StatusException('Operation not allowed. This card is archived.'); } $this->cardMapper->removeLabel($cardId, $labelId); } diff --git a/lib/Service/LabelService.php b/lib/Service/LabelService.php index e1538adff..5562a60ca 100644 --- a/lib/Service/LabelService.php +++ b/lib/Service/LabelService.php @@ -26,15 +26,22 @@ namespace OCA\Deck\Service; use OCA\Deck\Db\Label; use OCA\Deck\Db\Acl; use OCA\Deck\Db\LabelMapper; +use OCA\Deck\StatusException; class LabelService { + /** @var LabelMapper */ private $labelMapper; + /** @var PermissionService */ + private $permissionService; + /** @var BoardService */ + private $boardService; - public function __construct(LabelMapper $labelMapper, PermissionService $permissionService) { + public function __construct(LabelMapper $labelMapper, PermissionService $permissionService, BoardService $boardService) { $this->labelMapper = $labelMapper; $this->permissionService = $permissionService; + $this->boardService = $boardService; } public function find($labelId) { @@ -44,6 +51,9 @@ class LabelService { public function create($title, $color, $boardId) { $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); + if($this->boardService->isArchived(null, $boardId)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $label = new Label(); $label->setTitle($title); $label->setColor($color); @@ -53,11 +63,17 @@ class LabelService { public function delete($id) { $this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE); + if($this->boardService->isArchived($this->labelMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } return $this->labelMapper->delete($this->find($id)); } public function update($id, $title, $color) { $this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE); + if($this->boardService->isArchived($this->labelMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $label = $this->find($id); $label->setTitle($title); $label->setColor($color); diff --git a/lib/Service/StackService.php b/lib/Service/StackService.php index 7c94ee3ce..18cb95cbb 100644 --- a/lib/Service/StackService.php +++ b/lib/Service/StackService.php @@ -31,6 +31,7 @@ use OCA\Deck\Db\LabelMapper; use OCA\Deck\Db\Stack; use OCA\Deck\Db\StackMapper; +use OCA\Deck\StatusException; class StackService { @@ -39,12 +40,14 @@ class StackService { private $cardMapper; private $labelMapper; private $permissionService; + private $boardService; - public function __construct(StackMapper $stackMapper, CardMapper $cardMapper, LabelMapper $labelMapper, PermissionService $permissionService) { + public function __construct(StackMapper $stackMapper, CardMapper $cardMapper, LabelMapper $labelMapper, PermissionService $permissionService, BoardService $boardService) { $this->stackMapper = $stackMapper; $this->cardMapper = $cardMapper; $this->labelMapper = $labelMapper; $this->permissionService = $permissionService; + $this->boardService = $boardService; } public function findAll($boardId) { @@ -81,6 +84,9 @@ class StackService { public function create($title, $boardId, $order) { $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); + if($this->boardService->isArchived(null, $boardId)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $stack = new Stack(); $stack->setTitle($title); $stack->setBoardId($boardId); @@ -96,6 +102,9 @@ class StackService { public function update($id, $title, $boardId, $order) { $this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_MANAGE); + if($this->boardService->isArchived($this->stackMapper, $id)) { + throw new StatusException('Operation not allowed. This board is archived.'); + } $stack = $this->stackMapper->find($id); $stack->setTitle($title); $stack->setBoardId($boardId); diff --git a/templates/main.php b/templates/main.php index a22fe8132..ed014caba 100644 --- a/templates/main.php +++ b/templates/main.php @@ -45,7 +45,7 @@ if(!\OC::$server->getConfig()->getSystemValue('debug', false)) { 'app' => ['App', 'Config', 'Run'], 'controller' => ['AppController', 'BoardController', 'CardController', 'ListController'], 'directive' => ['appnavigationentryutils', 'appPopoverMenuUtils', 'autofocusoninsert', 'avatar', 'elastic', 'search'], - 'filters' => ['cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'relativeDateFilter', 'textColorFilter'], + 'filters' => ['boardFilterAcl', 'cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'relativeDateFilter', 'textColorFilter'], 'service' => ['ApiService', 'BoardService', 'CardService', 'LabelService', 'StackService', 'StatusService'], ]; foreach($js as $folder=>$files) { @@ -58,7 +58,7 @@ if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
-
+
inc('part.navigation')); ?> inc('part.settings')); */ ?>
diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index 92875a26b..e4f400885 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -70,40 +70,37 @@
-
+
- -
+
diff --git a/templates/part.boardlist.php b/templates/part.boardlist.php index 1d6940f97..6597c6e1a 100644 --- a/templates/part.boardlist.php +++ b/templates/part.boardlist.php @@ -5,31 +5,61 @@ t('Title')); ?> t('Members')); ?> + - - + + - {{ b.title }} + {{ b.title }}
- - - + + + + + + t('Create new board')); ?> -
+ + + + + -
+ ng-class="{'selected': (c == newBoard.color), 'dark': (newBoard.color | textColorFilter) === '#ffffff' }">
- + + diff --git a/templates/part.card.php b/templates/part.card.php index 9257f8efe..c423a6859 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -31,6 +31,7 @@
-
  • t('All Boards')); ?>
  • +
  • t('All Boards')); ?>
  • +
  • t('Archived boards')); ?>
  • +
  • t('Shared boards')); ?>
  • -
  • +
  • {{ b.title }}
    @@ -16,7 +18,7 @@
    • -
    • +
    diff --git a/tests/unit/ExceptionsTest.php b/tests/unit/ExceptionsTest.php index 75d2dc1fa..732e31ca6 100644 --- a/tests/unit/ExceptionsTest.php +++ b/tests/unit/ExceptionsTest.php @@ -23,7 +23,7 @@ namespace OCA\Deck\Db; -use OCA\Deck\CardArchivedException; +use OCA\Deck\ArchivedItemException; use OCA\Deck\Controller\PageController; use OCA\Deck\NoPermissionException; use OCA\Deck\NotFoundException; @@ -45,7 +45,7 @@ class ExceptionsTest extends \PHPUnit_Framework_TestCase { } public function testCardArchivedException() { - $e = new CardArchivedException('foo'); + $e = new ArchivedItemException('foo'); $this->assertEquals('foo', $e->getMessage()); } diff --git a/tests/unit/Service/CardServiceTest.php b/tests/unit/Service/CardServiceTest.php index f0f49d8c1..31fe4b1a6 100644 --- a/tests/unit/Service/CardServiceTest.php +++ b/tests/unit/Service/CardServiceTest.php @@ -27,7 +27,7 @@ namespace OCA\Deck\Service; use OCA\Deck\Db\Card; use OCA\Deck\Db\CardMapper; use OCA\Deck\Db\StackMapper; -use OCA\Deck\CardArchivedException; +use OCA\Deck\ArchivedItemException; class CardServiceTest extends \PHPUnit_Framework_TestCase { @@ -108,7 +108,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('update'); - $this->setExpectedException(CardArchivedException::class); + $this->setExpectedException(ArchivedItemException::class); $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin'); } @@ -128,7 +128,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('update'); - $this->setExpectedException(CardArchivedException::class); + $this->setExpectedException(ArchivedItemException::class); $this->cardService->rename(123, 'newtitle'); } @@ -168,7 +168,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('findAll')->willReturn([$card]); $this->cardMapper->expects($this->never())->method('update')->willReturnCallback(function($c) { return $c; }); - $this->setExpectedException(CardArchivedException::class); + $this->setExpectedException(ArchivedItemException::class); $actual = $this->cardService->reorder(123, 234, 1); } public function testArchive() { @@ -204,7 +204,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('assignLabel'); - $this->setExpectedException(CardArchivedException::class); + $this->setExpectedException(ArchivedItemException::class); $this->cardService->assignLabel(123, 999); } @@ -221,7 +221,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('removeLabel'); - $this->setExpectedException(CardArchivedException::class); + $this->setExpectedException(ArchivedItemException::class); $this->cardService->removeLabel(123, 999); }