aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_excerpt.go29
-rw-r--r--cache/query.go4
-rw-r--r--cache/query_test.go3
3 files changed, 13 insertions, 23 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index eae90f5a..86424a0a 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -23,16 +23,11 @@ type BugExcerpt struct {
CreateUnixTime int64
EditUnixTime int64
- Title string
- Status bug.Status
- NoOfComments int
- Labels []bug.Label
-
- // If author is identity.Bare, LegacyAuthor is set
- // If author is identity.Identity, AuthorId is set and data is deported
- // in a IdentityExcerpt
- LegacyAuthor LegacyAuthorExcerpt
- AuthorId string
+ Title string
+ Status bug.Status
+ Author identity.Interface
+ LenComments int
+ Labels []bug.Label
CreateMetadata map[string]string
}
@@ -53,22 +48,10 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt {
Title: snap.Title,
Status: snap.Status,
Labels: snap.Labels,
- NoOfComments: len(snap.Comments),
+ LenComments: len(snap.Comments),
CreateMetadata: b.FirstOp().AllMetadata(),
}
- switch snap.Author.(type) {
- case *identity.Identity:
- e.AuthorId = snap.Author.Id()
- case *identity.Bare:
- e.LegacyAuthor = LegacyAuthorExcerpt{
- Login: snap.Author.Login(),
- Name: snap.Author.Name(),
- }
- default:
- panic("unhandled identity type")
- }
-
return e
}
diff --git a/cache/query.go b/cache/query.go
index 6ffa6510..39815d32 100644
--- a/cache/query.go
+++ b/cache/query.go
@@ -60,6 +60,10 @@ func ParseQuery(query string) (*Query, error) {
f := LabelFilter(qualifierQuery)
result.Label = append(result.Label, f)
+ case "title":
+ f := TitleFilter(qualifierQuery)
+ result.Label = append(result.Title, f)
+
case "no":
err := result.parseNoFilter(qualifierQuery)
if err != nil {
diff --git a/cache/query_test.go b/cache/query_test.go
index 29d2f585..2d7ee8e1 100644
--- a/cache/query_test.go
+++ b/cache/query_test.go
@@ -22,6 +22,9 @@ func TestQueryParse(t *testing.T) {
{"label:hello", true},
{`label:"Good first issue"`, true},
+ {"title:Bug titleOne", true},
+ {`title:"Bug titleTwo"`, true},
+
{"sort:edit", true},
{"sort:unknown", false},
}