ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [11/50] ignite git commit: IGNITE-2499 WIP fix for delayed controls creation + validation.
Date Wed, 03 Feb 2016 10:56:36 GMT
IGNITE-2499 WIP fix for delayed controls creation + validation.


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

Branch: refs/heads/ignite-843-rc3
Commit: 3f62be50a8a58e3469b92a79c56240387b87be25
Parents: 16da1d8
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Sat Jan 30 00:53:48 2016 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Sat Jan 30 00:53:48 2016 +0700

----------------------------------------------------------------------
 .../modules/Form/validator/unique.directive.js  |  2 +-
 .../main/js/controllers/clusters-controller.js  |  6 ++---
 .../src/main/js/controllers/common-module.js    | 28 +++++++++++++-------
 3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3f62be50/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
b/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
index 77c9e62..8074071 100644
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
+++ b/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
@@ -28,7 +28,7 @@ export default ['igniteUnique', ['$parse', ($parse) => {
             if (!arr || !arr.length || !~(idx = arr.indexOf(value))) {
                 return true;
             }
-            
+
             if (typeof scope.$index === 'number' && scope.$index === idx) {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3f62be50/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index be87644..8eb6c9c 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -494,10 +494,10 @@ consoleModule.controller('clustersController', function ($http, $timeout,
$scope
 
             var swapKind = item.swapSpaceSpi && item.swapSpaceSpi.kind;
 
-            if ($common.isDefined(swapKind)) {
+            if (swapKind && item.swapSpaceSpi[swapKind]) {
                 var sparsity = item.swapSpaceSpi[swapKind].maximumSparsity;
 
-                if (sparsity < 0 || sparsity >= 1)
+                if ($common.isDefined(sparsity) && (sparsity < 0 || sparsity >=
1))
                     return showPopoverMessage($scope.ui, 'swap', 'maximumSparsity', 'Maximum
sparsity should be more or equal 0 and less than 1');
             }
 
@@ -509,7 +509,7 @@ consoleModule.controller('clustersController', function ($http, $timeout,
$scope
                     return showPopoverMessage($scope.ui, 'sslConfiguration', 'sslConfiguration-title',
'Trust storage file or managers should be configured');
             }
 
-            if (!item.swapSpaceSpi || !item.swapSpaceSpi.kind && item.caches) {
+            if (!swapKind && item.caches) {
                 for (var i = 0; i < item.caches.length; i++) {
                     var idx = $scope.indexOfCache(item.caches[i]);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3f62be50/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index f29928d..eeb6924 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -565,8 +565,11 @@ consoleModule.service('$common', [
 
         function ensureActivePanel(ui, id, focusId) {
             if (ui) {
-                var idx = _.findIndex($('div.panel-collapse'), function(pnl) {
-                    return pnl.id === id;
+                var headings = $('div.panel-heading');
+                var collapses = $('div.panel-collapse');
+
+                var idx = _.findIndex(collapses, function(collapse) {
+                    return collapse.id === id;
                 });
 
                 if (idx >= 0) {
@@ -584,6 +587,11 @@ consoleModule.service('$common', [
 
                         ui.activePanels = newActivePanels;
                     }
+
+                    if (!collapses[idx].firstElementChild)
+                        $timeout(function () {
+                            headings[idx].click();
+                        });
                 }
 
                 if (isDefined(focusId))
@@ -592,20 +600,22 @@ consoleModule.service('$common', [
         }
 
         function showPopoverMessage(ui, panelId, id, message, showTime) {
+            if (popover)
+                popover.hide();
+
             ensureActivePanel(ui, panelId, id);
 
             var el = $('body').find('#' + id);
 
-            if (popover)
-                popover.hide();
+            if (el && el.length > 0) {
+                var newPopover = $popover(el, {content: message});
 
-            var newPopover = $popover(el, {content: message});
+                popover = newPopover;
 
-            popover = newPopover;
+                $timeout(function () { newPopover.$promise.then(newPopover.show); }, 400);
 
-            $timeout(function () { newPopover.$promise.then(newPopover.show); }, 400);
-
-            $timeout(function () { newPopover.hide(); }, showTime ? showTime : 5000);
+                $timeout(function () { newPopover.hide(); }, showTime ? showTime : 5000);
+            }
 
             return false;
         }


Mime
View raw message