Opened 13 years ago
Last modified 13 years ago
#9442 new enhancement
Don't show tickets with "negative" resolutions in the chart
Reported by: | Ryan J Ollos | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | falkb | Trac Release: | 0.11 |
Description
We use the Gantt chart to display all tickets associated with a milestone and it would be nice to have tickets with any "negative" resolution hidden by default (e.g. duplicate, invalid, ...). I guess this probably needs to be made an option.
Attachments (0)
Change History (15)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Change can be found on the BitBucket clone now: https://bitbucket.org/rjollos/tracjsganttplugin/changeset/0501ea75f7b7
comment:3 Changed 13 years ago by
The initial patch was not working the way I thought it would. However, the following does work, and I'd clean it up a bit before committing a real patch.
-
0.11/tracjsgantt/tracjsgantt.py
380 380 # Construct the querystring. 381 381 query_string = '&'.join(['%s=%s' % 382 382 item for item in query_args.iteritems()]) 383 383 384 # Only show tickets with resolution None or Closed 385 hide_resolutions = ['duplicate', 'invalid', 'wontfix', 'worksforme'] 386 query_string = query_string + '&resolution!=' + '|'.join(hide_resolutions) 387 384 388 # Get the Query Object. 385 389 query = Query.from_string(self.env, query_string) 386 390
comment:5 follow-up: 6 Changed 13 years ago by
You'd really want to provide these through config options... Just because these resolutions are created as default Trac data there is no guarantee that any of them will exist in installations - or that they are the only resolutions to consider. None of them carry any special meaning in Trac, and may be changed or localized by admins any time.
comment:6 Changed 13 years ago by
Replying to osimons:
You'd really want to provide these through config options...
Thanks, I will definitely do that for the final patch. I was just hacking around here to see what would work.
It seems like we'd probably want to provide the default behavior for an install through the config option, and also allow a macro parameter that can be used to override the default when calling the macro.
Btw, I was hoping to find some time in the near future to copy the example you provided for the TagsPlugin and get some unit tests running for this plugin. I feel somewhat guilty departing from my good coding habits when I leave my real job in C++/matlab to hack on Trac in Python, both of which I know very little about.
comment:7 follow-up: 8 Changed 13 years ago by
I see the utility of this feature. I've actually been bothered by cancelled tickets cluttering my charts before. I think it needs two thingss:
- A way to configure negative resolutions
- A chart option to heed or ignore that configuration (maybe showCancelled which defaults to false).
comment:8 follow-up: 9 Changed 13 years ago by
Replying to ChrisNelson:
- A way to configure negative resolutions
I'd like it if it was a string with a common ticket query, for example "status=!duplicate&myowncustomticketfield=certainvalue". This would allow maximum configurability, especially concerning custom fields.
comment:9 follow-up: 10 Changed 13 years ago by
Replying to falkb:
Replying to ChrisNelson:
- A way to configure negative resolutions
I'd like it if it was a string with a common ticket query, for example "status=!duplicate&myowncustomticketfield=certainvalue". This would allow maximum configurability, especially concerning custom fields.
Doesn't that work now? I admit my understanding of the query engine is a little weak but if you can do [[TicketQuery(status=!duplicate&myowncustomticketfield=certainvalue)]]
, then you can do the same with the Gantt; anything without a special Gantt-specific meaning, just gets passed on.
comment:10 follow-ups: 11 12 Changed 13 years ago by
Replying to ChrisNelson:
Doesn't that work now? I admit my understanding of the query engine is a little weak but if you can do
[[TicketQuery(status=!duplicate&myowncustomticketfield=certainvalue)]]
, then you can do the same with the Gantt; anything without a special Gantt-specific meaning, just gets passed on.
Not sure what you mean.
But it sounds like invalid|wontfix|worksforme)? is the solution to close this ticket 9442 as 'worksforme', doesn't it?
comment:11 Changed 13 years ago by
Oops... I mean [[TracJSGanttChart(milestone=Foo,userMap=0,format=week,resolution!=duplicate|invalid|wontfix|worksforme)]]
comment:12 follow-ups: 13 14 Changed 13 years ago by
Replying to falkb:
Replying to ChrisNelson:
Doesn't that work now? I admit my understanding of the query engine is a little weak but if you can do
[[TicketQuery(status=!duplicate&myowncustomticketfield=certainvalue)]]
, then you can do the same with the Gantt; anything without a special Gantt-specific meaning, just gets passed on.Not sure what you mean.
But it sounds like invalid|wontfix|worksforme)? is the solution to close this ticket 9442 as 'worksforme', doesn't it?
That should work but you have to do that in every chart instance. If there were a chart option, you could configure a site default that did it for you. I think it's useful enough that I'll incorporate a patch if Ryan comes up with one but not so useful that I'm going to find time to do it myself.
comment:13 Changed 13 years ago by
Replying to ChrisNelson:
I think it's useful enough that I'll incorporate a patch if Ryan comes up with one but not so useful that I'm going to find time to do it myself.
I'll be providing a patch for this in the near future.
comment:14 Changed 13 years ago by
Replying to ChrisNelson:
That should work but you have to do that in every chart instance. If there were a chart option, you could configure a site default that did it for you.
I see - you mean a trac.ini setting. Then, I suggest this for maximum configurability:
[trac-jsgantt] ticket_filter_condition = resolution!=duplicate|invalid|wontfix|worksforme
comment:15 Changed 13 years ago by
it means one can set any useful additional query condition that will be added to the internal query_string
Here is a quick patch that implements the behavior I would like to have on my Trac install. I could do the additional work of implementing an option for controlling the behavior, if you are interested in integrating this into the mainline.
What makes the most sense to me is to specify a list of resolutions that won't be shown in the chart, e.g.
hide_resolutions=invalid|duplicate
, and have the default value beinvalid|duplicate|worksforme|wontfix
(i.e the "negative" resolutions for a default Trac install).0.11/tracjsgantt/tracjsgantt.py