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 2016/01/26 12:08:44 UTC

[2/3] ignite git commit: IGNITE-843 Fixed project structure ui.

IGNITE-843 Fixed project structure ui.


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

Branch: refs/heads/ignite-843-rc3
Commit: ec0f9148d27ab015377b694d2097d1b9c0bc849f
Parents: cbea5f5
Author: Andrey <an...@gridgain.com>
Authored: Tue Jan 26 18:03:23 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Jan 26 18:03:23 2016 +0700

----------------------------------------------------------------------
 .../configuration/summary/summary.controller.js | 63 ++++++++++----------
 .../src/main/js/public/stylesheets/style.scss   |  9 ++-
 .../summary-project-structure.jade              |  2 +-
 3 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ec0f9148/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
index 44da468..a3e29a9 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
@@ -48,13 +48,15 @@ export default [
             injectClasses: {
                 iExpanded: 'fa fa-folder-open-o',
                 iCollapsed: 'fa fa-folder-o'
+            },
+            equality: (node1, node2) => {
+                return node1 === node2;
             }
         };
 
         const javaConfigFolder = {
             type: 'folder',
-            name: 'src-config',
-            title: 'config',
+            name: 'config',
             children: [
                 { type: 'file', name: 'ClientConfigurationFactory.java' },
                 { type: 'file', name: 'ServerConfigurationFactory.java' }
@@ -78,8 +80,7 @@ export default [
             children: [
                 {
                     type: 'folder',
-                    name: 'src-config',
-                    title: 'config',
+                    name: 'config',
                     children: [
                         javaConfigFolder,
                         javaStartupFolder
@@ -132,44 +133,44 @@ export default [
         $scope.tabsServer = { activeTab: 0 };
         $scope.tabsClient = { activeTab: 0 };
 
-        function findFolder(node, name) {
-            if (node.name === name)
+        /**
+         *
+         * @param {Object} node - Tree node.
+         * @param {string[]} path - Path to find.
+         * @returns {Object} Tree node.
+         */
+        function getOrCreateFolder(node, path) {
+            if (_.isEmpty(path))
                 return node;
 
-            if (node.children) {
-                let folder = null;
+            const leaf = path.shift();
 
-                for (let i = 0; folder === null && i < node.children.length; i++)
-                    folder = findFolder(node.children[i], name);
+            let children = null;
 
-                return folder;
-            }
+            if (!_.isEmpty(node.children)) {
+                children = _.find(node.children, {name: leaf});
 
-            return null;
-        }
+                if (children)
+                    return getOrCreateFolder(children, path);
+            }
 
-        function addChildren(fullClsName) {
-            const parts = fullClsName.split('.');
+            children = {type: 'folder', name: leaf, children: []};
 
-            const shortClsName = parts.pop() + '.java';
+            node.children.push(children);
 
-            let lastFolder = javaFolder;
+            node.children = _.sortByOrder(node.children, ['type', 'name'], ['desc', 'asc']);
 
-            _.forEach(parts, (part) => {
-                const folder = findFolder(javaFolder, part);
+            return getOrCreateFolder(children, path);
+        }
 
-                if (!folder) {
-                    const newLastFolder = {type: 'folder', name: part, children: []};
+        function addClass(fullClsName) {
+            const path = fullClsName.split('.');
 
-                    lastFolder.children.push(newLastFolder);
+            const shortClsName = path.pop() + '.java';
 
-                    lastFolder = newLastFolder;
-                }
-                else
-                    lastFolder = folder;
-            });
+            const folder = getOrCreateFolder(javaFolder, path);
 
-            lastFolder.children.push({type: 'file', name: shortClsName});
+            folder.children.push({type: 'file', name: shortClsName});
         }
 
         $scope.selectItem = (cluster) => {
@@ -199,9 +200,9 @@ export default [
                 _.forEach(cache.domains, (domain) => {
                     if (!$common.isEmptyArray(domain.keyFields)) {
                         if (!JavaTypes.isBuiltInClass(domain.keyType))
-                            addChildren(domain.keyType);
+                            addClass(domain.keyType);
 
-                        addChildren(domain.valueType);
+                        addClass(domain.valueType);
                     }
                 });
             });

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec0f9148/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 18dc326..bd947a1 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -1767,18 +1767,17 @@ treecontrol.tree-classic {
     }
 
     li {
-        padding-left: 17px;
+        padding-left: 15px;
     }
 
-
-    li.tree-expanded i.fa, li.tree-collapsed i.fa, li.tree-leaf i.fa {
+    li.tree-expanded i.tree-branch-head.fa, li.tree-collapsed i.tree-branch-head.fa, li.tree-leaf i.tree-branch-head.fa, .tree-label i.fa {
         background: none no-repeat;
         padding: 1px 5px 1px 1px;
     }
 
     li.tree-leaf i.tree-leaf-head {
-        background: none no-repeat;
-        padding: 0;
+        background: none no-repeat !important;
+        padding: 0 !important;
     }
 
     li .tree-selected {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec0f9148/modules/control-center-web/src/main/js/views/configuration/summary-project-structure.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/summary-project-structure.jade b/modules/control-center-web/src/main/js/views/configuration/summary-project-structure.jade
index 80249d5..33e7bc4 100644
--- a/modules/control-center-web/src/main/js/views/configuration/summary-project-structure.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/summary-project-structure.jade
@@ -19,7 +19,7 @@
         treecontrol.tree-classic(tree-model='projectStructure' options='projectStructureOptions' expanded-nodes='projectStructureExpanded')
             span(ng-switch='' on='node.type')
                 span(ng-switch-when='folder')
-                    label {{node.title ? node.title : node.name}}
+                    label {{node.name}}
                 span(ng-switch-when='file')
                     i.fa.fa-file-text-o
                     label {{node.name}}