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

Proposed by Gary Poster
Status: Merged
Merged at revision: 893
Proposed branch: lp://staging/~gary/juju-gui/bug1204331
Merge into: lp://staging/juju-gui/experimental
Diff against target: 208 lines (+64/-11)
10 files modified
app/index.html (+2/-2)
app/models/charm.js (+4/-1)
app/store/endpoints.js (+2/-0)
app/templates/ghost-config-wrapper.handlebars (+2/-0)
app/views/charm-panel.js (+2/-1)
app/views/environment.js (+2/-1)
app/views/ghost-inspector.js (+7/-3)
app/views/inspector.js (+6/-3)
app/views/utils.js (+12/-0)
test/test_endpoints.js (+25/-0)
To merge this branch: bzr merge lp://staging/~gary/juju-gui/bug1204331
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+176830@code.staging.launchpad.net

Description of the change

Fix subordinate behavior in Juju Core

The biggest change here is that we update service data with the charm subordinate flag, because juju core does not include that information in the service. This includes a test.

Other changes here are fly-by.
- The yui3-skin-sam class on the body was causing issues by adding styles unnecessarily. I put it on the subapp-browser, where it is sufficient.
- The sandbox sends is_subordinate, not subordinate, for charms. I'm not sure if that is correct, but for now I changed charm.js to handle it. I'd welcome opinions on pushing this back down into the pyjuju sandbox, where I could test it. I'm kind of inclined to do that, actually, but I want to get this branch proposed.
- I made a few changes to the inspector code to handle subordinates a bit better, particularly in the ghost inspector. the ghost inspector has no tests at all, and we have a card for adding them, so I did not try to tack that effort on to this branch.
- I made a small tweak to charm-panel.js so that new services start looking like subordinates immediately.
- I added a small hack that came in handy to track down behavior in a handlebars template. Just add {{debugger}} in the template and you will have a breakpoint there. handy. hopefully not too dangerous! We definitely don't want to check in a template that uses this, and the linter won't check our template code...

https://codereview.appspot.com/11804043/

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

Reviewers: mp+176830_code.launchpad.net,

Message:
Please take a look.

Description:
Fix subordinate behavior in Juju Core

The biggest change here is that we update service data with the charm
subordinate flag, because juju core does not include that information in
the service. This includes a test.

Other changes here are fly-by.
- The yui3-skin-sam class on the body was causing issues by adding
styles unnecessarily. I put it on the subapp-browser, where it is
sufficient.
- The sandbox sends is_subordinate, not subordinate, for charms. I'm
not sure if that is correct, but for now I changed charm.js to handle
it. I'd welcome opinions on pushing this back down into the pyjuju
sandbox, where I could test it. I'm kind of inclined to do that,
actually, but I want to get this branch proposed.
- I made a few changes to the inspector code to handle subordinates a
bit better, particularly in the ghost inspector. the ghost inspector
has no tests at all, and we have a card for adding them, so I did not
try to tack that effort on to this branch.
- I made a small tweak to charm-panel.js so that new services start
looking like subordinates immediately.
- I added a small hack that came in handy to track down behavior in a
handlebars template. Just add {{debugger}} in the template and you will
have a breakpoint there. handy. hopefully not too dangerous! We
definitely don't want to check in a template that uses this, and the
linter won't check our template code...

https://code.launchpad.net/~gary/juju-gui/bug1204331/+merge/176830

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M app/index.html
   M app/models/charm.js
   M app/store/endpoints.js
   M app/templates/ghost-config-wrapper.handlebars
   M app/views/charm-panel.js
   M app/views/environment.js
   M app/views/ghost-inspector.js
   M app/views/inspector.js
   M app/views/utils.js
   M test/test_endpoints.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/index.html
=== modified file 'app/index.html'
--- app/index.html 2013-07-24 14:30:06 +0000
+++ app/index.html 2013-07-24 21:46:12 +0000
@@ -67,7 +67,7 @@
      </script>
    </head>

- <body class="yui3-skin-sam">
+ <body>
        <!-- This <img> tag is here just to force early loading of the
background
          image so it displays more quickly. This makes a large improvement
to
          the way the app looks while loading on a slow connection. -->
@@ -164,7 +164,7 @@
            <div id="content">
                <div id="shortcut-help" style="display:none"></div>
                <div id="subapp-browser-min" style="display: none;"></div>
- <div id="subapp-browser"></div>
+ <div id="subapp-browser" class="yui3-skin-sam"></div>
                <div id="main">
                </div> <!-- /container -->
           ...

Revision history for this message
Brad Crittenden (bac) wrote :

LGTM for code. QA shows the dismiss [X] on the inspector has dropped
50px or so out of place. The issues you meant to solve are fixed.

https://codereview.appspot.com/11804043/diff/1/app/index.html
File app/index.html (right):

https://codereview.appspot.com/11804043/diff/1/app/index.html#newcode70
app/index.html:70: <body>
I'm glad you resolved this issue.

https://codereview.appspot.com/11804043/diff/1/app/models/charm.js
File app/models/charm.js (right):

https://codereview.appspot.com/11804043/diff/1/app/models/charm.js#newcode178
app/models/charm.js:178: // fakebackend and/or sandbox to send the
expected thing there.
Trivial but this should be an XXX with your name on it.

https://codereview.appspot.com/11804043/

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

*** Submitted:

Fix subordinate behavior in Juju Core

The biggest change here is that we update service data with the charm
subordinate flag, because juju core does not include that information in
the service. This includes a test.

Other changes here are fly-by.
- The yui3-skin-sam class on the body was causing issues by adding
styles unnecessarily. I put it on the subapp-browser, where it is
sufficient.
- The sandbox sends is_subordinate, not subordinate, for charms. I'm
not sure if that is correct, but for now I changed charm.js to handle
it. I'd welcome opinions on pushing this back down into the pyjuju
sandbox, where I could test it. I'm kind of inclined to do that,
actually, but I want to get this branch proposed.
- I made a few changes to the inspector code to handle subordinates a
bit better, particularly in the ghost inspector. the ghost inspector
has no tests at all, and we have a card for adding them, so I did not
try to tack that effort on to this branch.
- I made a small tweak to charm-panel.js so that new services start
looking like subordinates immediately.
- I added a small hack that came in handy to track down behavior in a
handlebars template. Just add {{debugger}} in the template and you will
have a breakpoint there. handy. hopefully not too dangerous! We
definitely don't want to check in a template that uses this, and the
linter won't check our template code...

R=benji
CC=
https://codereview.appspot.com/11804043

https://codereview.appspot.com/11804043/

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