Merge lp:~rvb/maas/dashboard-bug-1390434-1.7 into lp:maas/1.7

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 3298
Proposed branch: lp:~rvb/maas/dashboard-bug-1390434-1.7
Merge into: lp:maas/1.7
Diff against target: 99 lines (+14/-4)
2 files modified
src/maasserver/static/js/nodes_chart.js (+5/-4)
src/maasserver/static/js/tests/test_nodes_chart.js (+9/-0)
To merge this branch: bzr merge lp:~rvb/maas/dashboard-bug-1390434-1.7
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+241116@code.launchpad.net

Commit message

Backport 3350: Fix the dashboard: we missed a callsite when we refactored the dashboard to move away from longpoll and this broke the message that gets displayed when hovering over the dashboard.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Simple backport, self-approving.

review: Approve
Revision history for this message
Christian Reis (kiko) wrote :

Thanks! I wish we had functional testing for this, but since it's going away..

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/js/nodes_chart.js'
2--- src/maasserver/static/js/nodes_chart.js 2014-09-29 14:07:13 +0000
3+++ src/maasserver/static/js/nodes_chart.js 2014-11-07 17:10:33 +0000
4@@ -128,7 +128,7 @@
5 var outer_nodes = [
6 {
7 nodes: stats.allocated,
8- name: 'allocated_nodes',
9+ name: 'allocated',
10 colour: OUTER_COLOURS[0],
11 events: {
12 over: 'hover.allocated.over',
13@@ -137,7 +137,7 @@
14 },
15 {
16 nodes: stats.commissioned,
17- name: 'commissioned_nodes',
18+ name: 'commissioned',
19 colour: OUTER_COLOURS[2],
20 events: {
21 over: 'hover.commissioned.over',
22@@ -146,7 +146,7 @@
23 },
24 {
25 nodes: stats.queued,
26- name: 'queued_nodes',
27+ name: 'queued',
28 colour: OUTER_COLOURS[1],
29 events: {
30 over: 'hover.queued.over',
31@@ -186,7 +186,8 @@
32 Y.one(slice.node).on(
33 'hover',
34 function(e, over, out, name, widget) {
35- widget.fire(over, {nodes: widget.get(name)});
36+ widget.fire(over, {
37+ nodes: widget.get('stats').get(name)});
38 },
39 function(e, over, out, nodes, widget) {
40 widget.fire(out);
41
42=== modified file 'src/maasserver/static/js/tests/test_nodes_chart.js'
43--- src/maasserver/static/js/tests/test_nodes_chart.js 2014-09-27 17:06:02 +0000
44+++ src/maasserver/static/js/tests/test_nodes_chart.js 2014-11-07 17:10:33 +0000
45@@ -59,6 +59,7 @@
46 event: 'hover.allocated.over',
47 action: 'mouseover',
48 fired: false,
49+ nodes: initialStats.allocated,
50 node: this.chart._outer_paths[0].node
51 },
52 {
53@@ -71,6 +72,7 @@
54 event: 'hover.commissioned.over',
55 action: 'mouseover',
56 fired: false,
57+ nodes: initialStats.commissioned,
58 node: this.chart._outer_paths[1].node
59 },
60 {
61@@ -83,6 +85,7 @@
62 event: 'hover.queued.over',
63 action: 'mouseover',
64 fired: false,
65+ nodes: initialStats.queued,
66 node: this.chart._outer_paths[2].node
67 },
68 {
69@@ -95,6 +98,7 @@
70 event: 'hover.offline.over',
71 action: 'mouseover',
72 fired: false,
73+ nodes: initialStats.offline,
74 node: this.chart._offline_circle[0].node
75 },
76 {
77@@ -107,6 +111,7 @@
78 event: 'hover.added.over',
79 action: 'mouseover',
80 fired: false,
81+ nodes: initialStats.added,
82 node: this.chart._added_circle[0].node
83 },
84 {
85@@ -120,11 +125,15 @@
86 Y.Array.each(events, function(event) {
87 this.chart.on(event.event, function(e, event) {
88 event.fired = true;
89+ event.e = e;
90 }, null, event);
91 Y.one(event.node).simulate(event.action);
92 Y.Assert.isTrue(
93 event.fired,
94 'Event ' + event.event + ' should have fired');
95+ if (event.nodes) {
96+ Y.Assert.areEqual(event.e.nodes, event.nodes);
97+ }
98 }, this);
99 },
100

Subscribers

People subscribed via source and target branches

to all changes: