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/
« Back to merge proposal
LGTM with one ignorable and one mostly trivial.
https:/ /codereview. appspot. com/11343043/ diff/1/ app/views/ topology/ service. js topology/ service. js (right):
File app/views/
https:/ /codereview. appspot. com/11343043/ diff/1/ app/views/ topology/ service. js#newcode990 topology/ service. js:990: }
app/views/
<shrug> above 7 lines could be the following, which reads as well or
better to me FWIW.
if (securityBadge) { restart' ; security' ;
landscapeAsset = '#landscape-
} else if (rebootBadge) {
landscapeAsset = '#landscape-
}
Alternatively 12 lines could be following.
if (landscape. getLandscapeBad ge(d.model, 'reboot', 'round')) { restart' ; getLandscapeBad ge(d.model, 'security', 'round')) { security' ;
landscapeAsset = '#landscape-
} else if (
landscape.
landscapeAsset = '#landscape-
}
As I said, <shrug>, trivial, do what you want, etc.
https:/ /codereview. appspot. com/11343043/ diff/1/ app/views/ topology/ service. js#newcode1010 topology/ service. js:1010: existing. attr('xlink: href',
app/views/
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/