Opened 13 years ago
Closed 13 years ago
#8961 closed enhancement (fixed)
[PATCH] improve option / default handling, introduce two more options
Reported by: | Patrick Schaaf | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: | 0.11 |
Description
This is an enhancement patch I just cooked up. It provides for the following:
- the builtin defaults for all macro arguments (except query arguments), can now
be changed in trac.ini, like this:
[trac-jsgantt] option.openLevel = 0
- all these options, when representing integer values, are type converted, whether
coming from trac.ini or macro instantiations. A suitable python conversion error
is shown, instead of just not displaying the JS at all (e.g.
res=xxx
now shows an error.) - a new option (trac.ini or macro argument) openClosedTickets, defaulting to 1, can be set to 0 to make parent tickets with status closed, initially show as collapsed, regardless of openLevel setting.
- a new option (trac.ini or macro argument) userMap, defaulting to 1,
can be set to 0 to avoid the conversion of login (ticket owner) names to
full / real names in the Resource display column.
Setting userMap=0 makes Resource show the login names.
In particular, not doing this conversion, avoids the internal call to self.env.get_known_users(), which could be pretty expensive when you have a huge list of users.
Attachments (1)
Change History (18)
comment:1 follow-up: 3 Changed 13 years ago by
Status: | new → assigned |
---|
comment:2 Changed 13 years ago by
Small respin of the patch, adding yet another option:
omitMilestones can be set to 1 to suppress the automatic addition of milestones found on the displayed tickets. Milestones explicitly requested using a milestone= macro argument, will still be presented.
Default for the option is, of course, 0.
I'm replacing the original patch file, because this is both a small addition, and depends on the previous one being applied.
comment:3 Changed 13 years ago by
Replying to ChrisNelson:
Replying to bof:
- a new option (trac.ini or macro argument) openClosedTickets, defaulting to 1, can be set to 0 to make parent tickets with status closed, initially show as collapsed, regardless of openLevel setting.
I was planning on adding something like
open=open
(don't close the tree for open tickets) and have some other thoughts about more flexibleopen=
andclose=
options. I may not may not adopt or adapt this change.
Fine with me. I think the (optional) feature to make already closed tickets collapse, is important - I'll probably be happy with a superset solution that lets me be more fancy or selective :)
- a new option (trac.ini or macro argument) userMap, defaulting to 1, can be set to 0 to avoid the conversion of login (ticket owner) names to full / real names in the Resource display column.
I can see where that would be useful. Thanks.
I did not really make that change for the performance improvement. Our login names are a lot shorter than some of the full names, so more horizontal space remains for the ticket summary and status display, when I use the login names.
Changed 13 years ago by
Attachment: | tracjsganttplugin-option-defaults.patch added |
---|
option defaults in trac.ini, new options openClosedTickets, userMap, and omitMilestones
comment:4 Changed 13 years ago by
Chris, there was a small bug in the patch; I replaced it with another respin. If you already applied the version from two hours ago, here is the additional change:
@@ -213,7 +219,7 @@ if not key in self.options: query_args[key] = options[key] - if 'root' in options: + if options['root']: parents = options['root'].split('|') query_args['id'] = '|'.join(_children(parents))
Without this change, not using root= results in a python error, because after my previous change to _process_options, now all keys from self.options are present in options, too.
comment:5 Changed 13 years ago by
comment:6 Changed 13 years ago by
comment:7 Changed 13 years ago by
comment:8 follow-up: 11 Changed 13 years ago by
comment:9 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I haven't gotten to the fancy open=
and closed=
options I planned and this is a big step forward, covering most of what those would.
comment:10 Changed 13 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:11 follow-up: 12 Changed 13 years ago by
Replying to ChrisNelson:
Minor suggestion: I think that the purpose of this option would be way more clear if it was named collapseClosedTickets (and defaulting to 0, of course).
comment:12 follow-up: 13 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Replying to rjollos:
Replying to ChrisNelson:
Minor suggestion: I think that the purpose of this option would be way more clear if it was named collapseClosedTickets (and defaulting to 0, of course).
One of my colleagues suggested expandClosedTickets and keep the same sense. Either is clearer than open I think (sorry, bof). Which do you prefer?
comment:13 follow-up: 14 Changed 13 years ago by
Replying to ChrisNelson:
Replying to rjollos:
Replying to ChrisNelson:
Minor suggestion: I think that the purpose of this option would be way more clear if it was named collapseClosedTickets (and defaulting to 0, of course).
One of my colleagues suggested expandClosedTickets and keep the same sense. Either is clearer than open I think (sorry, bof). Which do you prefer?
No need to be sorry - I wasn't entirely happy with openClosed, too.
I prefer expandClosedTickets with default 1.
comment:14 Changed 13 years ago by
comment:15 Changed 13 years ago by
comment:16 Changed 13 years ago by
comment:17 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to bof:
Thanks! I've been wanting to do that for a while.
Sounds like a nice cleanup.
I was planning on adding something like
open=open
(don't close the tree for open tickets) and have some other thoughts about more flexibleopen=
andclose=
options. I may not may not adopt or adapt this change.I can see where that would be useful. Thanks.