Merge lp://staging/~bcsaller/juju-gui/svgdefs into lp://staging/juju-gui/experimental

Proposed by Benjamin Saller
Status: Needs review
Proposed branch: lp://staging/~bcsaller/juju-gui/svgdefs
Merge into: lp://staging/juju-gui/experimental
Diff against target: 375 lines (+181/-122)
2 files modified
app/views/topology/service.js (+134/-122)
app/views/topology/topology.js (+47/-0)
To merge this branch: bzr merge lp://staging/~bcsaller/juju-gui/svgdefs
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+174978@code.staging.launchpad.net

Description of the change

SVG Refs + Update refactor

This defines a section of reusable assets in the canvas and take
steps to use those definitions where it makes sense.

Additionally this break the large service update method into smaller
ones.

https://codereview.appspot.com/11343043/

To post a comment you must log in.
Revision history for this message
Benjamin Saller (bcsaller) wrote :

Reviewers: mp+174978_code.launchpad.net,

Message:
Please take a look.

Description:
SVG Refs + Update refactor

This defines a section of reusable assets in the canvas and take
steps to use those definitions where it makes sense.

Additionally this break the large service update method into smaller
ones.

https://code.launchpad.net/~bcsaller/juju-gui/svgdefs/+merge/174978

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M app/views/topology/service.js
   M app/views/topology/topology.js

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

LGTM with one ignorable and one mostly trivial.

https://codereview.appspot.com/11343043/diff/1/app/views/topology/service.js
File app/views/topology/service.js (right):

https://codereview.appspot.com/11343043/diff/1/app/views/topology/service.js#newcode990
app/views/topology/service.js:990: }
<shrug> above 7 lines could be the following, which reads as well or
better to me FWIW.

if (securityBadge) {
   landscapeAsset = '#landscape-restart';
} else if (rebootBadge) {
   landscapeAsset = '#landscape-security';
}

Alternatively 12 lines could be following.

if (landscape.getLandscapeBadge(d.model, 'reboot', 'round')) {
   landscapeAsset = '#landscape-restart';
} else if (
   landscape.getLandscapeBadge(d.model, 'security', 'round')) {
   landscapeAsset = '#landscape-security';
}

As I said, <shrug>, trivial, do what you want, etc.

https://codereview.appspot.com/11343043/diff/1/app/views/topology/service.js#newcode1010
app/views/topology/service.js:1010: existing.attr('xlink:href',
landscapeAsset);
Shouldn't this attr be defined in the "if (existing.empty())" branch
too? It looks like you can simply remove the enclosing "else."

https://codereview.appspot.com/11343043/

Unmerged revisions

841. By Benjamin Saller

lint + minimal docs

840. By Benjamin Saller

fewer requests for landscape assets again

839. By Benjamin Saller

refactor some of service update

838. By Benjamin Saller

defs wip

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