Merge lp://staging/~gary/juju-gui/bug1167295 into lp://staging/juju-gui/experimental

Proposed by Gary Poster
Status: Merged
Merged at revision: 533
Proposed branch: lp://staging/~gary/juju-gui/bug1167295
Merge into: lp://staging/juju-gui/experimental
Diff against target: 219 lines (+84/-10)
7 files modified
app/templates/unit.handlebars (+1/-1)
app/views/topology/relation.js (+4/-4)
app/views/utils.js (+35/-0)
lib/views/stylesheet.less (+1/-0)
test/test_environment_view.js (+14/-3)
test/test_topology_relation.js (+4/-2)
test/test_utils.js (+25/-0)
To merge this branch: bzr merge lp://staging/~gary/juju-gui/bug1167295
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+158224@code.staging.launchpad.net

Description of the change

Make safe relation ids in environment view

Relation ids included spaces and other problematic chacracters in our related DOM ids. This branch cleans those up, and also does a quick CSS cleanup to make some text legible again.

https://codereview.appspot.com/8640043/

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

Reviewers: mp+158224_code.launchpad.net,

Message:
Please take a look.

Description:
Make safe relation ids in environment view

Relation ids included spaces and other problematic chacracters in our
related DOM ids. This branch cleans those up, and also does a quick CSS
cleanup to make some text legible again.

https://code.launchpad.net/~gary/juju-gui/bug1167295/+merge/158224

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M app/templates/unit.handlebars
   M app/views/topology/relation.js
   M app/views/utils.js
   M lib/views/stylesheet.less
   M test/test_environment_view.js
   M test/test_topology_relation.js
   M test/test_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: test/test_environment_view.js
=== modified file 'test/test_environment_view.js'
--- test/test_environment_view.js 2013-04-04 14:45:42 +0000
+++ test/test_environment_view.js 2013-04-10 21:17:18 +0000
@@ -84,7 +84,7 @@
        Y = YUI(GlobalConfig).use([
          'juju-views', 'juju-tests-utils', 'juju-env',
          'node-event-simulate', 'juju-gui', 'slider',
- 'landscape', 'dump'
+ 'landscape', 'dump', 'juju-view-utils'
        ], function(Y) {
          testUtils = Y.namespace('juju-tests.utils');
          views = Y.namespace('juju.views');
@@ -170,6 +170,13 @@
                      parseInt(this.getAttribute(e), 10))
                              .should.equal(true);
                }, line);
+
+ // Verify that the node id has been munged as expected from the
+ // relation id. This is particularly important for Juju Core.
+ var node = container.one(
+ '#' + views.utils.generateSafeDOMId('relation-0000000007'));
+ assert.isNotNull(node);
+ assert.isDefined(node);
          });

      it('must be able to render subordinate and normal services',
@@ -750,7 +757,9 @@
             db: db,
             env: env}).render();

- var relation = container.one('#relation-0000000001 .rel-label'),
+ var relation = container.one(
+ '#' + views.utils.generateSafeDOMId('relation-0000000001') +
+ ' .rel-label'),
           dialog_btn,
           panel;

@@ -778,7 +787,9 @@
             env: env}).render();

           // Get a subordinate relation.
- var relation = container.one('#relation-0000000007 .rel-label'),
+ var relation = container.one(
+ '#' + views.utils.generateSafeDOMId('relation-0000000007') +
+ ' .rel-label'),
           dialog_btn,
           panel;

Index: test/test_topology_relation.js
=== modified file 'test/test_topology_relation.js'
--- test/test_topology_relation.js 2013-01-23 21:56:36 +0000
+++ test/test_topology_relation.js 2013-04-10 21:17:18 +0000
@@ -4,7 +4,8 @@
    var Y, views, view, container, topo, db;

...

Read more...

Revision history for this message
Jeff Pihach (hatch) wrote :

LGTM - nice clean approach!

https://codereview.appspot.com/8640043/

Revision history for this message
Madison Scott-Clary (makyo) wrote :
Revision history for this message
Gary Poster (gary) wrote :

*** Submitted:

Make safe relation ids in environment view

Relation ids included spaces and other problematic chacracters in our
related DOM ids. This branch cleans those up, and also does a quick CSS
cleanup to make some text legible again.

R=jeff.pihach, matthew.scott
CC=
https://codereview.appspot.com/8640043

https://codereview.appspot.com/8640043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches