Merge lp:~mabac/launchpad-work-items-tracker/reorder-roadmap-graphs into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Mattias Backman
Status: Merged
Merged at revision: 321
Proposed branch: lp:~mabac/launchpad-work-items-tracker/reorder-roadmap-graphs
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 95 lines (+15/-4)
5 files modified
html-report (+6/-0)
lpworkitems/models.py (+4/-0)
report_tools.py (+1/-0)
templates/roadmap_card.html (+2/-2)
templates/roadmap_lane.html (+2/-2)
To merge this branch: bzr merge lp:~mabac/launchpad-work-items-tracker/reorder-roadmap-graphs
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Joey Stanford Pending
Christian Reis Pending
Review via email: mp+86251@code.launchpad.net

Description of the change

Hi,

This branch changes the roadmap charts so that they use the same order for the Card statuses:
    Completed, In Progress, Blocked, Planned.

The chart is just inverted using the --inverted option. For sorting the inline bars, we just use a list specifying the required order (it has to be hard coded somewhere, right?) ;)

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
Mattias Backman (mabac) wrote :

Oh, and it's on staging so in ~15 minutes you can see what this does.

322. By Mattias Backman

Also sort the mouse over text.

323. By Mattias Backman

Sort blueprints in card view; first by status in reversed order, then by milestone.

Revision history for this message
Данило Шеган (danilo) wrote :

It would be nice to make use of this ordering list in roadmap-bp-chart (where "if inverted:...else:..." is used to plot the graphs), so it's hard-coded in only a single place. Definitely not for this branch though, it can be cleaned up as a separate step, imo.

Thanks for this fix, it's more reasonable like this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'html-report'
2--- html-report 2011-12-16 13:53:49 +0000
3+++ html-report 2011-12-20 11:10:33 +0000
4@@ -15,6 +15,7 @@
5 )
6 from lpworkitems.models import (
7 ROADMAP_STATUSES_MAP,
8+ ROADMAP_ORDERED_STATUSES,
9 )
10
11
12@@ -506,6 +507,7 @@
13 statuses.append(dict(name=status, cards=cards_with_bps))
14
15 data.update(dict(statuses=statuses))
16+ data.update(dict(status_order=ROADMAP_ORDERED_STATUSES))
17 data.update(dict(page_type="roadmap_lane"))
18 data.update(dict(lane_title=title))
19 data.update(dict(lanes=lanes))
20@@ -541,11 +543,15 @@
21 blueprint_status_count.postponed +
22 blueprint_status_count.done) > 0
23
24+ status_order = ROADMAP_ORDERED_STATUSES[:]
25+ status_order.reverse()
26+
27 data.update(dict(page_type="roadmap_card"))
28 data.update(dict(card_title=title))
29 data.update(dict(card=card))
30 data.update(dict(health_checks=health_checks))
31 data.update(dict(lane=lane.name))
32+ data.update(dict(status_order=status_order))
33 data.update(dict(blueprints=blueprints))
34 data.update(dict(blueprint_status_count=blueprint_status_count))
35 data.update(dict(card_has_blueprints=card_has_blueprints))
36
37=== modified file 'lpworkitems/models.py'
38--- lpworkitems/models.py 2011-12-14 20:22:50 +0000
39+++ lpworkitems/models.py 2011-12-20 11:10:33 +0000
40@@ -12,6 +12,10 @@
41 u'Slow progress', u'Started'],
42 u'Planned': [u'Unknown', u'Not started', u'Informational']}
43
44+ROADMAP_ORDERED_STATUSES = ['Completed', 'In Progress', 'Blocked', 'Planned']
45+assert set(ROADMAP_ORDERED_STATUSES) == set(ROADMAP_STATUSES_MAP.keys()), (
46+ 'The roadmap statuses are incorrect: %s' % ROADMAP_ORDERED_STATUSES)
47+
48
49 def fill_blueprint_info_from_launchpad(model_bp, lp_bp):
50 model_bp.name = unicode_or_None(lp_bp.name)
51
52=== modified file 'report_tools.py'
53--- report_tools.py 2011-12-16 15:11:04 +0000
54+++ report_tools.py 2011-12-20 11:10:33 +0000
55@@ -228,6 +228,7 @@
56 if lane.is_current:
57 args = [os.path.join(my_path, 'roadmap-bp-chart'), '-d', database,
58 '-o', chart_name]
59+ args += ['--inverted']
60 proc = Popen(args)
61 print chart_name
62 proc.wait()
63
64=== modified file 'templates/roadmap_card.html'
65--- templates/roadmap_card.html 2011-12-14 12:34:43 +0000
66+++ templates/roadmap_card.html 2011-12-20 11:10:33 +0000
67@@ -53,8 +53,8 @@
68 <th>Health check</th>
69 </tr>
70 </thead>
71-% for status in blueprints.keys():
72-% for bp in blueprints[status]:
73+% for status in status_order:
74+% for bp in sorted(blueprints[status], key=lambda bp: bp.milestone_name):
75 <tr><td><a href="${bp.url}">${bp.name}</a></td>
76 <td>${bp.assignee_name}</td>
77 <td>${bp.priority}</td>
78
79=== modified file 'templates/roadmap_lane.html'
80--- templates/roadmap_lane.html 2011-12-16 13:42:02 +0000
81+++ templates/roadmap_lane.html 2011-12-20 11:10:33 +0000
82@@ -33,11 +33,11 @@
83 <td>${card_dict['card'].team}</td><td align=right>${card_dict['card'].priority}</td>
84 <td>
85 <div class="roadmap_wrap" title="
86-% for bp_status in card_dict['bp_statuses'].keys():
87+% for bp_status in status_order:
88 ${bp_status}: ${card_dict['bp_statuses'][bp_status]}&nbsp;
89 % endfor
90 ">
91-% for bp_status in card_dict['bp_percentages'].keys():
92+% for bp_status in status_order:
93 <div class="roadmap_value" style="width:${card_dict['bp_percentages'][bp_status]}%">
94 <div class="${bp_status.replace(' ', '')}">&nbsp;</div>
95 </div>

Subscribers

People subscribed via source and target branches