Modify

Opened 13 years ago

Last modified 4 years ago

#9165 new enhancement

Allow estimation_field to be set as Macro attribute

Reported by: asyn Owned by: Joachim Hoessler
Priority: normal Component: EstimationToolsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Some developers using the agile approach would like to use more than one burndown chart.

It makes for example sense to have one burndown chart showing »remaining hours« and one showing »not finished story points«.

What do you think about allowing the calculation-field to be passed in as macro parameter?

Example:

[[BurndownChart(title=Burndown Chart, milestone=Beta 2, startdate=2011-09-07, estimation_field=storypoints)]]

Would create a chart based on the field storypoints.

When not specified it should use the field from trac.ini.

I achieved this behaviour by adding this snippet to the macro functions:

estimation_field = self.estimation_field
if (options['estimation_field'] != self.estimation_field):
    estimation_field = options['estimation_field']

Additionally I replaced every self.estimation_field with estimation_field in subsequent lines.

This is an example diff for the file trunk/estimationtools/burndownchart.py:

13c13
<                    'bgcolor': 'ffffff00', 'wecolor':'ccccccaa', 'colorexpected': 'ffddaa', 'weekends':'true', 'gridlines' : '0'}
---
>                    'bgcolor': 'ffffff00', 'wecolor':'ccccccaa', 'colorexpected': 'ffddaa', 'weekends':'true', 'gridlines' : '0', 'estimation_field' : 'remaininghours'}
60a61,64
> 	
> 	estimation_field = self.estimation_field
> 	if (options['estimation_field'] != 'remaininghours'):
> 	    estimation_field = options['estimation_field']
146a151,154
> 	estimation_field = self.estimation_field
>         if (options['estimation_field'] != 'remaininghours'):
>             estimation_field = options['estimation_field']
> 
157c165
<         query_args[self.estimation_field + "!"] = None
---
>         query_args[estimation_field + "!"] = None
169c177
<             latest_estimate = self._cast_estimate(t[self.estimation_field])
---
>             latest_estimate = self._cast_estimate(t[estimation_field])
179c187
<                 "ORDER BY c.time ASC", [t['id'], self.estimation_field])
---
>                 "ORDER BY c.time ASC", [t['id'], estimation_field])
195c203
<                 if row_field == self.estimation_field:
---
>                 if row_field == estimation_field:

utils.py

21c21
<                      'expected', 'colorexpected', 'title']
---
>                      'expected', 'colorexpected', 'title', 'estimation_field']

My python knowledge is quite limited so please improve the code where necessary.

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:2 Changed 4 years ago by Ryan J Ollos

Cc: Ryan J Ollos removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Joachim Hoessler.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.