Merge lp:~hatch/juju-gui/highlight-bundle-service into lp:juju-gui/experimental
- highlight-bundle-service
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 1167 |
Proposed branch: | lp:~hatch/juju-gui/highlight-bundle-service |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
354 lines (+313/-0) 3 files modified
app/assets/images/non-sprites/service-highlight.svg (+275/-0) app/views/topology/bundle.js (+28/-0) lib/views/browser/bundle-panel.less (+10/-0) |
To merge this branch: | bzr merge lp:~hatch/juju-gui/highlight-bundle-service |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Commit message
Description of the change
Adds highlight to service icon in bundle topo
When viewing a bundle topology it will now auto select
a service icon which now adds a highlight svg behind
the icon and pops open the name panel.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeff Pihach (hatch) wrote : | # |
- 1169. By Jeff Pihach
-
some cleanups
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeff Pihach (hatch) wrote : | # |
Please take a look.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gary Poster (gary) wrote : | # |
Code LGTM with ultra trivial. I asked you to investigate using the
official Juju squircle SVG
(https:/
me know to do so.
https:/
File app/views/
https:/
app/views/
I asked on IRC whether we ought to use a ref, but Makyo said it wouldn't
buy us much. Cool.
https:/
app/views/
of the d3 selection
The grammar police! <RRrrrraaaarrrR
Add a period. ;-)
https:/
app/views/
isn't in the DOM we don't want
The grammar police let the missing comma slide, but they consider a
citation.
- 1170. By Jeff Pihach
-
updated service highlight svg
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gary Poster (gary) wrote : | # |
QAOK. Looks great! Thanks! I only see aliasing issues with the
default icons; maybe the designers have an idea about that.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeff Pihach (hatch) wrote : | # |
Thanks for the review!
https:/
File app/views/
https:/
app/views/
of the d3 selection
haha done
https:/
app/views/
isn't in the DOM we don't want
On 2013/10/30 20:36:53, gary.poster wrote:
> The grammar police let the missing comma slide, but they consider a
citation.
Done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeff Pihach (hatch) wrote : | # |
*** Submitted:
Adds highlight to service icon in bundle topo
When viewing a bundle topology it will now auto select
a service icon which now adds a highlight svg behind
the icon and pops open the name panel.
R=gary.poster
CC=
https:/
Preview Diff
1 | === added file 'app/assets/images/non-sprites/service-highlight.svg' |
2 | --- app/assets/images/non-sprites/service-highlight.svg 1970-01-01 00:00:00 +0000 |
3 | +++ app/assets/images/non-sprites/service-highlight.svg 2013-10-30 20:49:48 +0000 |
4 | @@ -0,0 +1,275 @@ |
5 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
6 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
7 | + |
8 | +<svg |
9 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
10 | + xmlns:cc="http://creativecommons.org/ns#" |
11 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
12 | + xmlns:svg="http://www.w3.org/2000/svg" |
13 | + xmlns="http://www.w3.org/2000/svg" |
14 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
15 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
16 | + width="101" |
17 | + height="101" |
18 | + id="svg6517" |
19 | + version="1.1" |
20 | + inkscape:version="0.48.2 r9819" |
21 | + sodipodi:docname="service-highlight.svg"> |
22 | + <defs |
23 | + id="defs6519"> |
24 | + <linearGradient |
25 | + id="Background"> |
26 | + <stop |
27 | + id="stop4178" |
28 | + offset="0" |
29 | + style="stop-color:#b8b8b8;stop-opacity:1" /> |
30 | + <stop |
31 | + id="stop4180" |
32 | + offset="1" |
33 | + style="stop-color:#c9c9c9;stop-opacity:1" /> |
34 | + </linearGradient> |
35 | + <filter |
36 | + inkscape:label="Inner Shadow" |
37 | + id="filter1121" |
38 | + color-interpolation-filters="sRGB"> |
39 | + <feFlood |
40 | + flood-opacity="0.59999999999999998" |
41 | + flood-color="rgb(0,0,0)" |
42 | + result="flood" |
43 | + id="feFlood1123" /> |
44 | + <feComposite |
45 | + in="flood" |
46 | + in2="SourceGraphic" |
47 | + operator="out" |
48 | + result="composite1" |
49 | + id="feComposite1125" /> |
50 | + <feGaussianBlur |
51 | + in="composite1" |
52 | + stdDeviation="1" |
53 | + result="blur" |
54 | + id="feGaussianBlur1127" /> |
55 | + <feOffset |
56 | + dx="0" |
57 | + dy="2" |
58 | + result="offset" |
59 | + id="feOffset1129" /> |
60 | + <feComposite |
61 | + in="offset" |
62 | + in2="SourceGraphic" |
63 | + operator="atop" |
64 | + result="composite2" |
65 | + id="feComposite1131" /> |
66 | + </filter> |
67 | + <filter |
68 | + inkscape:label="Drop Shadow" |
69 | + id="filter950" |
70 | + color-interpolation-filters="sRGB"> |
71 | + <feFlood |
72 | + flood-opacity="0.25" |
73 | + flood-color="rgb(0,0,0)" |
74 | + result="flood" |
75 | + id="feFlood952" /> |
76 | + <feComposite |
77 | + in="flood" |
78 | + in2="SourceGraphic" |
79 | + operator="in" |
80 | + result="composite1" |
81 | + id="feComposite954" /> |
82 | + <feGaussianBlur |
83 | + in="composite1" |
84 | + stdDeviation="1" |
85 | + result="blur" |
86 | + id="feGaussianBlur956" /> |
87 | + <feOffset |
88 | + dx="0" |
89 | + dy="1" |
90 | + result="offset" |
91 | + id="feOffset958" /> |
92 | + <feComposite |
93 | + in="SourceGraphic" |
94 | + in2="offset" |
95 | + operator="over" |
96 | + result="composite2" |
97 | + id="feComposite960" /> |
98 | + </filter> |
99 | + <clipPath |
100 | + clipPathUnits="userSpaceOnUse" |
101 | + id="clipPath873"> |
102 | + <g |
103 | + transform="matrix(0,-0.66666667,0.66604479,0,-258.25992,677.00001)" |
104 | + id="g875" |
105 | + inkscape:label="Layer 1" |
106 | + style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"> |
107 | + <path |
108 | + style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline" |
109 | + d="m 46.702703,898.22775 50.594594,0 C 138.16216,898.22775 144,904.06497 144,944.92583 l 0,50.73846 c 0,40.86071 -5.83784,46.69791 -46.702703,46.69791 l -50.594594,0 C 5.8378378,1042.3622 0,1036.525 0,995.66429 l 0,-50.73846 c 0,-40.86086 5.8378378,-46.69808 46.702703,-46.69808 z" |
110 | + id="path877" |
111 | + inkscape:connector-curvature="0" |
112 | + sodipodi:nodetypes="sssssssss" /> |
113 | + </g> |
114 | + </clipPath> |
115 | + <filter |
116 | + inkscape:collect="always" |
117 | + id="filter891" |
118 | + inkscape:label="Badge Shadow" |
119 | + color-interpolation-filters="sRGB"> |
120 | + <feGaussianBlur |
121 | + inkscape:collect="always" |
122 | + stdDeviation="0.71999962" |
123 | + id="feGaussianBlur893" /> |
124 | + </filter> |
125 | + </defs> |
126 | + <sodipodi:namedview |
127 | + id="base" |
128 | + pagecolor="#ffffff" |
129 | + bordercolor="#666666" |
130 | + borderopacity="1.0" |
131 | + inkscape:pageopacity="0.0" |
132 | + inkscape:pageshadow="2" |
133 | + inkscape:zoom="4.0745362" |
134 | + inkscape:cx="-22.425856" |
135 | + inkscape:cy="51.518179" |
136 | + inkscape:document-units="px" |
137 | + inkscape:current-layer="layer1" |
138 | + showgrid="true" |
139 | + fit-margin-top="0" |
140 | + fit-margin-left="0" |
141 | + fit-margin-right="0" |
142 | + fit-margin-bottom="0" |
143 | + inkscape:window-width="1557" |
144 | + inkscape:window-height="957" |
145 | + inkscape:window-x="322" |
146 | + inkscape:window-y="241" |
147 | + inkscape:window-maximized="0" |
148 | + showborder="true" |
149 | + showguides="true" |
150 | + inkscape:guide-bbox="true" |
151 | + inkscape:showpageshadow="false"> |
152 | + <inkscape:grid |
153 | + type="xygrid" |
154 | + id="grid821" |
155 | + empspacing="5" |
156 | + visible="true" |
157 | + enabled="true" |
158 | + snapvisiblegridlinesonly="true" /> |
159 | + <sodipodi:guide |
160 | + orientation="1,0" |
161 | + position="18.5,50.50001" |
162 | + id="guide823" /> |
163 | + <sodipodi:guide |
164 | + orientation="0,1" |
165 | + position="66.5,82.50001" |
166 | + id="guide825" /> |
167 | + <sodipodi:guide |
168 | + orientation="1,0" |
169 | + position="82.5,42.50001" |
170 | + id="guide827" /> |
171 | + <sodipodi:guide |
172 | + orientation="0,1" |
173 | + position="66.5,18.50001" |
174 | + id="guide829" /> |
175 | + </sodipodi:namedview> |
176 | + <metadata |
177 | + id="metadata6522"> |
178 | + <rdf:RDF> |
179 | + <cc:Work |
180 | + rdf:about=""> |
181 | + <dc:format>image/svg+xml</dc:format> |
182 | + <dc:type |
183 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
184 | + <dc:title></dc:title> |
185 | + </cc:Work> |
186 | + </rdf:RDF> |
187 | + </metadata> |
188 | + <g |
189 | + inkscape:label="BACKGROUND" |
190 | + inkscape:groupmode="layer" |
191 | + id="layer1" |
192 | + transform="translate(270.5,-632.79077)" |
193 | + style="display:inline"> |
194 | + <path |
195 | + style="fill:none;stroke:#dd4814;stroke-width:5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" |
196 | + d="m -268,700.15563 0,-33.72973 c 0,-27.24324 3.88785,-31.13513 31.10302,-31.13513 l 33.79408,0 c 27.21507,0 31.1029,3.89189 31.1029,31.13513 l 0,33.72973 c 0,27.24325 -3.88783,31.13514 -31.1029,31.13514 l -33.79408,0 c -27.21517,0 -31.10302,-3.89189 -31.10302,-31.13514 z" |
197 | + id="path6455" |
198 | + inkscape:connector-curvature="0" |
199 | + sodipodi:nodetypes="sssssssss" /> |
200 | + </g> |
201 | + <g |
202 | + inkscape:groupmode="layer" |
203 | + id="layer3" |
204 | + inkscape:label="PLACE YOUR PICTOGRAM HERE" |
205 | + style="display:inline" |
206 | + transform="translate(2.5,2.49999)" /> |
207 | + <g |
208 | + inkscape:groupmode="layer" |
209 | + id="layer2" |
210 | + inkscape:label="BADGE" |
211 | + style="display:none" |
212 | + sodipodi:insensitive="true" |
213 | + transform="translate(2.5,2.49999)"> |
214 | + <g |
215 | + style="display:inline" |
216 | + transform="translate(-340.00001,-581)" |
217 | + id="g4394" |
218 | + clip-path="none"> |
219 | + <g |
220 | + id="g855"> |
221 | + <g |
222 | + inkscape:groupmode="maskhelper" |
223 | + id="g870" |
224 | + clip-path="url(#clipPath873)" |
225 | + style="opacity:0.6;filter:url(#filter891)"> |
226 | + <path |
227 | + transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-237.54282)" |
228 | + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" |
229 | + sodipodi:ry="12" |
230 | + sodipodi:rx="12" |
231 | + sodipodi:cy="552.36218" |
232 | + sodipodi:cx="252" |
233 | + id="path844" |
234 | + style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
235 | + sodipodi:type="arc" /> |
236 | + </g> |
237 | + <g |
238 | + id="g862"> |
239 | + <path |
240 | + sodipodi:type="arc" |
241 | + style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
242 | + id="path4398" |
243 | + sodipodi:cx="252" |
244 | + sodipodi:cy="552.36218" |
245 | + sodipodi:rx="12" |
246 | + sodipodi:ry="12" |
247 | + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" |
248 | + transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-238.54282)" /> |
249 | + <path |
250 | + transform="matrix(1.25,0,0,1.25,33,-100.45273)" |
251 | + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" |
252 | + sodipodi:ry="12" |
253 | + sodipodi:rx="12" |
254 | + sodipodi:cy="552.36218" |
255 | + sodipodi:cx="252" |
256 | + id="path4400" |
257 | + style="color:#000000;fill:#dd4814;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
258 | + sodipodi:type="arc" /> |
259 | + <path |
260 | + sodipodi:type="star" |
261 | + style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
262 | + id="path4459" |
263 | + sodipodi:sides="5" |
264 | + sodipodi:cx="666.19574" |
265 | + sodipodi:cy="589.50385" |
266 | + sodipodi:r1="7.2431178" |
267 | + sodipodi:r2="4.3458705" |
268 | + sodipodi:arg1="1.0471976" |
269 | + sodipodi:arg2="1.6755161" |
270 | + inkscape:flatsided="false" |
271 | + inkscape:rounded="0.1" |
272 | + inkscape:randomized="0" |
273 | + d="m 669.8173,595.77657 c -0.39132,0.22593 -3.62645,-1.90343 -4.07583,-1.95066 -0.44938,-0.0472 -4.05653,1.36297 -4.39232,1.06062 -0.3358,-0.30235 0.68963,-4.03715 0.59569,-4.47913 -0.0939,-0.44198 -2.5498,-3.43681 -2.36602,-3.8496 0.18379,-0.41279 4.05267,-0.59166 4.44398,-0.81759 0.39132,-0.22593 2.48067,-3.48704 2.93005,-3.4398 0.44938,0.0472 1.81505,3.67147 2.15084,3.97382 0.3358,0.30236 4.08294,1.2817 4.17689,1.72369 0.0939,0.44198 -2.9309,2.86076 -3.11469,3.27355 -0.18379,0.41279 0.0427,4.27917 -0.34859,4.5051 z" |
274 | + transform="matrix(1.511423,-0.16366377,0.16366377,1.511423,-755.37346,-191.93651)" /> |
275 | + </g> |
276 | + </g> |
277 | + </g> |
278 | + </g> |
279 | +</svg> |
280 | |
281 | === modified file 'app/views/topology/bundle.js' |
282 | --- app/views/topology/bundle.js 2013-10-24 21:03:02 +0000 |
283 | +++ app/views/topology/bundle.js 2013-10-30 20:49:48 +0000 |
284 | @@ -72,6 +72,11 @@ |
285 | num_units: box.units.size(), |
286 | settings: box.config |
287 | }); |
288 | + |
289 | + var topo = self.get('component'); |
290 | + topo.vis.selectAll('.selected').classed('selected', false); |
291 | + d3.select(this).classed('selected', true); |
292 | + |
293 | details.setHTML(templates['bundle-service-details'](context)); |
294 | details.show(); |
295 | }, |
296 | @@ -131,6 +136,16 @@ |
297 | @method createServiceNode |
298 | */ |
299 | createServiceNode: function(node, self) { |
300 | + // Add the highlight svg image to each element |
301 | + node.append('image') |
302 | + .attr({ |
303 | + class: 'highlight', |
304 | + width: SERVICE_SIZE + 10, |
305 | + height: SERVICE_SIZE + 10, |
306 | + transform: 'translate(-5,-5)', |
307 | + 'xlink:href': |
308 | + '/juju-ui/assets/images/non-sprites/service-highlight.svg' |
309 | + }); |
310 | node.append('image') |
311 | .classed('service-icon', true) |
312 | .attr({ |
313 | @@ -417,6 +432,19 @@ |
314 | BundleTopology.prototype.render = function() { |
315 | this.topology.render(); |
316 | this.zoomToFit(); |
317 | + // Pass the first service data to the showServiceDetails to select it. |
318 | + var topo = this.topology; |
319 | + var firstService = topo.vis.select('.service'); |
320 | + var bundleModule = topo.modules.BundleModule; |
321 | + // We need the actual svg dom node out of the d3 selection |
322 | + // If for whatever reason this node isn't in the DOM we don't want |
323 | + // to try and select it and have the whole application fall over. |
324 | + var firstServiceNode = firstService.node(); |
325 | + if (firstServiceNode) { |
326 | + bundleModule.showServiceDetails.call( |
327 | + firstServiceNode, firstService.datum(), bundleModule); |
328 | + } |
329 | + |
330 | return this; |
331 | }; |
332 | |
333 | |
334 | === modified file 'lib/views/browser/bundle-panel.less' |
335 | --- lib/views/browser/bundle-panel.less 2013-10-21 23:24:39 +0000 |
336 | +++ lib/views/browser/bundle-panel.less 2013-10-30 20:49:48 +0000 |
337 | @@ -1,7 +1,17 @@ |
338 | #subapp-browser .bundle { |
339 | + |
340 | #bws-bundle { |
341 | position: relative; |
342 | padding: 10px; |
343 | + .service { |
344 | + cursor: pointer; |
345 | + &.selected .highlight { |
346 | + display: block; |
347 | + } |
348 | + } |
349 | + .highlight { |
350 | + display: none; |
351 | + } |
352 | } |
353 | .topo-info { |
354 | @box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); |
Reviewers: mp+193316_ code.launchpad. net,
Message:
Please take a look.
Description:
Adds highlight to service icon in bundle topo
When viewing a bundle topology it will now auto select
a service icon which now adds a highlight svg behind
the icon and pops open the name panel.
The SVG for this highlight will need to be requested
from design. The one used is just a temporary icon.
https:/ /code.launchpad .net/~hatch/ juju-gui/ highlight- bundle- service/ +merge/ 193316
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/19920043/
Affected files (+88, -0 lines): images/ non-sprites/ service- highlight. svg topology/ bundle. js browser/ bundle- panel.less
A [revision details]
A app/assets/
M app/views/
M lib/views/
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/ bundle. js topology/ bundle. js' topology/ bundle. js 2013-10-24 21:03:02 +0000 topology/ bundle. js 2013-10-30 19:11:22 +0000
num_ units: box.units.size(), 'component' ); selectAll( '.selected' ).classed( 'selected' , false); this).classed( 'selected' , true);
details. setHTML( templates[ 'bundle- service- details' ](context) );
details. show(); viceNode: function(node, self) { 'image' ) ui/assets/ images/ non-sprites/ service- highlight. svg'
node.append( 'image' )
.classed( 'service- icon', true) ogy.prototype. render = function() { topology. render( ); zoomToFit( ); select( '.service' ); BundleModule; node()) { showServiceDeta ils.call( node(), firstService. datum() , bundleModule);
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -72,6 +72,11 @@
settings: box.config
});
+
+ var topo = self.get(
+ topo.vis.
+ d3.select(
+
},
@@ -131,6 +136,16 @@
@method createServiceNode
*/
createSer
+ // Add the highlight svg image to each element
+ node.append(
+ .attr({
+ class: 'highlight',
+ width: SERVICE_SIZE + 10,
+ height: SERVICE_SIZE + 10,
+ transform: 'translate(-5,-5)',
+ 'xlink:href':
+ '/juju-
+ });
.attr({
@@ -417,6 +432,18 @@
BundleTopol
this.
this.
+ // Pass the first service data to the showServiceDetails to select it.
+ var topo = this.topology;
+ var firstService = topo.vis.
+ var bundleModule = topo.modules.
+ // We need the actual svg dom node out of the d3 selection
+ // If for whatever reason this node isn't in the DOM we don't want
+ // to try and select it and have the whole application fall over.
+ if (firstService.
+ bundleModule.
+ firstService.
+ }
+
return this;
};
Index: lib/views/ browser/ bundle- panel.less browser/ bundle- panel.less' browser/ bundle- panel.less 2013-10-21 23:24:39 +0000 browser/ bundle- panel.less 2013-10-30 17:54:53 +0000
=== modified file 'lib/views/
--- lib/views/
+++ lib/views/
...