ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-843 implemented creation of new item by clicking on "add" link.
Date Tue, 22 Sep 2015 07:57:55 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 b4fe39a05 -> 3a4f34b3b


IGNITE-843 implemented creation of new item by clicking on "add" link.


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

Branch: refs/heads/ignite-843
Commit: 346891540936c4acc5a28e4b779c882007fa3f9d
Parents: b4fe39a
Author: vsisko <vsisko@gridgain.com>
Authored: Tue Sep 22 14:55:58 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Sep 22 14:55:58 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    | 34 +++++++++++---------
 .../main/js/controllers/clusters-controller.js  | 34 +++++++++++---------
 .../src/main/js/controllers/common-module.js    | 16 +++++++--
 .../main/js/controllers/metadata-controller.js  | 34 +++++++++++---------
 .../src/main/js/controllers/models/caches.json  |  4 +--
 .../main/js/controllers/models/clusters.json    |  2 +-
 .../main/js/controllers/models/metadata.json    |  2 +-
 .../main/js/controllers/profile-controller.js   |  1 -
 8 files changed, 75 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index d616900..1f22e37 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -245,24 +245,28 @@ controlCenterModule.controller('cachesController', [
                             $scope.general = data.general;
                             $scope.advanced = data.advanced;
 
-                            var lastSelectedCache = angular.fromJson(sessionStorage.lastSelectedCache);
-
-                            if (lastSelectedCache) {
-                                var idx = _.findIndex($scope.caches, function (cache) {
-                                    return cache._id == lastSelectedCache;
-                                });
-
-                                if (idx >= 0)
-                                    $scope.selectItem($scope.caches[idx]);
-                                else {
-                                    sessionStorage.removeItem('lastSelectedCache');
+                            if ($common.getQueryVariable('new'))
+                                $scope.createItem();
+                            else {
+                                var lastSelectedCache = angular.fromJson(sessionStorage.lastSelectedCache);
+
+                                if (lastSelectedCache) {
+                                    var idx = _.findIndex($scope.caches, function (cache)
{
+                                        return cache._id == lastSelectedCache;
+                                    });
+
+                                    if (idx >= 0)
+                                        $scope.selectItem($scope.caches[idx]);
+                                    else {
+                                        sessionStorage.removeItem('lastSelectedCache');
+
+                                        selectFirstItem();
+                                    }
 
-                                    selectFirstItem();
                                 }
-
+                                else
+                                    selectFirstItem();
                             }
-                            else
-                                selectFirstItem();
 
                             $timeout(function() {
                                 $scope.ui.markPristineHard();

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/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 f79b32e..217fdf8 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
@@ -171,23 +171,27 @@ controlCenterModule.controller('clustersController', ['$scope', '$controller',
'
                         $scope.advanced = data.advanced;
 
 
-                        var lastSelectedCluster = angular.fromJson(sessionStorage.lastSelectedCluster);
-
-                        if (lastSelectedCluster) {
-                            var idx = _.findIndex($scope.clusters, function (cluster) {
-                                return cluster._id == lastSelectedCluster;
-                            });
-
-                            if (idx >= 0)
-                                $scope.selectItem($scope.clusters[idx]);
-                            else {
-                                sessionStorage.removeItem('lastSelectedCluster');
-
-                                selectFirstItem();
+                        if ($common.getQueryVariable('new'))
+                            $scope.createItem();
+                        else {
+                            var lastSelectedCluster = angular.fromJson(sessionStorage.lastSelectedCluster);
+
+                            if (lastSelectedCluster) {
+                                var idx = _.findIndex($scope.clusters, function (cluster)
{
+                                    return cluster._id == lastSelectedCluster;
+                                });
+
+                                if (idx >= 0)
+                                    $scope.selectItem($scope.clusters[idx]);
+                                else {
+                                    sessionStorage.removeItem('lastSelectedCluster');
+
+                                    selectFirstItem();
+                                }
                             }
+                            else
+                                selectFirstItem();
                         }
-                        else
-                            selectFirstItem();
 
                         $timeout(function() {
                             $scope.ui.markPristineHard();

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/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 eaf4c63..90b9d04 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
@@ -850,8 +850,20 @@ controlCenterModule.service('$common', [
                     }
                 };
             },
-            copyToClipboard: function(text) {
-                window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
+            getQueryVariable: function(name) {
+                var attrs = window.location.search.substring(1).split("&");
+
+                var attr = _.find(attrs, function(attr) {
+                    return attr == name || (attr.indexOf('=') >= 0 && attr.substr(0,
attr.indexOf('=')) == name)
+                });
+
+                if (!isDefined(attr))
+                    return undefined;
+
+                if (attr == name)
+                    return true;
+
+                return attr.substr(attr.indexOf('=') + 1);
             }
         }
     }]);

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index fd758f8..6821e57 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -598,23 +598,27 @@ controlCenterModule.controller('metadataController', [
                             $scope.metadata = data.metadata;
                             $scope.metadataDb = data.metadataDb;
 
-                            var lastSelectedMetadata = angular.fromJson(sessionStorage.lastSelectedMetadata);
-
-                            if (lastSelectedMetadata) {
-                                var idx = _.findIndex($scope.metadatas, function (metadata)
{
-                                    return metadata._id == lastSelectedMetadata;
-                                });
-
-                                if (idx >= 0)
-                                    $scope.selectItem($scope.metadatas[idx]);
-                                else {
-                                    sessionStorage.removeItem('lastSelectedMetadata');
-
-                                    selectFirstItem();
+                            if ($common.getQueryVariable('new'))
+                                $scope.createItem();
+                            else {
+                                var lastSelectedMetadata = angular.fromJson(sessionStorage.lastSelectedMetadata);
+
+                                if (lastSelectedMetadata) {
+                                    var idx = _.findIndex($scope.metadatas, function (metadata)
{
+                                        return metadata._id == lastSelectedMetadata;
+                                    });
+
+                                    if (idx >= 0)
+                                        $scope.selectItem($scope.metadatas[idx]);
+                                    else {
+                                        sessionStorage.removeItem('lastSelectedMetadata');
+
+                                        selectFirstItem();
+                                    }
                                 }
+                                else
+                                    selectFirstItem();
                             }
-                            else
-                                selectFirstItem();
 
                             $timeout(function () {
                                 $scope.$apply();

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index 1d52945..5baf9fd 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -43,7 +43,7 @@
           ],
           "addLink": {
             "label": "Add cluster(s)",
-            "ref": "/configuration/clusters"
+            "ref": "/configuration/clusters?new"
           }
         },
         {
@@ -59,7 +59,7 @@
           ],
           "addLink": {
             "label": "Add metadata(s)",
-            "ref": "/configuration/metadata"
+            "ref": "/configuration/metadata?new"
           }
         },
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/models/clusters.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/clusters.json b/modules/control-center-web/src/main/js/controllers/models/clusters.json
index 3db757a..e07d31f9 100644
--- a/modules/control-center-web/src/main/js/controllers/models/clusters.json
+++ b/modules/control-center-web/src/main/js/controllers/models/clusters.json
@@ -41,7 +41,7 @@
           ],
           "addLink": {
             "label": "Add cache(s)",
-            "ref": "/configuration/caches"
+            "ref": "/configuration/caches?new"
           }
         },
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/models/metadata.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/metadata.json b/modules/control-center-web/src/main/js/controllers/models/metadata.json
index 7e1d493..aecf9c8 100644
--- a/modules/control-center-web/src/main/js/controllers/models/metadata.json
+++ b/modules/control-center-web/src/main/js/controllers/models/metadata.json
@@ -37,7 +37,7 @@
           ],
           "addLink": {
             "label": "Add cache(s)",
-            "ref": "/configuration/caches"
+            "ref": "/configuration/caches?new"
           }
         },
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/34689154/modules/control-center-web/src/main/js/controllers/profile-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/profile-controller.js b/modules/control-center-web/src/main/js/controllers/profile-controller.js
index 1b4374e..15f1d55 100644
--- a/modules/control-center-web/src/main/js/controllers/profile-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/profile-controller.js
@@ -18,7 +18,6 @@
 // Controller for Profile screen.
 controlCenterModule.controller('profileController', ['$scope', '$http', '$common', '$focus',
'$confirm', function ($scope, $http, $common, $focus, $confirm) {
     $scope.profileUser = angular.copy($scope.user);
-    $scope.copyToClipboard = $common.copyToClipboard;
 
     if ($scope.profileUser && !$scope.profileUser.token)
         $scope.profileUser.token = 'No security token. Regenerate please.';


Mime
View raw message