Merge lp:~bcsaller/juju-gui/nostatusforoldsubordinates into lp:juju-gui/experimental

Proposed by Benjamin Saller
Status: Merged
Merged at revision: 837
Proposed branch: lp:~bcsaller/juju-gui/nostatusforoldsubordinates
Merge into: lp:juju-gui/experimental
Diff against target: 59 lines (+14/-10)
2 files modified
app/views/topology/service.js (+14/-9)
app/views/utils.js (+0/-1)
To merge this branch: bzr merge lp:~bcsaller/juju-gui/nostatusforoldsubordinates
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+174842@code.launchpad.net

Description of the change

Subordinates don't get status bars

Subordinates could render status in the future, but for now we omit
this as the UI relating to mapping sub units to principal service units
is unclear.

https://codereview.appspot.com/11295043/

To post a comment you must log in.
Revision history for this message
Benjamin Saller (bcsaller) wrote :

Reviewers: mp+174842_code.launchpad.net,

Message:
Please take a look.

Description:
Subordinates don't get status bars

Subordinates could render status in the future, but for now we omit
this as the UI relating to mapping sub units to principal service units
is unclear.

https://code.launchpad.net/~bcsaller/juju-gui/nostatusforoldsubordinates/+merge/174842

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/11295043/

Affected files:
   A [revision details]
   M app/views/topology/service.js
   M app/views/utils.js

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: app/views/utils.js
=== modified file 'app/views/utils.js'
--- app/views/utils.js 2013-07-11 14:56:15 +0000
+++ app/views/utils.js 2013-07-15 19:38:30 +0000
@@ -772,7 +772,6 @@
      return errors;
    };

-
    /**
     * Utility object that encapsulates Y.Models and keeps their position
     * state within an SVG canvas.

Index: app/views/topology/service.js
=== modified file 'app/views/topology/service.js'
--- app/views/topology/service.js 2013-07-15 15:52:04 +0000
+++ app/views/topology/service.js 2013-07-15 19:38:30 +0000
@@ -883,7 +883,9 @@
        node.append('image')
         .classed('service-icon', true)
         .attr({
- 'xlink:href': function(d) {return d.icon;},
+ 'xlink:href': function(d) {
+ return d.icon;
+ },
              width: 96,
              height: 96,
              transform: 'translate(47, 50)'
@@ -899,13 +901,16 @@
          .classed('statusbar', true);

        status_graph.each(function(d) {
- d3.select(this).property('status_bar', new views.StatusBar({
- resize: false,
- width: 160,
- target: this,
- fontSize: 8,
- labels: false
- }).render());
+ if (!d.subordinate) {
+ d3.select(this).property('status_bar',
+ new views.StatusBar({
+ resize: false,
+ width: 160,
+ target: this,
+ fontSize: 8,
+ labels: false
+ }).render());
+ }
        });
        // Manually attach the touchstart event (see method for details)
        node.each(function(data) {
@@ -1149,7 +1154,7 @@
        node.each(function(d) {
          var status_graph = d3.select(this).select('.statusbar');
          var status_bar = status_graph.property('status_bar');
- if (status_bar) {
+ if (status_bar && !d.subordinate) {
            status_bar.update(d.aggregated_status);
          }
        });

Revision history for this message
Gary Poster (gary) wrote :
Revision history for this message
Jeff Pihach (hatch) wrote :
Revision history for this message
Benjamin Saller (bcsaller) wrote :

*** Submitted:

Subordinates don't get status bars

Subordinates could render status in the future, but for now we omit
this as the UI relating to mapping sub units to principal service units
is unclear.

R=gary.poster, jeff.pihach
CC=
https://codereview.appspot.com/11295043

https://codereview.appspot.com/11295043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/views/topology/service.js'
2--- app/views/topology/service.js 2013-07-15 15:52:04 +0000
3+++ app/views/topology/service.js 2013-07-15 19:43:24 +0000
4@@ -883,7 +883,9 @@
5 node.append('image')
6 .classed('service-icon', true)
7 .attr({
8- 'xlink:href': function(d) {return d.icon;},
9+ 'xlink:href': function(d) {
10+ return d.icon;
11+ },
12 width: 96,
13 height: 96,
14 transform: 'translate(47, 50)'
15@@ -899,13 +901,16 @@
16 .classed('statusbar', true);
17
18 status_graph.each(function(d) {
19- d3.select(this).property('status_bar', new views.StatusBar({
20- resize: false,
21- width: 160,
22- target: this,
23- fontSize: 8,
24- labels: false
25- }).render());
26+ if (!d.subordinate) {
27+ d3.select(this).property('status_bar',
28+ new views.StatusBar({
29+ resize: false,
30+ width: 160,
31+ target: this,
32+ fontSize: 8,
33+ labels: false
34+ }).render());
35+ }
36 });
37 // Manually attach the touchstart event (see method for details)
38 node.each(function(data) {
39@@ -1149,7 +1154,7 @@
40 node.each(function(d) {
41 var status_graph = d3.select(this).select('.statusbar');
42 var status_bar = status_graph.property('status_bar');
43- if (status_bar) {
44+ if (status_bar && !d.subordinate) {
45 status_bar.update(d.aggregated_status);
46 }
47 });
48
49=== modified file 'app/views/utils.js'
50--- app/views/utils.js 2013-07-11 14:56:15 +0000
51+++ app/views/utils.js 2013-07-15 19:43:24 +0000
52@@ -772,7 +772,6 @@
53 return errors;
54 };
55
56-
57 /**
58 * Utility object that encapsulates Y.Models and keeps their position
59 * state within an SVG canvas.

Subscribers

People subscribed via source and target branches