ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: IGNITE-843 WIP on metadata screen.
Date Mon, 10 Aug 2015 10:54:49 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 1bf469633 -> e124dd332


IGNITE-843 WIP on metadata screen.


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

Branch: refs/heads/ignite-843
Commit: e124dd3326d094ff6bf72a55309d1830baea21da
Parents: 1bf4696
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Aug 10 17:54:56 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Aug 10 17:54:56 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/metadata-controller.js  | 88 +++++++-------------
 .../main/js/controllers/models/metadata.json    | 10 +--
 modules/control-center-web/src/main/js/db.js    |  1 -
 .../src/main/js/public/stylesheets/style.scss   |  8 --
 .../main/js/views/configuration/metadata.jade   |  3 +-
 5 files changed, 30 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e124dd33/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 b6eaaab..9adfbf9 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
@@ -38,20 +38,6 @@ controlCenterModule.controller('metadataController', [
             $scope.tablePairSave = $table.tablePairSave;
             $scope.tablePairSaveVisible = $table.tablePairSaveVisible;
 
-            $scope.templates = [
-                {value: {kind: 'query'}, label: 'query'},
-                {value: {kind: 'store'}, label: 'store'},
-                {value: {kind: 'both'}, label: 'both'}
-            ];
-
-            $scope.template = $scope.templates[0].value;
-
-            $scope.kinds = [
-                {value: 'query', label: 'query'},
-                {value: 'store', label: 'store'},
-                {value: 'both', label: 'both'}
-            ];
-
             $scope.databases = [
                 {value: 'oracle', label: 'Oracle database'},
                 {value: 'db2', label: 'IBM DB2'},
@@ -282,18 +268,6 @@ controlCenterModule.controller('metadataController', [
 
             $scope.metadatas = [];
 
-            $scope.required = function (field) {
-                var model = $common.isDefined(field.path) ? field.path + '.' + field.model
: field.model;
-
-                var item = $scope.backupItem;
-
-                if (item && item.kind && item.kind != 'query') {
-                    return model == 'databaseSchema' || model == 'databaseTable';
-                }
-
-                return false;
-            };
-
             $scope.isJavaBuildInClass = function () {
                 var item = $scope.backupItem;
 
@@ -388,14 +362,12 @@ controlCenterModule.controller('metadataController', [
 
                 $scope.selectedItem = undefined;
 
-                $scope.backupItem = angular.copy($scope.template);
-                $scope.backupItem.space = $scope.spaces[0]._id;
+                $scope.backupItem = {space: $scope.spaces[0]._id};
             };
 
             // Check metadata logical consistency.
             function validate(item) {
-                var kind = item.kind;
-
+                /*
                 if (!$common.isValidJavaClass('Key type', item.keyType, true)) {
                     $focus('keyType');
 
@@ -408,49 +380,45 @@ controlCenterModule.controller('metadataController', [
                     return false;
                 }
 
-                if (kind == 'query' || kind == 'both') {
-                    if ($common.isEmptyArray(item.queryFields) && $common.isEmptyArray(item.ascendingFields)
&&
-                        $common.isEmptyArray(item.descendingFields) && $common.isEmptyArray(item.textFields)
&&
-                        $common.isEmptyArray(item.groups)) {
-                        $common.showError('SQL fields are not specified!');
+                if ($common.isEmptyArray(item.queryFields) && $common.isEmptyArray(item.ascendingFields)
&&
+                    $common.isEmptyArray(item.descendingFields) && $common.isEmptyArray(item.textFields)
&&
+                    $common.isEmptyArray(item.groups)) {
+                    $common.showError('SQL fields are not specified!');
 
-                        return false;
-                    }
+                    return false;
+                }
 
-                    var groups = item.groups;
-                    if (groups && groups.length > 0) {
-                        for (var i = 0; i < groups.length; i++) {
-                            var group = groups[i];
-                            var fields = group.fields;
+                var groups = item.groups;
+                if (groups && groups.length > 0) {
+                    for (var i = 0; i < groups.length; i++) {
+                        var group = groups[i];
+                        var fields = group.fields;
 
-                            if ($common.isEmptyArray(fields)) {
-                                $common.showError('Group "' + group.name + '" has no fields.');
+                        if ($common.isEmptyArray(fields)) {
+                            $common.showError('Group "' + group.name + '" has no fields.');
 
-                                return false;
-                            }
+                            return false;
+                        }
 
-                            if (fields.length == 1) {
-                                $common.showError('Group "' + group.name + '" has only one
field.<br/> Consider to use ascending or descending fields.');
+                        if (fields.length == 1) {
+                            $common.showError('Group "' + group.name + '" has only one field.<br/>
Consider to use ascending or descending fields.');
 
-                                return false;
-                            }
+                            return false;
                         }
                     }
                 }
 
-                if (kind == 'store' || kind == 'both') {
-                    if ($common.isEmptyArray(item.keyFields) && !$common.isJavaBuildInClass(item.keyType))
{
-                        $common.showError('Key fields are not specified!');
+                if ($common.isEmptyArray(item.keyFields) && !$common.isJavaBuildInClass(item.keyType))
{
+                    $common.showError('Key fields are not specified!');
 
-                        return false;
-                    }
-
-                    if ($common.isEmptyArray(item.valueFields)) {
-                        $common.showError('Value fields are not specified!');
+                    return false;
+                }
+                if ($common.isEmptyArray(item.valueFields)) {
+                    $common.showError('Value fields are not specified!');
 
-                        return false;
-                    }
+                    return false;
                 }
+                */
 
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e124dd33/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 0ce50d8..91a875a 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
@@ -72,7 +72,6 @@
           "model": "queryFields",
           "keyName": "name",
           "valueName": "className",
-          "hide": "backupItem.kind == 'store'",
           "focusId": "QryField",
           "addTip": "Add field to query.",
           "removeTip": "Remove field.",
@@ -86,7 +85,6 @@
           "model": "ascendingFields",
           "keyName": "name",
           "valueName": "className",
-          "hide": "backupItem.kind == 'store'",
           "focusId": "AscField",
           "addTip": "Add field to index in ascending order.",
           "removeTip": "Remove field.",
@@ -100,7 +98,6 @@
           "model": "descendingFields",
           "keyName": "name",
           "valueName": "className",
-          "hide": "backupItem.kind == 'store'",
           "focusId": "DescField",
           "addTip": "Add field to index in descending order.",
           "removeTip": "Remove field.",
@@ -112,7 +109,6 @@
           "label": "Text fields",
           "type": "table-simple",
           "model": "textFields",
-          "hide": "backupItem.kind == 'store'",
           "placeholder": "Field name",
           "focusId": "TextField",
           "addTip": "Add field to index as text.",
@@ -128,7 +124,6 @@
           "label": "Groups",
           "type": "queryGroups",
           "model": "groups",
-          "hide": "backupItem.kind == 'store'",
           "addTip": "Add new group.",
           "removeTip": "Remove group.",
           "addItemTip": "Add new field to group.",
@@ -147,7 +142,6 @@
           "label": "Database schema",
           "type": "text",
           "model": "databaseSchema",
-          "hide": "backupItem.kind != 'both' && backupItem.kind == 'query'",
           "placeholder": "Input DB schema name",
           "tip": [
             "Schema name in database."
@@ -157,7 +151,6 @@
           "label": "Database table",
           "type": "text",
           "model": "databaseTable",
-          "hide": "backupItem.kind != 'both' && backupItem.kind == 'query'",
           "placeholder": "Input DB table name",
           "tip": [
             "Table name in database."
@@ -169,7 +162,7 @@
           "model": "keyFields",
           "keyName": "name",
           "valueName": "className",
-          "hide": "backupItem.kind == 'query' || isJavaBuildInClass()",
+          "hide": "isJavaBuildInClass()",
           "focusId": "KeyField",
           "addTip": "Add key field.",
           "removeTip": "Remove key field.",
@@ -183,7 +176,6 @@
           "model": "valueFields",
           "keyName": "name",
           "valueName": "className",
-          "hide": "backupItem.kind != 'both' && backupItem.kind == 'query'",
           "focusId": "ValueField",
           "addTip": "Add value field.",
           "removeTip": "Remove value field.",

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e124dd33/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
index f815266..9aa61ac 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -68,7 +68,6 @@ exports.Space = mongoose.model('Space', new Schema({
 var CacheTypeMetadataSchema = new Schema({
     space: {type: ObjectId, ref: 'Space'},
     name: String,
-    kind: {type: String, enum: ['query', 'store', 'both']},
     databaseSchema: String,
     databaseTable: String,
     keyType: String,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e124dd33/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 791ee81..283ff78 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
@@ -1093,14 +1093,6 @@ input.ng-dirty.ng-invalid, button.ng-dirty.ng-invalid {
     }
 }
 
-input.ng-untouched.ng-invalid, button.ng-untouched.ng-invalid {
-    border-color: $ignite-red;
-
-    :focus {
-        border-color: $ignite-red;
-    }
-}
-
 .form-control-feedback {
     display: inline-block;
     color: $ignite-red;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e124dd33/modules/control-center-web/src/main/js/views/configuration/metadata.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/metadata.jade b/modules/control-center-web/src/main/js/views/configuration/metadata.jade
index b8b56c6..b8d4d25 100644
--- a/modules/control-center-web/src/main/js/views/configuration/metadata.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/metadata.jade
@@ -38,7 +38,6 @@ block content
         .padding-top-dflt
             button.btn.btn-primary(event-focus='defaultFocusId' ng-click='panels.activePanel
= [0]; createItem()') Add metadata
             button.btn.btn-primary(ng-click='loadFromDb()') Load from database
-
         hr
         form.form-horizontal(name='inputForm' ng-if='backupItem' novalidate)
             .panel-group(bs-collapse data-allow-multiple='true')
@@ -51,6 +50,6 @@ block content
                             .settings-row(ng-repeat='field in group.fields')
                                 +form-row('backupItem')
         .section
-            button.btn.btn-primary(ng-disabled='manualForm.$invalid' ng-click='saveItem()')
Save
+            button.btn.btn-primary(ng-disabled='inputForm.$invalid' ng-click='saveItem()')
Save
             button.btn.btn-primary(ng-show='backupItem._id' ng-disabled='inputForm.$invalid'
ng-click='saveItemAs()') Copy
             button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()')
Remove


Mime
View raw message