ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 Fixed clone dialog and XML generation + getting started image.
Date Wed, 10 Feb 2016 03:59:38 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 18d18a60a -> 42f67c633


IGNITE-843 Fixed clone dialog and XML generation + getting started image.


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

Branch: refs/heads/ignite-843-rc2
Commit: 42f67c6333f3263f0ada93c3dc2c515bbeafdf9c
Parents: 18d18a6
Author: vsisko <vsisko@gridgain.com>
Authored: Wed Feb 10 10:59:43 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed Feb 10 10:59:43 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js    |  28 ++++++++++++++-----
 .../main/js/controllers/domains-controller.js   |   6 +++-
 .../main/js/helpers/generator/generator-xml.js  |   4 +--
 .../src/main/js/public/images/ignite-puzzle.png | Bin 197079 -> 71974 bytes
 4 files changed, 27 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/42f67c63/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 d2625d0..758fab0 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
@@ -1251,26 +1251,40 @@ consoleModule.service('$clone', function ($modal, $rootScope, $q)
{
     var scope = $rootScope.$new();
 
     var deferred;
+    var _names = [];
+    var _validator;
 
     scope.ok = function (newName) {
-        deferred.resolve(newName);
+        if (!_validator || _validator(newName)) {
+            deferred.resolve(_nextAvailableName(newName));
 
-        cloneModal.hide();
+            cloneModal.hide();
+        }
     };
 
     var cloneModal = $modal({templateUrl: '/templates/clone.html', scope: scope, placement:
'center', show: false});
 
-    cloneModal.confirm = function (oldName, names) {
+    function _nextAvailableName(name) {
         var num = 1;
 
-        scope.newName = oldName + '(' + num.toString() + ')';
+        var tmpName = name;
 
-        while(_.includes(names, scope.newName)) {
-            num++;
+        while(_.includes(_names, tmpName)) {
+            tmpName = name + '_' + num.toString();
 
-            scope.newName = oldName + '(' + num.toString() + ')';
+            num++;
         }
 
+        return tmpName;
+    }
+
+    cloneModal.confirm = function (oldName, names, validator) {
+        _names = names;
+
+        scope.newName = _nextAvailableName(oldName);
+
+        _validator = validator;
+
         deferred = $q.defer();
 
         cloneModal.show();

http://git-wip-us.apache.org/repos/asf/ignite/blob/42f67c63/modules/control-center-web/src/main/js/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/domains-controller.js b/modules/control-center-web/src/main/js/controllers/domains-controller.js
index 96ee87d..14e5b4b 100644
--- a/modules/control-center-web/src/main/js/controllers/domains-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/domains-controller.js
@@ -1378,10 +1378,14 @@ consoleModule.controller('domainsController', function ($filter, $http,
$timeout
             });
         }
 
+        function _newNameIsValidJavaClass(newName) {
+            return $common.isValidJavaClass('New name for value type', newName, false, 'copy-new-name');
+        }
+
         // Save domain model with new name.
         $scope.cloneItem = function () {
             if ($scope.tableReset(true) && validate($scope.backupItem)) {
-                $clone.confirm($scope.backupItem.valueType, _domainNames()).then(function
(newName) {
+                $clone.confirm($scope.backupItem.valueType, _domainNames(), _newNameIsValidJavaClass).then(function
(newName) {
                     var item = angular.copy($scope.backupItem);
 
                     delete item._id;

http://git-wip-us.apache.org/repos/asf/ignite/blob/42f67c63/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
index 830dca7..7d89026 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -1184,9 +1184,7 @@ $generatorXml.domainStore = function(domain, res) {
 
     res.needEmptyLine = true;
 
-    if (!$dataStructures.isJavaBuiltInClass(domain.keyType))
-        $generatorXml.domainModelDatabaseFields(res, domain, 'keyFields');
-
+    $generatorXml.domainModelDatabaseFields(res, domain, 'keyFields');
     $generatorXml.domainModelDatabaseFields(res, domain, 'valueFields');
 
     res.needEmptyLine = true;

http://git-wip-us.apache.org/repos/asf/ignite/blob/42f67c63/modules/control-center-web/src/main/js/public/images/ignite-puzzle.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/ignite-puzzle.png b/modules/control-center-web/src/main/js/public/images/ignite-puzzle.png
index 712f4bd..0989d29 100644
Binary files a/modules/control-center-web/src/main/js/public/images/ignite-puzzle.png and
b/modules/control-center-web/src/main/js/public/images/ignite-puzzle.png differ


Mime
View raw message