ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [2/2] ignite git commit: IGNITE-1920 Fixed chart selection logic.
Date Mon, 16 Nov 2015 15:09:47 GMT
IGNITE-1920 Fixed chart selection logic.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/79eaee2a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/79eaee2a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/79eaee2a

Branch: refs/heads/ignite-843-rc1
Commit: 79eaee2a15406d9e71965edd09e89b89e4299a1f
Parents: 8fa6dc6
Author: vsisko <vsisko@gridgain.com>
Authored: Mon Nov 16 22:09:39 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Nov 16 22:09:39 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js     | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/79eaee2a/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 7aaa2f9..22e927a 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -496,7 +496,7 @@ consoleModule.controller('sqlController',
         paragraph.chartKeyCols = _retainColumns(paragraph.chartColumns, paragraph.chartKeyCols,
_notObjectType, true);
 
         // We could accept only numeric columns for Y axis.
-        paragraph.chartValCols = _retainColumns(paragraph.chartColumns, paragraph.chartValCols,
_numberType, false);
+        paragraph.chartValCols = _retainColumns(paragraph.chartColumns, paragraph.chartValCols,
_numberType, false, paragraph.chartKeyCols);
     };
 
     $scope.toggleSystemColumns = function (paragraph) {
@@ -516,7 +516,7 @@ consoleModule.controller('sqlController',
         });
     };
 
-    function _retainColumns(allCols, curCols, acceptableType, xAxis) {
+    function _retainColumns(allCols, curCols, acceptableType, xAxis, unwantedCols) {
         var retainedCols = [];
 
         var availableCols = xAxis ? allCols : _.filter(allCols, function (col) {
@@ -536,9 +536,17 @@ consoleModule.controller('sqlController',
 
             // If nothing was restored, add first acceptable column.
             if ($common.isEmptyArray(retainedCols)) {
-                var col = _.find(availableCols, function (col) {
-                    return acceptableType(col.type);
-                });
+                var col;
+
+                if (unwantedCols)
+                    col = _.find(availableCols, function (col) {
+                        return !_.find(unwantedCols, {label: col.label}) && acceptableType(col.type);
+                    });
+
+                if (!col)
+                    col = _.find(availableCols, function (col) {
+                        return acceptableType(col.type);
+                    });
 
                 if (col)
                     retainedCols.push(col);


Mime
View raw message