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
=== 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:43:24 +0000
@@ -883,7 +883,9 @@
883 node.append('image')883 node.append('image')
884 .classed('service-icon', true)884 .classed('service-icon', true)
885 .attr({885 .attr({
886 'xlink:href': function(d) {return d.icon;},886 'xlink:href': function(d) {
887 return d.icon;
888 },
887 width: 96,889 width: 96,
888 height: 96,890 height: 96,
889 transform: 'translate(47, 50)'891 transform: 'translate(47, 50)'
@@ -899,13 +901,16 @@
899 .classed('statusbar', true);901 .classed('statusbar', true);
900902
901 status_graph.each(function(d) {903 status_graph.each(function(d) {
902 d3.select(this).property('status_bar', new views.StatusBar({904 if (!d.subordinate) {
903 resize: false,905 d3.select(this).property('status_bar',
904 width: 160,906 new views.StatusBar({
905 target: this,907 resize: false,
906 fontSize: 8,908 width: 160,
907 labels: false909 target: this,
908 }).render());910 fontSize: 8,
911 labels: false
912 }).render());
913 }
909 });914 });
910 // Manually attach the touchstart event (see method for details)915 // Manually attach the touchstart event (see method for details)
911 node.each(function(data) {916 node.each(function(data) {
@@ -1149,7 +1154,7 @@
1149 node.each(function(d) {1154 node.each(function(d) {
1150 var status_graph = d3.select(this).select('.statusbar');1155 var status_graph = d3.select(this).select('.statusbar');
1151 var status_bar = status_graph.property('status_bar');1156 var status_bar = status_graph.property('status_bar');
1152 if (status_bar) {1157 if (status_bar && !d.subordinate) {
1153 status_bar.update(d.aggregated_status);1158 status_bar.update(d.aggregated_status);
1154 }1159 }
1155 });1160 });
11561161
=== 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:43:24 +0000
@@ -772,7 +772,6 @@
772 return errors;772 return errors;
773 };773 };
774774
775
776 /**775 /**
777 * Utility object that encapsulates Y.Models and keeps their position776 * Utility object that encapsulates Y.Models and keeps their position
778 * state within an SVG canvas.777 * state within an SVG canvas.

Subscribers

People subscribed via source and target branches