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

Proposed by Gary Poster
Status: Merged
Merged at revision: 221
Proposed branch: lp://staging/~gary/juju-gui/charmpanel
Merge into: lp://staging/juju-gui/experimental
Diff against target: 956 lines (+265/-199)
17 files modified
app/app.js (+3/-3)
app/index.html (+1/-1)
app/modules.js (+2/-2)
app/templates/charm-description.handlebars (+2/-2)
app/templates/charm-search-pop.handlebars (+0/-7)
app/templates/overview.handlebars (+1/-1)
app/templates/service-footer.partial (+1/-1)
app/templates/service.handlebars (+1/-1)
app/views/charm-panel.js (+121/-58)
app/views/environment.js (+28/-49)
app/views/service.js (+12/-13)
app/views/utils.js (+24/-1)
lib/views/stylesheet.less (+20/-12)
test/index.html (+1/-1)
test/test_charm_panel.js (+9/-9)
test/test_environment_view.js (+11/-10)
undocumented (+28/-28)
To merge this branch: bzr merge lp://staging/~gary/juju-gui/charmpanel
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+131605@code.staging.launchpad.net

Description of the change

Convert charm popup to full side display panel

This makes relatively small changes to adjust the existing charm store panels to be displayed down the full right side, per design specs. It does not touch the display of the panels themselves, other than to adjust the scrolling.

Per reviews, some name normalization occurred as well (e.g., "panel" became "popup" in various names).

https://codereview.appspot.com/6775058/

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

Reviewers: mp+131605_code.launchpad.net,

Message:
Please take a look.

Description:
Convert charm store to full-side display

This makes relatively small changes to adjust the existing charm store
panels to be displayed down the full right side, per design specs. It
does not touch the display of the pnales themselves, other than to
adjust the scrolling.

Thanks

Gary

https://code.launchpad.net/~gary/juju-gui/charmpanel/+merge/131605

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   D app/templates/charm-search-pop.handlebars
   M app/views/charm-search.js
   M app/views/environment.js
   M lib/views/stylesheet.less

Revision history for this message
Thiago Veronezi (tveronezi) wrote :

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode31
app/views/charm-search.js:31:
parseInt(scrollContainer.getComputedStyle('height'), 10)),
Does node.get('clientHeight') not work for this case?

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode597
app/views/charm-search.js:597: svg &&
parseInt(Y.one('svg').getAttribute('height'), 10) + 17};
You dont need to call "Y.one" again. You already have the svg object.
  What happens when we have no svg object?

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode655
app/views/charm-search.js:655: // if (sub) { sub.detach(); }
You don't use the sub object. Do you need the loop?

https://codereview.appspot.com/6775058/

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

Thanks Thiago. You had an excellent catch in there! I'll fix and
repropose.

Gary

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode31
app/views/charm-search.js:31:
parseInt(scrollContainer.getComputedStyle('height'), 10)),
On 2012/10/26 15:51:30, thiago.veronezi wrote:
> Does node.get('clientHeight') not work for this case?

No. They are in fact different, and I need the difference in this case.
  The height value does not include the margin or padding, and the
clientHeight does. (Neither include the scrollbar, if any). I need to
figure out what height to set (since clientHeight is read only) and yet
I need to take the margin and padding into account, so I need to get the
difference. Another approach would be to add the values of margin-top,
padding-top, padding-bottom, and margin-bottom, but they are often not
in pixels and it is easier this way.

I could replace the *previous* line
(scrollContainer.getClientRect().height) with offsetHeight. Those are
the same as long as the box has scrolling for overflow. I actually like
that idea, and might do it.

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode597
app/views/charm-search.js:597: svg &&
parseInt(Y.one('svg').getAttribute('height'), 10) + 17};
On 2012/10/26 15:51:30, thiago.veronezi wrote:
> You dont need to call "Y.one" again. You already have the svg object.

Correct, thanks.

> What happens when we have no svg object?

height is undefined, which is fine for the tests. However, your
question made me realize that this will not do what I want on interior
pages! That was probably your point. Thanks, good catch. I'll fix it.

https://codereview.appspot.com/6775058/diff/1/app/views/charm-search.js#newcode655
app/views/charm-search.js:655: // if (sub) { sub.detach(); }
On 2012/10/26 15:51:30, thiago.veronezi wrote:
> You don't use the sub object. Do you need the loop?

Yes. I do use it: I call detach. That was the intent.

https://codereview.appspot.com/6775058/

209. By Gary Poster

make charm browser work on other pages that have been updated to desired UI.

210. By Gary Poster

lint

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

Note that the charm panel does not have a defined good behavior on the two pages with legacy designs: service units and charms. The former will be redone for the new visual design, and the latter will be deleted.

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

Also, I think this fixes the occasional mis-sizing of the environment on window resize.

Revision history for this message
Thiago Veronezi (tveronezi) wrote :

https://codereview.appspot.com/6775058/diff/6001/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/6001/app/views/charm-search.js#newcode653
app/views/charm-search.js:653: // if (sub) { sub.detach(); }
The only problem I see is that this line is commented out. :)

https://codereview.appspot.com/6775058/

211. By Gary Poster

reinstate commented out code, per review

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

:-) Thanks Thiago

https://codereview.appspot.com/6775058/diff/6001/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/6001/app/views/charm-search.js#newcode653
app/views/charm-search.js:653: // if (sub) { sub.detach(); }
On 2012/10/27 21:44:34, thiago.veronezi wrote:
> The only problem I see is that this line is commented out. :)
LOL! Now I see what you meant. Thank you, fixed. :-)

https://codereview.appspot.com/6775058/

212. By Gary Poster

fix a few more edge cases with changing the window size

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

get environment height test to pass with some jiggery pokery.

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

lint

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

Upon grabbing your branch for testing I see there are conflicts with
trunk which include the issue of -right vs -up.

The branch looks good and behaved nicely.

Of course, wait for a Real Review.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode8
app/views/charm-search.js:8: subscriptions = [],
A comment here describing the use and purpose of 'subscriptions' would
be really helpful. I figured out but only when I got to the end of this
file.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode15
app/views/charm-search.js:15: icon = ev.currentTarget.one('i');
Is this line really repeated?

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode18
app/views/charm-search.js:18: icon.replaceClass('icon-chevron-right',
'icon-chevron-down');
-right should be -up to match the visual design. If you think the design
is wrong then the charm panel section headers need to change too.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode438
app/views/charm-search.js:438: container =
Y.Node.create('<div></div>').setAttribute(
Any tag created by Y.Node.create can be self-closing and it does the
right thing. So

Y.Node.create('<div />')

works and is more readable, though you may argue misleading. I see we
do both. Just mentioning it.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode439
app/views/charm-search.js:439: 'id', 'juju-search-charm-panel'),
Indent more

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode518
app/views/charm-search.js:518: headerSpan.setStyle('borderLeftColor',
'lightgray');
Why isn't this styling in CSS?

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode534
app/views/charm-search.js:534: if (isPopupVisible) {
These names with 'Popup' are historical and now inaccurate. Other
places you refer to the panel (calculatePanelPosition). The use of both
is confusing.

https://codereview.appspot.com/6775058/diff/18001/app/views/environment.js
File app/views/environment.js (right):

https://codereview.appspot.com/6775058/diff/18001/app/views/environment.js#newcode1236
app/views/environment.js:1236: // "afterPageSizeRecalculation" event at
the end of this function.
Nice comment.

https://codereview.appspot.com/6775058/

215. By Gary Poster

respond to review

216. By Gary Poster

merge trunk

217. By Gary Poster

switch more to "panel" name, following review suggestion farther.

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

Thank you for the review Brad. I've made all requested changes. And
intend to land this, per the new rules.

Gary

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js
File app/views/charm-search.js (right):

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode8
app/views/charm-search.js:8: subscriptions = [],
On 2012/10/30 11:12:44, bac wrote:
> A comment here describing the use and purpose of 'subscriptions' would
be really
> helpful. I figured out but only when I got to the end of this file.

Done.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode15
app/views/charm-search.js:15: icon = ev.currentTarget.one('i');
On 2012/10/30 11:12:44, bac wrote:
> Is this line really repeated?

Heh, yes. The duplication was in trunk (see lines 14 and 15 at left)
but I did copy it blindly. Fixed, thank you.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode18
app/views/charm-search.js:18: icon.replaceClass('icon-chevron-right',
'icon-chevron-down');
On 2012/10/30 11:12:44, bac wrote:
> -right should be -up to match the visual design. If you think the
design is
> wrong then the charm panel section headers need to change too.

I believe I've changed everything as desired.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode438
app/views/charm-search.js:438: container =
Y.Node.create('<div></div>').setAttribute(
On 2012/10/30 11:12:44, bac wrote:
> Any tag created by Y.Node.create can be self-closing and it does the
right
> thing. So

> Y.Node.create('<div />')

> works and is more readable, though you may argue misleading. I see we
do both.
> Just mentioning it.

Yeah, I know. I felt mixed about the short form. I ended up using it.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode439
app/views/charm-search.js:439: 'id', 'juju-search-charm-panel'),
On 2012/10/30 11:12:44, bac wrote:
> Indent more

Done.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode518
app/views/charm-search.js:518: headerSpan.setStyle('borderLeftColor',
'lightgray');
On 2012/10/30 11:12:44, bac wrote:
> Why isn't this styling in CSS?

We talked about the explanation, but I moved it to a class.

https://codereview.appspot.com/6775058/diff/18001/app/views/charm-search.js#newcode534
app/views/charm-search.js:534: if (isPopupVisible) {
On 2012/10/30 11:12:44, bac wrote:
> These names with 'Popup' are historical and now inaccurate. Other
places you
> refer to the panel (calculatePanelPosition). The use of both is
confusing.

Yeah...this comment led to a lot of changes :-) I corrected Panel ->
Popup and I also corrected many instances of search -> panel, because
that is also wrong.

https://codereview.appspot.com/6775058/

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

*** Submitted:

Convert charm popup to full side display panel

This makes relatively small changes to adjust the existing charm store
panels to be displayed down the full right side, per design specs. It
does not touch the display of the panels themselves, other than to
adjust the scrolling.

Per reviews, some name normalization occurred as well (e.g., "panel"
became "popup" in various names).

R=thiago.veronezi, bac
CC=
https://codereview.appspot.com/6775058

https://codereview.appspot.com/6775058/

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