Skip to content

Commit bab4849

Browse files
committed
Changes from code review. . .
1 parent f8b2bea commit bab4849

File tree

2 files changed

+51
-52
lines changed

2 files changed

+51
-52
lines changed

src/charts/topology/examples/topology-view.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @restrict E
55
*
66
* @description
7-
* Component for rendering a topology chart. Individual nodes and relationships can be represented with this view. CSS is especially important for rendering the noes and lines. The example inline contains specific examples that can be used to change the icon size and the line type of the relationships.
7+
* Component for rendering a topology chart. Individual nodes and relationships can be represented with this view. CSS is especially important for rendering the nodes and lines. The example inline contains specific examples that can be used to change the icon size and the line type of the relationships.
88
*
99
* In addition; searching, filtering and label visibility is also supported.<br/>
1010
*
@@ -172,11 +172,11 @@
172172
"fontfamily": "FontAwesome"
173173
},
174174
"Host": {
175-
"type": "glyph",
176-
"icon": "",
177-
"fontfamily": "PatternFlyIcons-webfont"
178-
},
179-
"Vm": {
175+
"type": "glyph",
176+
"icon": "",
177+
"fontfamily": "PatternFlyIcons-webfont"
178+
},
179+
"Vm": {
180180
"type": "glyph",
181181
"icon": "",
182182
"fontfamily": "PatternFlyIcons-webfont"
@@ -186,41 +186,41 @@
186186
"icon": "",
187187
"fontfamily": "PatternFlyIcons-webfont"
188188
}
189-
},
189+
},
190190
});
191191
192192
$rootScope.data = datasets[index];
193193
194194
var nodeKinds = {
195-
"ContainerReplicator": true,
196-
"ContainerGroup": true,
197-
"Container": true,
198-
"ContainerNode": true,
199-
"ContainerService": true,
200-
"Host": true,
201-
"Vm": true,
202-
"ContainerRoute": true,
203-
"ContainerManager": true
204-
};
195+
"ContainerReplicator": true,
196+
"ContainerGroup": true,
197+
"Container": true,
198+
"ContainerNode": true,
199+
"ContainerService": true,
200+
"Host": true,
201+
"Vm": true,
202+
"ContainerRoute": true,
203+
"ContainerManager": true
204+
};
205205
206-
$rootScope.kinds = nodeKinds;
206+
$rootScope.kinds = nodeKinds;
207207
208-
var icons = $rootScope.data.icons;
208+
var icons = $rootScope.data.icons;
209209
$scope.nodes = {};
210-
for(var kind in nodeKinds) {
211-
var icon = icons[kind];
212-
$scope.nodes[kind] = {
213-
"name": kind,
214-
"enabled": nodeKinds[kind],
215-
"radius": 16,
216-
"textX": 0,
217-
"textY": 5,
218-
"height": 18,
219-
"width": 18,
220-
"icon": icon.icon,
221-
"fontFamily": icon.fontfamily
222-
};
223-
}
210+
for(var kind in nodeKinds) {
211+
var icon = icons[kind];
212+
$scope.nodes[kind] = {
213+
"name": kind,
214+
"enabled": nodeKinds[kind],
215+
"radius": 16,
216+
"textX": 0,
217+
"textY": 5,
218+
"height": 18,
219+
"width": 18,
220+
"icon": icon.icon,
221+
"fontFamily": icon.fontfamily
222+
};
223+
}
224224
225225
// Individual values can also be set for specific icons
226226
$scope.nodes.ContainerService.textY = 9;

src/charts/topology/topology.component.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ angular.module('patternfly.charts').component('pfTopology', {
2828
ctrl.$onInit = function () {
2929
$element.css("display", "block");
3030
options = {"force": ctrl.force, "radius": ctrl.radius};
31-
//graph = topologyGraph($element[0], notify, options);
3231
ctrl.showLabels = false;
3332

3433
$element.on("$destroy", function () {
@@ -598,27 +597,27 @@ angular.module('patternfly.charts').component('pfTopology', {
598597
}
599598

600599
function getItemStatusClass (d) {
601-
switch (d.item.status) {
602-
case "OK":
603-
case "Active":
604-
case "Available":
605-
case "On":
606-
case "Ready":
607-
case "Running":
608-
case "Succeeded":
609-
case "Valid":
600+
switch (d.item.status.toLowerCase()) {
601+
case "ok":
602+
case "active":
603+
case "available":
604+
case "on":
605+
case "ready":
606+
case "running":
607+
case "succeeded":
608+
case "valid":
610609
return "success";
611-
case "NotReady":
612-
case "Failed":
613-
case "Error":
614-
case "Unreachable":
610+
case "notready":
611+
case "failed":
612+
case "error":
613+
case "unreachable":
615614
return "error";
616-
case 'Warning':
617-
case 'Waiting':
618-
case 'Pending':
615+
case 'warning':
616+
case 'waiting':
617+
case 'pending':
619618
return "warning";
620-
case 'Unknown':
621-
case 'Terminated':
619+
case 'unknown':
620+
case 'terminated':
622621
return "unknown";
623622
}
624623
}

0 commit comments

Comments
 (0)