update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / launchpad / src / monitoring_params / monitoringParamComponents.js
index 2990d18..f840b44 100644 (file)
@@ -1,6 +1,6 @@
 /*
 
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,15 +49,15 @@ function Component(node, prop, count, length) {
     //' + String((100/length) - 5) + '%'
     switch(node["widget-type"]) {
       case 'GAUGE':
-        // Disabled for OSM
+        // Disabked fir 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>);
+        //    <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':
@@ -117,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;
+          });
   }