Fixed, expanded category implementations. Started chart work.
Added FilteredCategory, filters by arbitrary CategoryFilters. Started on Util class with code to create charts based on categories. Fixed ITHelp ticket matching to swallow optional space after "ITHelp:" Fixed TicketCategory to use it's own addEvent logic instead of inheriting the default Category implementation. Updated startscript.groovy to reflect test data for recent changes.
This commit is contained in:
@ -6,7 +6,7 @@ import com.jdbernard.timeanalyzer.Event
|
||||
|
||||
public class ITHelpCategory extends Category {
|
||||
|
||||
private def ithelpPattern = ~/^ITHelp:(.*)$/
|
||||
private def ithelpPattern = ~/^ITHelp:\s*(.*)$/
|
||||
private def ticketPattern = ~/^ITHelp:.*#(\d+).*/
|
||||
|
||||
public boolean matchesEvent(Event e) {
|
||||
|
@ -17,4 +17,9 @@ public class TicketCategory extends Category {
|
||||
return (e.description ==~ /ITHelp:.*#${ticketId}.*/)
|
||||
}
|
||||
|
||||
public TicketEntry addEvent(Event e) {
|
||||
TicketEntry te = new TicketEntry(this, e)
|
||||
entries << te
|
||||
return te
|
||||
}
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ public class TicketEntry extends Entry {
|
||||
|
||||
public int id
|
||||
|
||||
public TicketEntry(ITHelpCategory category, Event e) {
|
||||
public TicketEntry(TicketCategory category, Event e) {
|
||||
super(category, e)
|
||||
|
||||
def m = e.description =~ /^ITHelp:(.*#(\d+).*)$/
|
||||
def m = e.description =~ /^ITHelp:\s*(.*#(\d+).*)$/
|
||||
this.description = m[0][1]
|
||||
this.id = m[0][2] as int
|
||||
}
|
||||
|
Reference in New Issue
Block a user