NO TICKET: Fix alphabetical order of monitoring param titles
[osm/UI.git] / skyquake / plugins / launchpad / src / monitoring_params / monitoringParamComponents.js
index 9d52bb8..ab12fcd 100644 (file)
@@ -1,6 +1,6 @@
 /*
 
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,15 +49,16 @@ function Component(node, prop, count, length) {
     //' + String((100/length) - 5) + '%'
     switch(node["widget-type"]) {
       case 'GAUGE':
-        return (
-            <div
-            className="monitoring_params_component"
-            key={prop + '-' + prop.name+ '-' + count}
-            mp={node["mp-id"]}>
-                <div>{node.name}</div>
-                <Components.default.Gauge value={node[valueProperty] || 0} min={numericConstraintsMinPresent ? node['numeric-constraints']['min-value'] : 0} max={numericConstraintsMaxPresent ? node['numeric-constraints']['max-value'] : 100} units={node['units'] || ''} />
-            </div>);
-        break;
+        // Disabled for OSM
+        // return (
+        //     <div
+        //     className="monitoring_params_component"
+        //     key={prop + '-' + prop.name+ '-' + count}
+        //     mp={node["mp-id"]}>
+        //         <div>{node.name}</div>
+        //         <Components.default.Gauge value={node[valueProperty] || 0} min={numericConstraintsMinPresent ? node['numeric-constraints']['min-value'] : 0} max={numericConstraintsMaxPresent ? node['numeric-constraints']['max-value'] : 100} units={node['units'] || ''} />
+        //     </div>);
+        // break;
       case 'TEXTBOX':
       case 'COUNTER':
         var displayValue = 0;
@@ -116,7 +117,9 @@ export default function parseCardObj(obj_list, type) {
       }
       ret.push(html)
     }
-    return ret.sort(function(a, b){
-      return (a.title > b.title) ? -1 : 1;
-    });
+    return ret.sort(function(a,b) {
+            var titleA = a.title && a.title.toUpperCase();
+            var titleB = b.title && b.title.toUpperCase();
+            return (titleA < titleB) ? -1 : (titleA > titleB) ? 1 : 0;
+          });
   }