Merge lp:~frankban/juju-gui/bug-1075672-icons into lp:juju-gui/experimental

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 237
Proposed branch: lp:~frankban/juju-gui/bug-1075672-icons
Merge into: lp:juju-gui/experimental
Diff against target: 225 lines (+41/-21)
7 files modified
app/index.html (+1/-1)
app/templates/charm-description.handlebars (+5/-5)
app/templates/charm-pre-configuration.handlebars (+1/-1)
app/views/charm-panel.js (+29/-7)
lib/views/stylesheet.less (+2/-1)
test/test_charm_panel.js (+3/-3)
undocumented (+0/-3)
To merge this branch: bzr merge lp:~frankban/juju-gui/bug-1075672-icons
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+133944@code.launchpad.net

Description of the change

Replaced charm panel icons with our assets.

In the charm panel, replaced bootstrap icons with
the ones from our sprite. Also added the back triangle
to the sprite.
This branch also fixes the charm menu chevrons: now they
are correctly replaced on panel open/close.
Added "docstrings" for relevant methods.

https://codereview.appspot.com/6819131/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :
Download full text (10.0 KiB)

Reviewers: mp+133944_code.launchpad.net,

Message:
Please take a look.

Description:
Replaced charm panel icons with our assets.

In the charm panel, replaced bootstrap icons with
the ones from our sprite. Also added the back triangle
to the sprite.
This branch also fixes the charm menu chevrons: now they
are correctly replaced on panel open/close.
Added "docstrings" for relevant methods.

https://code.launchpad.net/~frankban/juju-gui/bug-1075672-icons/+merge/133944

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   A app/assets/images/back_triangle.png
   M app/index.html
   M app/templates/charm-description.handlebars
   M app/templates/charm-pre-configuration.handlebars
   M app/views/charm-panel.js
   M lib/views/stylesheet.less
   M test/test_charm_panel.js
   M undocumented

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 2012-11-07 21:52:54 +0000
+++ app/index.html 2012-11-12 14:46:20 +0000
@@ -51,7 +51,7 @@
                      <span id="charm-search-trigger">
                        <i id="charm-search-icon" class="sprite
charm_icon"></i>
                        Charms
- <i class="icon-chevron-down"></i>
+ <i id="charm-search-chevron" class="sprite
chevron_down"></i>
                      </span>
                      <input type="text" id="charm-search-field"
                       required="required" placeholder="Search for a charm"
/>

Index: app/templates/charm-description.handlebars
=== modified file 'app/templates/charm-description.handlebars'
--- app/templates/charm-description.handlebars 2012-11-07 18:25:14 +0000
+++ app/templates/charm-description.handlebars 2012-11-12 14:46:20 +0000
@@ -1,5 +1,5 @@
  <div>
- <div class="charm-nav-back"><i class="icon-chevron-left"></i> Back</div>
+ <div class="charm-nav-back"><i class="sprite back_triangle"></i>
Back</div>

    <div class="charm-description charm-panel">
      <div id="charm-panel-head">
@@ -12,7 +12,7 @@
      </div>

      <div class="charm-section">
- <h4 class="first"><i class="icon-chevron-down"></i> Description</h4>
+ <h4 class="first"><i class="sprite chevron_up"></i> Description</h4>
        <div class="collapsible">
          <h5>Summary</h5>
          <p>{{summary}}</p>
@@ -33,7 +33,7 @@

      {{#any requires provides}}
      <div class="charm-section">
- <h4><i class="icon-chevron-up"></i> Interfaces</h4>
+ <h4><i class="sprite chevron_down"></i> Interfaces</h4>
        <div class="collapsible">
          {{#if provides}}
          <h5>Provides</h5>
@@ -57,7 +57,7 @@

      {{#if last_change}}
      <div class="charm-section">
- <h4><i class="icon-chevron-up"></i> Change Log</h4>
+ <h4><i class="sprite chevron_down"></i>...

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

Thanks Francesco. I'm concerned about being able to repeatedly open and
close the Charms panel using the top-level twisty.

Otherwise, looks good.

https://codereview.appspot.com/6819131/diff/1/app/templates/charm-description.handlebars
File app/templates/charm-description.handlebars (right):

https://codereview.appspot.com/6819131/diff/1/app/templates/charm-description.handlebars#newcode15
app/templates/charm-description.handlebars:15: <h4 class="first"><i
class="sprite chevron_up"></i> Description</h4>
I find chevron-up vs -down counter intuitive but it matches the visual
design.

Also I note with your branch that after loading I can click on the
Charms icon at the top and have it work exactly once. If I close it I
cannot reopen. Please check that behavior in your branch before
submitting.

Additionally it doesn't look like the chevron twists for the top Charms
label.

https://codereview.appspot.com/6819131/

Revision history for this message
Francesco Banconi (frankban) wrote :

On 2012/11/12 18:28:34, bac wrote:
> Thanks Francesco. I'm concerned about being able to repeatedly open
and close
> the Charms panel using the top-level twisty.

> Otherwise, looks good.

Thanks for the review Brad.

https://codereview.appspot.com/6819131/diff/1/app/templates/charm-description.handlebars
> File app/templates/charm-description.handlebars (right):

https://codereview.appspot.com/6819131/diff/1/app/templates/charm-description.handlebars#newcode15
> app/templates/charm-description.handlebars:15: <h4 class="first"><i
> class="sprite chevron_up"></i> Description</h4>
> I find chevron-up vs -down counter intuitive but it matches the visual
design.

Agreed.

> Also I note with your branch that after loading I can click on the
Charms icon
> at the top and have it work exactly once. If I close it I cannot
reopen.
> Please check that behavior in your branch before submitting.

Works for me locally, after cleaning the browser cache.

> Additionally it doesn't look like the chevron twists for the top
Charms label.

They are correctly replaced here. :-/ I think some kind of cache is
hitting us.

https://codereview.appspot.com/6819131/

Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Replaced charm panel icons with our assets.

In the charm panel, replaced bootstrap icons with
the ones from our sprite. Also added the back triangle
to the sprite.
This branch also fixes the charm menu chevrons: now they
are correctly replaced on panel open/close.
Added "docstrings" for relevant methods.

R=teknico, bac
CC=
https://codereview.appspot.com/6819131

https://codereview.appspot.com/6819131/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'app/assets/images/back_triangle.png'
0Binary files app/assets/images/back_triangle.png 1970-01-01 00:00:00 +0000 and app/assets/images/back_triangle.png 2012-11-12 15:24:20 +0000 differ0Binary files app/assets/images/back_triangle.png 1970-01-01 00:00:00 +0000 and app/assets/images/back_triangle.png 2012-11-12 15:24:20 +0000 differ
=== modified file 'app/index.html'
--- app/index.html 2012-11-07 21:52:54 +0000
+++ app/index.html 2012-11-12 15:24:20 +0000
@@ -51,7 +51,7 @@
51 <span id="charm-search-trigger">51 <span id="charm-search-trigger">
52 <i id="charm-search-icon" class="sprite charm_icon"></i>52 <i id="charm-search-icon" class="sprite charm_icon"></i>
53 Charms53 Charms
54 <i class="icon-chevron-down"></i>54 <i id="charm-search-chevron" class="sprite chevron_down"></i>
55 </span>55 </span>
56 <input type="text" id="charm-search-field"56 <input type="text" id="charm-search-field"
57 required="required" placeholder="Search for a charm" />57 required="required" placeholder="Search for a charm" />
5858
=== modified file 'app/templates/charm-description.handlebars'
--- app/templates/charm-description.handlebars 2012-11-07 18:25:14 +0000
+++ app/templates/charm-description.handlebars 2012-11-12 15:24:20 +0000
@@ -1,5 +1,5 @@
1<div>1<div>
2 <div class="charm-nav-back"><i class="icon-chevron-left"></i> Back</div>2 <div class="charm-nav-back"><i class="sprite back_triangle"></i> Back</div>
33
4 <div class="charm-description charm-panel">4 <div class="charm-description charm-panel">
5 <div id="charm-panel-head">5 <div id="charm-panel-head">
@@ -12,7 +12,7 @@
12 </div>12 </div>
1313
14 <div class="charm-section">14 <div class="charm-section">
15 <h4 class="first"><i class="icon-chevron-down"></i> Description</h4>15 <h4 class="first"><i class="sprite chevron_up"></i> Description</h4>
16 <div class="collapsible">16 <div class="collapsible">
17 <h5>Summary</h5>17 <h5>Summary</h5>
18 <p>{{summary}}</p>18 <p>{{summary}}</p>
@@ -33,7 +33,7 @@
3333
34 {{#any requires provides}}34 {{#any requires provides}}
35 <div class="charm-section">35 <div class="charm-section">
36 <h4><i class="icon-chevron-up"></i> Interfaces</h4>36 <h4><i class="sprite chevron_down"></i> Interfaces</h4>
37 <div class="collapsible">37 <div class="collapsible">
38 {{#if provides}}38 {{#if provides}}
39 <h5>Provides</h5>39 <h5>Provides</h5>
@@ -57,7 +57,7 @@
5757
58 {{#if last_change}}58 {{#if last_change}}
59 <div class="charm-section">59 <div class="charm-section">
60 <h4><i class="icon-chevron-up"></i> Change Log</h4>60 <h4><i class="sprite chevron_down"></i> Change Log</h4>
61 <div class="collapsible">61 <div class="collapsible">
62 {{#with last_change}}62 {{#with last_change}}
63 <h5>Last Change</h5>63 <h5>Last Change</h5>
@@ -71,7 +71,7 @@
7171
72 {{#any requires provides}}72 {{#any requires provides}}
73 <div class="charm-section">73 <div class="charm-section">
74 <h4><i class="icon-chevron-up"></i> Related Charms</h4>74 <h4><i class="sprite chevron_down"></i> Related Charms</h4>
75 <div class="collapsible" id="related-charms">75 <div class="collapsible" id="related-charms">
76 Loading...76 Loading...
77 </div>77 </div>
7878
=== modified file 'app/templates/charm-pre-configuration.handlebars'
--- app/templates/charm-pre-configuration.handlebars 2012-11-09 11:45:00 +0000
+++ app/templates/charm-pre-configuration.handlebars 2012-11-12 15:24:20 +0000
@@ -43,7 +43,7 @@
43 {{#if settings}}43 {{#if settings}}
44 <!-- Service configuration form -->44 <!-- Service configuration form -->
45 <div class="charm-section">45 <div class="charm-section">
46 <h4>Service Settings<i class="icon-chevron-down"></i></h4>46 <h4>Service Settings<i class="sprite chevron_up"></i></h4>
47 <div class="collapsible">47 <div class="collapsible">
48 <div class="config-file-upload control-group">48 <div class="config-file-upload control-group">
49 <input class="config-file-upload-widget" type="file">49 <input class="config-file-upload-widget" type="file">
5050
=== modified file 'app/views/charm-panel.js'
--- app/views/charm-panel.js 2012-11-09 20:51:13 +0000
+++ app/views/charm-panel.js 2012-11-12 15:24:20 +0000
@@ -39,10 +39,10 @@
39 // clientHeight and offsetHeight are not as reliable in tests.39 // clientHeight and offsetHeight are not as reliable in tests.
40 if (parseInt(el.getStyle('height'), 10) === 0) {40 if (parseInt(el.getStyle('height'), 10) === 0) {
41 el.show('sizeIn', {duration: 0.25, width: null});41 el.show('sizeIn', {duration: 0.25, width: null});
42 icon.replaceClass('icon-chevron-up', 'icon-chevron-down');42 icon.replaceClass('chevron_down', 'chevron_up');
43 } else {43 } else {
44 el.hide('sizeOut', {duration: 0.25, width: null});44 el.hide('sizeOut', {duration: 0.25, width: null});
45 icon.replaceClass('icon-chevron-down', 'icon-chevron-up');45 icon.replaceClass('chevron_up', 'chevron_down');
46 }46 }
47 },47 },
48 /**48 /**
@@ -337,7 +337,7 @@
337 charm = this.get('model');337 charm = this.get('model');
338 if (Y.Lang.isValue(charm)) {338 if (Y.Lang.isValue(charm)) {
339 container.setHTML(this.template(charm.getAttrs()));339 container.setHTML(this.template(charm.getAttrs()));
340 container.all('i.icon-chevron-up').each(function(el) {340 container.all('i.chevron_down').each(function(el) {
341 el.ancestor('.charm-section').one('div')341 el.ancestor('.charm-section').one('div')
342 .setStyle('height', '0px');342 .setStyle('height', '0px');
343 });343 });
@@ -881,6 +881,13 @@
881 }881 }
882 });882 });
883883
884 /**
885 * Hide the charm panel.
886 * Set isPanelVisible to false.
887 *
888 * @method hide
889 * @return {undefined} Mutates only.
890 */
884 function hide() {891 function hide() {
885 if (isPanelVisible) {892 if (isPanelVisible) {
886 var headerBox = Y.one('#charm-search-trigger-container'),893 var headerBox = Y.one('#charm-search-trigger-container'),
@@ -893,8 +900,8 @@
893 }900 }
894 container.hide(!testing, {duration: 0.25});901 container.hide(!testing, {duration: 0.25});
895 if (Y.Lang.isValue(trigger)) {902 if (Y.Lang.isValue(trigger)) {
896 trigger.one('i').replaceClass(903 trigger.one('i#charm-search-chevron').replaceClass(
897 'icon-chevron-up', 'icon-chevron-down');904 'chevron_up', 'chevron_down');
898 }905 }
899 isPanelVisible = false;906 isPanelVisible = false;
900 }907 }
@@ -912,6 +919,13 @@
912 }919 }
913 }));920 }));
914921
922 /**
923 * Show the charm panel.
924 * Set isPanelVisible to true.
925 *
926 * @method show
927 * @return {undefined} Mutates only.
928 */
915 function show() {929 function show() {
916 if (!isPanelVisible) {930 if (!isPanelVisible) {
917 var headerBox = Y.one('#charm-search-trigger-container'),931 var headerBox = Y.one('#charm-search-trigger-container'),
@@ -927,11 +941,19 @@
927 isPanelVisible = true;941 isPanelVisible = true;
928 updatePanelPosition();942 updatePanelPosition();
929 if (Y.Lang.isValue(trigger)) {943 if (Y.Lang.isValue(trigger)) {
930 trigger.one('i').replaceClass(944 trigger.one('i#charm-search-chevron').replaceClass(
931 'icon-chevron-down', 'icon-chevron-up');945 'chevron_down', 'chevron_up');
932 }946 }
933 }947 }
934 }948 }
949
950 /**
951 * Show the charm panel if it is hidden, hide it otherwise.
952 *
953 * @method toggle
954 * @param {Object} ev An event object (with a "halt" method).
955 * @return {undefined} Dispatches only.
956 */
935 function toggle(ev) {957 function toggle(ev) {
936 if (Y.Lang.isValue(ev)) {958 if (Y.Lang.isValue(ev)) {
937 // This is important to not have the clickoutside handler immediately959 // This is important to not have the clickoutside handler immediately
938960
=== modified file 'lib/views/stylesheet.less'
--- lib/views/stylesheet.less 2012-11-09 14:30:56 +0000
+++ lib/views/stylesheet.less 2012-11-12 15:24:20 +0000
@@ -852,7 +852,7 @@
852 color: @charm-panel-deploy-button-color;852 color: @charm-panel-deploy-button-color;
853 cursor: pointer;853 cursor: pointer;
854 font-size: 14px;854 font-size: 14px;
855 padding: 7px 4px;855 padding: 7px @charm-panel-padding-left;
856 }856 }
857 .charm-panel {857 .charm-panel {
858 background-color: @charm-panel-background-color;858 background-color: @charm-panel-background-color;
@@ -875,6 +875,7 @@
875 padding: 8px @charm-panel-padding-left;875 padding: 8px @charm-panel-padding-left;
876 i {876 i {
877 float: right;877 float: right;
878 margin-top: 8px;
878 }879 }
879 &.first {880 &.first {
880 border-top: 1px solid @charm-paneel-border-top-color;881 border-top: 1px solid @charm-paneel-border-top-color;
881882
=== modified file 'test/test_charm_panel.js'
--- test/test_charm_panel.js 2012-11-07 18:36:31 +0000
+++ test/test_charm_panel.js 2012-11-12 15:24:20 +0000
@@ -266,12 +266,12 @@
266 // We use the last change div.266 // We use the last change div.
267 section_container = html.one('div.charm-section:last-child');267 section_container = html.one('div.charm-section:last-child');
268 section_container.one('div').getStyle('height').should.equal('0px');268 section_container.one('div').getStyle('height').should.equal('0px');
269 assert(section_container.one('h4 i').hasClass('icon-chevron-up'));269 assert(section_container.one('h4 i').hasClass('chevron_down'));
270 section_container.one('h4').simulate('click');270 section_container.one('h4').simulate('click');
271 assert(section_container.one('h4 i').hasClass('icon-chevron-down'));271 assert(section_container.one('h4 i').hasClass('chevron_up'));
272 section_container.one('div').getStyle('height').should.not.equal('0px');272 section_container.one('div').getStyle('height').should.not.equal('0px');
273 section_container.one('h4').simulate('click');273 section_container.one('h4').simulate('click');
274 assert(section_container.one('h4 i').hasClass('icon-chevron-up'));274 assert(section_container.one('h4 i').hasClass('chevron_down'));
275 // The transition is still running, so we can't check display.275 // The transition is still running, so we can't check display.
276 });276 });
277277
278278
=== modified file 'undocumented'
--- undocumented 2012-11-09 11:45:00 +0000
+++ undocumented 2012-11-12 15:24:20 +0000
@@ -68,7 +68,6 @@
68app/views/charm-panel.js calculatePanelPosition68app/views/charm-panel.js calculatePanelPosition
69app/views/charm-panel.js createInstance69app/views/charm-panel.js createInstance
70app/views/charm-panel.js getInstance70app/views/charm-panel.js getInstance
71app/views/charm-panel.js hide
72app/views/charm-panel.js hideDescription71app/views/charm-panel.js hideDescription
73app/views/charm-panel.js initializer72app/views/charm-panel.js initializer
74app/views/charm-panel.js killInstance73app/views/charm-panel.js killInstance
@@ -79,10 +78,8 @@
79app/views/charm-panel.js setDefaultSeries78app/views/charm-panel.js setDefaultSeries
80app/views/charm-panel.js setPanel79app/views/charm-panel.js setPanel
81app/views/charm-panel.js setupOverlay80app/views/charm-panel.js setupOverlay
82app/views/charm-panel.js show
83app/views/charm-panel.js showConfiguration81app/views/charm-panel.js showConfiguration
84app/views/charm-panel.js showDescription82app/views/charm-panel.js showDescription
85app/views/charm-panel.js toggle
86app/views/charm-panel.js updatePanelPosition83app/views/charm-panel.js updatePanelPosition
87app/views/charm.js _deployCallback84app/views/charm.js _deployCallback
88app/views/charm.js initializer85app/views/charm.js initializer

Subscribers

People subscribed via source and target branches