Search for boards and worklists
Filters boards and worklists based on the titles of their stories and tasks. Change-Id: I30969a1720bf2e24c87349bb5d8e6ae839d75c5e
This commit is contained in:
parent
5b17e47f0c
commit
cba8e4f465
@ -34,7 +34,7 @@ angular.module('sb.search').controller('SearchController',
|
||||
* @type {string[]}
|
||||
*/
|
||||
$scope.resourceTypes = ['TaskStatus', 'Story', 'Project', 'User',
|
||||
'Task', 'ProjectGroup'];
|
||||
'Task', 'ProjectGroup', 'Board', 'Worklist'];
|
||||
|
||||
/**
|
||||
* If a 'q' exists in the state params, go ahead and add it.
|
||||
|
15
src/app/search/template/board_search_item.html
Normal file
15
src/app/search/template/board_search_item.html
Normal file
@ -0,0 +1,15 @@
|
||||
<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}}
|
||||
|
||||
</small>
|
||||
</td>
|
@ -78,6 +78,20 @@
|
||||
×
|
||||
</a>
|
||||
</div>
|
||||
<div class="tag tag-info" ng-switch-when="Board">
|
||||
<i class="fa fa-sb-task"></i> {{tag.title}}
|
||||
<a class="tag-remove"
|
||||
ng-click="removeTag({tag:tag})">
|
||||
×
|
||||
</a>
|
||||
</div>
|
||||
<div class="tag tag-info" ng-switch-when="Worklist">
|
||||
<i class="fa fa-sb-task"></i> {{tag.title}}
|
||||
<a class="tag-remove"
|
||||
ng-click="removeTag({tag:tag})">
|
||||
×
|
||||
</a>
|
||||
</div>
|
||||
<div class="tag tag-danger" ng-switch-default>
|
||||
<i class="fa fa-question"></i> {{tag.type}}: {{tag.value}}
|
||||
<a class="tag-remove"
|
||||
|
@ -282,5 +282,95 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"
|
||||
ng-if="criteria.length > 0"
|
||||
search-results
|
||||
search-resource="Board"
|
||||
search-criteria="criteria">
|
||||
<div class="col-xs-12" ng-if="hasValidCriteria">
|
||||
<hr/>
|
||||
</div>
|
||||
<div class="col-xs-2 text-center text-muted" ng-if="hasValidCriteria">
|
||||
<span class="hidden-xs">
|
||||
<i class="fa fa-3x fa-sb-task"></i>
|
||||
<br/>
|
||||
<small>Boards</small>
|
||||
</span>
|
||||
<i class="fa fa-2x fa-sb-task visible-xs"></i>
|
||||
</div>
|
||||
<div class="col-xs-10" ng-if="hasValidCriteria">
|
||||
<table class="table table-condensed table-striped table-clean">
|
||||
<tbody ng-if="searchResults.length != 0">
|
||||
<tr ng-repeat="board in searchResults"
|
||||
ng-include="'app/search/template/board_search_item.html'">
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="hasValidCriteria && searchResults.length == 0 && !isSearching">
|
||||
<td class="text-center text-muted">
|
||||
<em>No boards found.</em>
|
||||
</td>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="!hasValidCriteria">
|
||||
<td class="text-center text-muted">
|
||||
<em>Your search criteria are not valid for this item.</em>
|
||||
</td>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="isSearching">
|
||||
<td colspan="2">
|
||||
<small class="fa fa-spin fa-refresh text-muted">
|
||||
</small>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"
|
||||
ng-if="criteria.length > 0"
|
||||
search-results
|
||||
search-resource="Worklist"
|
||||
search-criteria="criteria">
|
||||
<div class="col-xs-12" ng-if="hasValidCriteria">
|
||||
<hr/>
|
||||
</div>
|
||||
<div class="col-xs-2 text-center text-muted" ng-if="hasValidCriteria">
|
||||
<span class="hidden-xs">
|
||||
<i class="fa fa-3x fa-sb-task"></i>
|
||||
<br/>
|
||||
<small>Worklists</small>
|
||||
</span>
|
||||
<i class="fa fa-2x fa-sb-task visible-xs"></i>
|
||||
</div>
|
||||
<div class="col-xs-10" ng-if="hasValidCriteria">
|
||||
<table class="table table-condensed table-striped table-clean">
|
||||
<tbody ng-if="searchResults.length != 0">
|
||||
<tr ng-repeat="worklist in searchResults"
|
||||
ng-include="'app/search/template/worklist_search_item.html'">
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="hasValidCriteria && searchResults.length == 0 && !isSearching">
|
||||
<td class="text-center text-muted">
|
||||
<em>No worklists found.</em>
|
||||
</td>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="!hasValidCriteria">
|
||||
<td class="text-center text-muted">
|
||||
<em>Your search criteria are not valid for this item.</em>
|
||||
</td>
|
||||
</tbody>
|
||||
|
||||
<tbody ng-if="isSearching">
|
||||
<td colspan="2">
|
||||
<small class="fa fa-spin fa-refresh text-muted">
|
||||
</small>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
|
@ -36,6 +36,12 @@
|
||||
<span ng-switch-when="Task">
|
||||
<i class="fa fa-tasks text-muted"></i> {{match.model.title}}
|
||||
</span>
|
||||
<span ng-switch-when="Board">
|
||||
<i class="fa fa-tasks text-muted"></i> {{match.model.title}}
|
||||
</span>
|
||||
<span ng-switch-when="Worklist">
|
||||
<i class="fa fa-tasks text-muted"></i> {{match.model.title}}
|
||||
</span>
|
||||
<span ng-switch-default>
|
||||
<i class="fa fa-question text-muted"></i> {{match.model.type}}
|
||||
</span>
|
||||
|
18
src/app/search/template/worklist_search_item.html
Normal file
18
src/app/search/template/worklist_search_item.html
Normal file
@ -0,0 +1,18 @@
|
||||
<td>
|
||||
<subscribe class="pull-right"
|
||||
resource="worklist"
|
||||
resource-id="worklist.id"
|
||||
subscriptions="worklistSubscriptions">
|
||||
</subscribe>
|
||||
<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>
|
@ -57,7 +57,8 @@ angular.module('sb.services').factory('Board',
|
||||
'title',
|
||||
{
|
||||
Text: 'title',
|
||||
Project: 'project_id',
|
||||
Story: 'story_id',
|
||||
Task: 'task_id',
|
||||
User: 'creator_id'
|
||||
}
|
||||
);
|
||||
|
@ -109,7 +109,8 @@ angular.module('sb.services').factory('Worklist',
|
||||
'title',
|
||||
{
|
||||
Text: 'title',
|
||||
Project: 'project_id',
|
||||
Story: 'story_id',
|
||||
Task: 'task_id',
|
||||
User: 'creator_id'
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user