ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1597 Fixed metadata load filters.
Date Thu, 15 Oct 2015 01:31:48 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 efdfede23 -> ed0399eaf


IGNITE-1597 Fixed metadata load filters.


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

Branch: refs/heads/ignite-843-rc1
Commit: ed0399eaf0e6cc4adb040b202d3fcdffec1dc7b6
Parents: efdfede
Author: anovikov <anovikov@gridgain.com>
Authored: Thu Oct 15 08:31:39 2015 +0700
Committer: anovikov <anovikov@gridgain.com>
Committed: Thu Oct 15 08:31:39 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js    | 40 ++++++++++++++++++++
 .../js/views/configuration/metadata-load.jade   |  4 +-
 2 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ed0399ea/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 1235a92..1a21685 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
@@ -1608,6 +1608,46 @@ consoleModule.filter('metadatasSearch', function() {
     }
 });
 
+consoleModule.filter('schemasSearch', function() {
+    return function(array, query) {
+        if (!angular.isUndefined(array) && !angular.isUndefined(query) &&
!angular.isUndefined(query.$)) {
+            var filtredArray = [];
+
+            var matchString = query.$.toLowerCase();
+
+            angular.forEach(array, function (row) {
+                var label = row.name.toLowerCase();
+
+                if (label.indexOf(matchString) >= 0)
+                    filtredArray.push(row);
+            });
+
+            return filtredArray;
+        } else
+            return array;
+    }
+});
+
+consoleModule.filter('tablesSearch', function() {
+    return function(array, query) {
+        if (!angular.isUndefined(array) && !angular.isUndefined(query) &&
!angular.isUndefined(query.$)) {
+            var filtredArray = [];
+
+            var matchString = query.$.toLowerCase();
+
+            angular.forEach(array, function (row) {
+                var label = (row.schema + '.' + row.tbl).toLowerCase();
+
+                if (label.indexOf(matchString) >= 0)
+                    filtredArray.push(row);
+            });
+
+            return filtredArray;
+        } else
+            return array;
+    }
+});
+
 // Filter metadata with key fields configuration.
 consoleModule.filter('metadatasValidation', ['$common', function ($common) {
     return function(metadatas, valid, invalid) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ed0399ea/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
index a0b388c..bbae222 100644
--- a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
@@ -30,7 +30,7 @@ mixin chk(mdl, change, tip)
                     .settings-row(ng-repeat='field in metadataDb')
                         +form-row-custom(['col-xs-4 col-sm-3 col-md-3'], ['col-xs-8 col-sm-9
col-md-9'], 'preset')
             .metadata-content(ng-show='loadMeta.action == "schemas"')
-                table.table.metadata(st-table='loadMeta.displayedSchemas' st-safe-src='loadMeta.schemas')
+                table.table.metadata(st-table='loadMeta.displayedSchemas' st-safe-src='loadMeta.schemas'
st-set-filter='schemasSearch')
                     thead
                         tr
                             th.header(colspan='2')
@@ -57,7 +57,7 @@ mixin chk(mdl, change, tip)
                     label.required Package:
                     span
                         input.form-control(id='metadataLoadPackage' type="text" ng-model='ui.packageName'
placeholder='Package for POJOs generation' bs-tooltip='' data-title='Package that will be
used for POJOs generation' data-placement='top' data-trigger='hover')
-                table.table.metadata(st-table='loadMeta.displayedTables' st-safe-src='loadMeta.tables')
+                table.table.metadata(st-table='loadMeta.displayedTables' st-safe-src='loadMeta.tables'
st-set-filter='tablesSearch')
                     thead
                         tr
                             th.header(colspan='3')


Mime
View raw message