You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/12/29 08:54:10 UTC

ignite git commit: IGNITE-2298 Fixed load metadata.

Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 f08625be0 -> a7d910526


IGNITE-2298 Fixed load metadata.


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

Branch: refs/heads/ignite-843-rc2
Commit: a7d910526bad1c830da031f25b1b11d41141d6af
Parents: f08625b
Author: Andrey <an...@gridgain.com>
Authored: Tue Dec 29 14:54:01 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Dec 29 14:54:01 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/metadata-controller.js    | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7d91052/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 c0d2f59..f89adc2 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
@@ -346,7 +346,7 @@ consoleModule.controller('metadataController', function ($filter, $http, $timeou
             };
 
             // Show load metadata modal.
-            $scope.showLoadMetadataModal = function () {
+            function _showLoadMetadataModal () {
                 $scope.loadMeta = {
                     action: 'connect',
                     schemas: [],
@@ -360,8 +360,8 @@ consoleModule.controller('metadataController', function ($filter, $http, $timeou
                 $scope.loadMeta.action = 'drivers';
                 $scope.loadMeta.loadingOptions = LOADING_JDBC_DRIVERS;
 
-            $agentDownload.awaitAgent(function (result, onSuccess, onException) {
-                loadMetaModal.$promise.then(loadMetaModal.show);
+                $agentDownload.awaitAgent(function (result, onSuccess, onException) {
+                    loadMetaModal.$promise.then(loadMetaModal.show);
 
                     // Get available JDBC drivers via agent.
                     if ($scope.loadMeta.action === 'drivers') {
@@ -428,6 +428,18 @@ consoleModule.controller('metadataController', function ($filter, $http, $timeou
                             });
                     }
                 });
+            }
+
+            // Show load metadata modal.
+            $scope.showLoadMetadataModal = function () {
+                $table.tableReset();
+
+                $common.confirmUnsavedChanges($scope.ui.isDirty(), function () {
+                    if ($scope.ui.isDirty())
+                        $scope.backupItem = $scope.selectedItem ? angular.copy($scope.selectedItem) : prepareNewItem();
+
+                    _showLoadMetadataModal();
+                });
             };
 
             function _loadSchemas() {