From f9c78c0ccc709509cdf7f83c45c898883d329db2 Mon Sep 17 00:00:00 2001 From: Paul Martin Date: Mon, 29 Sep 2014 22:10:20 +0100 Subject: Tickets - Priority, Severity options + Severity indicated via new character indicator and color of ticket icon on ticket list + Priority indicated via new priority icon and color on ticket list + Indexed as integers to provide sorting and maintain language neutral index + Colours and indicator text controlled through CSS classes priority- & severity- + UITicketTest created to generate tickets of all types to ease debugging --- src/main/java/com/gitblit/tickets/TicketIndexer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/gitblit/tickets/TicketIndexer.java') diff --git a/src/main/java/com/gitblit/tickets/TicketIndexer.java b/src/main/java/com/gitblit/tickets/TicketIndexer.java index 11ea3a73..e2d53af7 100644 --- a/src/main/java/com/gitblit/tickets/TicketIndexer.java +++ b/src/main/java/com/gitblit/tickets/TicketIndexer.java @@ -103,7 +103,10 @@ public class TicketIndexer { mergesha(Type.STRING), mergeto(Type.STRING), patchsets(Type.INT), - votes(Type.INT); + votes(Type.INT), + //NOTE: Indexing on the underlying value to allow flexibility on naming + priority(Type.INT), + severity(Type.INT); final Type fieldType; @@ -519,6 +522,8 @@ public class TicketIndexer { toDocField(doc, Lucene.watchedby, StringUtils.flattenStrings(ticket.getWatchers(), ";").toLowerCase()); toDocField(doc, Lucene.mentions, StringUtils.flattenStrings(ticket.getMentions(), ";").toLowerCase()); toDocField(doc, Lucene.votes, ticket.getVoters().size()); + toDocField(doc, Lucene.priority, ticket.priority.getValue()); + toDocField(doc, Lucene.severity, ticket.severity.getValue()); List attachments = new ArrayList(); for (Attachment attachment : ticket.getAttachments()) { @@ -600,6 +605,8 @@ public class TicketIndexer { result.participants = unpackStrings(doc, Lucene.participants); result.watchedby = unpackStrings(doc, Lucene.watchedby); result.mentions = unpackStrings(doc, Lucene.mentions); + result.priority = TicketModel.Priority.fromObject(unpackInt(doc, Lucene.priority), TicketModel.Priority.defaultPriority); + result.severity = TicketModel.Severity.fromObject(unpackInt(doc, Lucene.severity), TicketModel.Severity.defaultSeverity); if (!StringUtils.isEmpty(doc.get(Lucene.patchset.name()))) { // unpack most recent patchset -- cgit v1.2.3