Trac - 如何自定义RoadMap中的内容

上一篇 / 下一篇  2011-11-11 11:22:15 / 个人分类:Trac

曾经写过一篇文章介绍如何自定义字段及流程的文章(http://www.51testing.com/index.php?uid-49689-action-spacelist-type-blog-itemtypeid-11268),今天介绍如何自定义RoadMap.
原文参见:http://trac.edgewall.org/wiki/TracRoadmapCustomGroups
Trac中的roadmap是对milestone的一个集合统计,如果你在创建ticket时选择了相应的milestone,则打开roadmap tab时,默认显示如下:

这个图中只是显示了已解决及未解决的tickets数,根据我们自定义流程中文章中的介绍,trac允许用户自已添加一些流程,如果用户也想在roadmap中体现出来自定义的status,该如何做呢?

1. 比如用户在trac.ini [ticket-custom]中自定义了testing流程,定义内容如下:

testing = new, accepted, needs_work, assigned, reopened -> testing
testing.name = Submit to report for testing
testing.operations = set_owner
testing.permissions = TICKET_MODIFY

2. 如果用户想在roadmap中看新增加的状态,可做如下处理:

(1)在trac.ini文件中增加[milestone-group] section,其中内容包括如下:

[milestone-groups]
# The definition consists in a comma-separated list of accepted status.
# Also, '*' means any status and could be used to associate all remaining
# states to one catch-all group.
# Qualifiers for the above group (the group must have been defined first):

# Definition of a 'closed' group:
closed = closed # 此closed状态,必须已经提前定义过
closed.order = 1
closed.query_args = group=resolution
closed.overall_completion = true 

# Definition of an 'in testing' group:                                 
inQA = testing # 此testing状态,必须已经提前定义过
inQA.order = 2
inQA.css_class = new
inQA.label = in testing

# Definition of an 'active' group:
active = *
active.order = 3
active.css_class = open
active.label = in progress

# The CSS class can be one of: new (yellow), open (no color) or
# closed (green). New styles can easily be added using the following
# selector:  `table.progress td.<class>`

完成后,重新trac server,可得到如下roadmap:

Trac roadmap with multiple groups

3. 上述内容的解释

<groupname>可以是一个或多个status,多个status之间用逗号分隔;使用*则意味着匹配所有在[milestone-group]中尚未定义的状态
<groupname>.order表示在上图progress bar中显示的位置
<groupname>.query_argsOptional extra parameter for the query
<groupname>.overall_completiontrue/false - count in the overall completion statistic
<groupname>.css_class定义progress bar中显示的颜色new (yellow), open (no color) or closed (green). 
<groupname>.label显示在progress bar中的名称


TAG:

 

评分:0

我来说两句

Open Toolbar