'All Boards and Worklists' Page

This is a page to view all boards/worklists.

Currently, a user can only find a board/worklist for which they are
explicitly listed as an owner or user, or for which they know the url.
This makes it hard for users to know that the feature exists, or to
see or demo examples.

Hopefully, the 'move search icon' patch can be merged soon after this,
to stop the sidebar from getting too full of icons.

Change-Id: I12def9cb762e8270ce918ee1da961347836b3576
This commit is contained in:
Zara 2016-02-12 18:05:27 +00:00
parent 5b17e47f0c
commit d0a22e1b22
4 changed files with 205 additions and 0 deletions

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 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
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* A controller that manages a view of all worklists and boards.
*/
angular.module('sb.board').controller('BoardsListController',
function ($scope) {
'use strict';
$scope.boardResourceTypes = ['Board'];
$scope.worklistResourceTypes = ['Worklist'];
});

View File

@ -37,5 +37,10 @@ angular.module('sb.board', ['ui.router', 'sb.services', 'sb.util',
url: '/{boardID:[0-9]+}',
controller: 'BoardDetailController',
templateUrl: 'app/boards/template/detail.html'
})
.state('sb.board.list', {
url: '/list',
controller: 'BoardsListController',
templateUrl: 'app/boards/template/list.html'
});
});

View File

@ -0,0 +1,166 @@
<!--
~ Copyright (c) 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
~ a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<h1 view-title>Worklists and Boards</h1>
</div>
</div>
<div class="row">
<div class="col-sm-6"
ng-controller="SearchCriteriaController"
ng-init="init(worklistResourceTypes, defaultCriteria)"
search-results
search-resource="Worklist"
search-criteria="criteria"
search-without-criteria="true">
<table class="table table-striped">
<thead>
<th colspan="2">Worklists</th>
</thead>
<tbody>
<tr ng-repeat="worklist in searchResults">
<td>
<p>
<a href="#!/worklist/{{worklist.id}}">
{{worklist.title}}
</a>
</p>
<small>
<span class="badge"
ng-class="{'badge-primary': worklist.items.length > 0}">
{{worklist.items.length}}
</span> Items
</small>
</td>
</tr>
<div class="form-group has-feedback has-feedback-no-label">
<div id="search-criteria"
tag-complete="criteria as criteria.title for criteria in searchForCriteria($viewValue)"
tag-complete-tags="criteria"
tag-complete-label-field="title"
tag-complete-option-template-url="'app/search/template/typeahead_criteria_item.html'"
tag-complete-tag-template-url="'app/search/template/criteria_tag_item.html'"
tag-complete-loading="loadingCriteria = isLoading"
tag-complete-on-select="addCriteria(tag)"
placeholder="Search Worklists">
</div>
<span class="form-control-feedback text-muted">
<i class="fa fa-search"
ng-hide="loadingCriteria"></i>
<i class="fa fa-refresh fa-spin"
ng-show="loadingCriteria"></i>
</span>
<result-set-pager
class="form-control-static text-muted pull-right"
total="searchTotal"
offset="searchOffset"
limit="searchLimit"
on-next-page="nextPage()"
on-previous-page="previousPage()"
on-page-size="updatePageSize(pageSize)"
></result-set-pager>
</div>
</tbody>
<tbody ng-show="searchResults.length == 0">
<td colspan="3" class="text-center text-muted">
<em>
No worklists found.
</em>
</td>
</tbody>
<tbody ng-show="isSearching">
<td colspan="3" class="text-center">
<i class="fa fa-refresh fa-spin fa-lg"></i>
</td>
</tbody>
</table>
</div>
<div class="col-sm-6"
ng-controller="SearchCriteriaController"
ng-init="init(boardResourceTypes, defaultCriteria)"
search-results
search-resource="Board"
search-criteria="criteria"
search-without-criteria="true">
<table class="table table-striped">
<thead>
<th colspan="2">Boards</th>
</thead>
<tbody>
<tr ng-repeat="board in searchResults">
<td>
<p>
<a href="#!/board/{{board.id}}">
{{board.title}}
</a>
</p>
<small ng-repeat="lane in board.lanes"
ng-if="!lane.worklist.archived">
<span class="badge"
ng-class="{'badge-primary': lane.worklist.items.length > 0}">
{{lane.worklist.items.length}}
</span> {{lane.worklist.title}}
&nbsp;
</small>
</td>
</tr>
<div class="form-group has-feedback has-feedback-no-label">
<div id="search-criteria"
tag-complete="criteria as criteria.title for criteria in searchForCriteria($viewValue)"
tag-complete-tags="criteria"
tag-complete-label-field="title"
tag-complete-option-template-url="'app/search/template/typeahead_criteria_item.html'"
tag-complete-tag-template-url="'app/search/template/criteria_tag_item.html'"
tag-complete-loading="loadingCriteria = isLoading"
tag-complete-on-select="addCriteria(tag)"
placeholder="Search Boards">
</div>
<span class="form-control-feedback text-muted">
<i class="fa fa-search"
ng-hide="loadingCriteria"></i>
<i class="fa fa-refresh fa-spin"
ng-show="loadingCriteria"></i>
</span>
<result-set-pager
class="form-control-static text-muted pull-right"
total="searchTotal"
offset="searchOffset"
limit="searchLimit"
on-next-page="nextPage()"
on-previous-page="previousPage()"
on-page-size="updatePageSize(pageSize)"
></result-set-pager>
</div>
</tbody>
<tbody ng-show="searchResults.length == 0">
<td colspan="3" class="text-center text-muted">
<em>
No boards found.
</em>
</td>
</tbody>
<tbody ng-show="isSearching">
<td colspan="3" class="text-center">
<i class="fa fa-refresh fa-spin fa-lg"></i>
</td>
</tbody>
</table>
</div>
</div>

View File

@ -42,6 +42,13 @@
<small class="visible-lg visible-md">About</small>
</a>
</li>
<li active-path="^\/board\/*">
<a href="#!/board/list">
<i class="fa fa-tasks fa-lg visible-sm visible-xs"></i>
<i class="fa fa-tasks fa-3x visible-lg visible-md"></i>
<small class="visible-lg visible-md">Worklists & Boards</small>
</a>
</li>
<li active-path="^\/project_group\/*">
<a href="#!/project_group">
<i class="fa fa-sb-project-group fa-lg visible-sm visible-xs"></i>