Merge lp:~gary/juju-gui/exposed into lp:juju-gui/experimental

Proposed by Gary Poster
Status: Merged
Merged at revision: 594
Proposed branch: lp:~gary/juju-gui/exposed
Merge into: lp:juju-gui/experimental
Diff against target: 14 lines (+3/-1)
1 file modified
app/views/topology/service.js (+3/-1)
To merge this branch: bzr merge lp:~gary/juju-gui/exposed
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+160244@code.launchpad.net

Description of the change

Fix small issue with exposed rendering

If a service was already exposed when the GUI started, trying to unexpose it would not change the visual representation. This was because we were rendering multiple instances of the exposed icon per service block, unnecessarily, and not always removing all of the ones we needed to. Now we simply only add a single exposed icon at a time.

https://codereview.appspot.com/8883048/

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Reviewers: mp+160244_code.launchpad.net,

Message:
Please take a look.

Description:
Fix small issue with exposed rendering

If a service was already exposed when the GUI started, trying to
unexpose it would not change the visual representation. This was
because we were rendering multiple instances of the exposed icon per
service block, unnecessarily, and not always removing all of the ones we
needed to. Now we simply only add a single exposed icon at a time.

I plan to self-review.

https://code.launchpad.net/~gary/juju-gui/exposed/+merge/160244

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M app/views/topology/service.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/topology/service.js
=== modified file 'app/views/topology/service.js'
--- app/views/topology/service.js 2013-04-20 03:04:47 +0000
+++ app/views/topology/service.js 2013-04-23 00:57:07 +0000
@@ -875,7 +875,9 @@

        // Show whether or not the service is exposed using an indicator.
        node.filter(function(d) {
- return d.exposed;
+ return d.exposed &&
+ d3.select(this)
+ .select('.exposed-indicator').empty();
        })
          .append('image')
          .attr({'class': 'exposed-indicator on',

Revision history for this message
Gary Poster (gary) wrote :

*** Submitted:

Fix small issue with exposed rendering

If a service was already exposed when the GUI started, trying to
unexpose it would not change the visual representation. This was
because we were rendering multiple instances of the exposed icon per
service block, unnecessarily, and not always removing all of the ones we
needed to. Now we simply only add a single exposed icon at a time.

R=
CC=
https://codereview.appspot.com/8883048

https://codereview.appspot.com/8883048/

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-04-20 03:04:47 +0000
3+++ app/views/topology/service.js 2013-04-23 01:03:28 +0000
4@@ -875,7 +875,9 @@
5
6 // Show whether or not the service is exposed using an indicator.
7 node.filter(function(d) {
8- return d.exposed;
9+ return d.exposed &&
10+ d3.select(this)
11+ .select('.exposed-indicator').empty();
12 })
13 .append('image')
14 .attr({'class': 'exposed-indicator on',

Subscribers

People subscribed via source and target branches