Index tags in search

Now a user can search for all stories that have a specified tag.

Change-Id: Ib420c1b7989022bc27fa3e931f13ee08ee1132c6
This commit is contained in:
Zara 2016-02-01 15:42:03 +00:00
parent 33a3c29db1
commit b5312f1f6b
4 changed files with 50 additions and 0 deletions
src/app

@ -22,6 +22,13 @@
×
</a>
</div>
<div class="tag tag-warning" ng-switch-when="Tags">
Tag: {{tag.title}}
<a class="tag-remove"
ng-click="removeTag({tag:tag})">
&times;
</a>
</div>
<div class="tag tag-success" ng-switch-when="User">
<i class="fa fa-user"></i> {{tag.title}}
<a class="tag-remove"

@ -4,6 +4,9 @@
<span ng-switch-when="Text">
<i class="fa fa-search text-muted"></i>&emsp;{{match.model.title}}
</span>
<span ng-switch-when="Tags">
<i class="fa fa-tag text-muted"></i>&emsp;{{match.model.title}}
</span>
<span ng-switch-when="Story">
<i class="fa fa-sb-story text-muted"></i>&emsp;{{match.model.value}}:
{{match.model.title}}

@ -0,0 +1,39 @@
/*
* Copyright (c) 2016 Codethink Ltd.
*
* 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.
*/
/**
* This criteria resolver may be injected by individual resources that accept a
* Tags search parameter.
*/
angular.module('sb.services').factory('Tags',
function (Criteria, $q) {
'use strict';
/**
* Return a Tags search parameter constructed from the passed search
* string.
*/
return {
criteriaResolver: function (searchString) {
var deferred = $q.defer();
deferred.resolve([Criteria.create('Tags', searchString)]);
return deferred.promise;
}
};
});

@ -57,6 +57,7 @@ angular.module('sb.services').factory('Story',
{
Text: 'q',
StoryStatus: 'status',
Tags: 'tags',
ProjectGroup: 'project_group_id',
Project: 'project_id',
User: 'assignee_id'