Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7591918A9A for ; Thu, 13 Aug 2015 14:03:39 +0000 (UTC) Received: (qmail 5155 invoked by uid 500); 13 Aug 2015 14:02:41 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 5123 invoked by uid 500); 13 Aug 2015 14:02:41 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 5114 invoked by uid 99); 13 Aug 2015 14:02:40 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 14:02:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 670F8C1385 for ; Thu, 13 Aug 2015 14:02:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.301 X-Spam-Level: **** X-Spam-Status: No, score=4.301 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RDNS_NONE=2.5, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 2_bn2a-Wb6zu for ; Thu, 13 Aug 2015 14:02:30 +0000 (UTC) Received: from spamd1-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 76A7D37395 for ; Thu, 13 Aug 2015 05:11:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C879ADD11E for ; Thu, 13 Aug 2015 05:11:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id jelos0QEsolc for ; Thu, 13 Aug 2015 05:11:16 +0000 (UTC) Received: from spamd1-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 50D7A33BAA for ; Thu, 13 Aug 2015 05:11:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 12D34DD127 for ; Thu, 13 Aug 2015 05:11:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JbOv4X-cLRTm for ; Thu, 13 Aug 2015 05:11:01 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 4B6AA33BB3 for ; Thu, 13 Aug 2015 05:11:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1569CC20C8 for ; Thu, 13 Aug 2015 05:11:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XBdFFMQ0zAse for ; Thu, 13 Aug 2015 05:10:50 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id A584233BB3 for ; Thu, 13 Aug 2015 05:10:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 51E94C20C8 for ; Thu, 13 Aug 2015 05:10:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id x0e-QYpwEMMi for ; Thu, 13 Aug 2015 05:10:40 +0000 (UTC) Received: from spamd3-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id CA88F33BB3 for ; Thu, 13 Aug 2015 05:10:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7ED811A16D3 for ; Thu, 13 Aug 2015 05:10:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id h2h5ErL_ikxH for ; Thu, 13 Aug 2015 05:10:25 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 976B85170C for ; Thu, 13 Aug 2015 05:10:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3DE57C20C8 for ; Thu, 13 Aug 2015 05:10:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id keEZ1Q-PXAJK for ; Thu, 13 Aug 2015 05:10:12 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id B897533BAA for ; Thu, 13 Aug 2015 05:10:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 659C4C20C8 for ; Thu, 13 Aug 2015 05:10:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id J-NQ1Z1IIBqg for ; Thu, 13 Aug 2015 05:09:59 +0000 (UTC) Received: from spamd3-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 72BF633BAC for ; Thu, 13 Aug 2015 05:09:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3BE471A16D3 for ; Thu, 13 Aug 2015 05:09:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id uHnjd28vu2mt for ; Thu, 13 Aug 2015 05:09:53 +0000 (UTC) Received: from spamd1-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 066D6373F1 for ; Thu, 13 Aug 2015 02:17:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6362DDCF6C for ; Thu, 13 Aug 2015 02:17:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gtw_CzTN4Png for ; Thu, 13 Aug 2015 02:16:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id A634232DA0 for ; Thu, 13 Aug 2015 01:31:35 +0000 (UTC) Received: (qmail 96319 invoked by uid 99); 13 Aug 2015 01:31:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 01:31:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6890BDFF41; Thu, 13 Aug 2015 01:31:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.incubator.apache.org Message-Id: <22c4591412374175bf53d17f4bedcfbb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: IGNITE-843 WIP on tables. Date: Thu, 13 Aug 2015 01:31:35 +0000 (UTC) Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 a9fd2676a -> 2316b22b6 IGNITE-843 WIP on tables. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2316b22b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2316b22b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2316b22b Branch: refs/heads/ignite-843 Commit: 2316b22b653941541826723ae91ae712a98d4d51 Parents: a9fd267 Author: AKuznetsov Authored: Thu Aug 13 08:31:31 2015 +0700 Committer: AKuznetsov Committed: Thu Aug 13 08:31:31 2015 +0700 ---------------------------------------------------------------------- .../src/main/js/controllers/common-module.js | 4 +- .../main/js/controllers/metadata-controller.js | 46 +++++++++----------- 2 files changed, 22 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2316b22b/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 f7abf0c..b18240e 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 @@ -675,9 +675,9 @@ controlCenterModule.service('$table', [ } else if (ui == 'table-db-fields') { field.newDatabaseName = null; - field.newDatabaseType = null; + field.newDatabaseType = 'INTEGER'; field.newJavaName = null; - field.newJavaType = null; + field.newJavaType = 'Integer'; _tableFocus('DatabaseName' + field.focusId, -1); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2316b22b/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 7becb73..99fcc49 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 @@ -482,15 +482,17 @@ controlCenterModule.controller('metadataController', [ return true; }; - $scope.tableDbFieldSaveVisible = function (field, index) { - var isNew = index < 0; + function tableDbFieldValue(field, index) { + return index < 0 + ? {databaseName: field.newDatabaseName, databaseType: field.newDatabaseType, javaName: field.newJavaName, javaType: field.newJavaType} + : {databaseName: field.curDatabaseName, databaseType: field.curDatabaseType, javaName: field.curJavaName, javaType: field.curJavaType} + } - var databaseName = isNew ? field.newDatabaseName : field.curDatabaseName; - var databaseType = isNew ? field.newDatabaseType : field.curDatabaseType; - var javaName = isNew ? field.newJavaName : field.curJavaName; - var javaType = isNew ? field.newJavaType : field.curJavaType; + $scope.tableDbFieldSaveVisible = function (field, index) { + var dbFieldValue = tableDbFieldValue(field, index); - return !$common.isEmptyString(databaseName) && $common.isDefined(databaseType) && !$common.isEmptyString(javaName) && $common.isDefined(javaType); + return !$common.isEmptyString(dbFieldValue.databaseName) && $common.isDefined(dbFieldValue.databaseType) && + !$common.isEmptyString(dbFieldValue.javaName) && $common.isDefined(dbFieldValue.javaType); }; var dbFields = { @@ -502,23 +504,18 @@ controlCenterModule.controller('metadataController', [ var dbField = dbFields[field.model]; if (dbField) { + var dbFieldValue = tableDbFieldValue(field, index); + var backupItem = $scope.backupItem; var model = backupItem[field.model]; - var newItem = { - databaseName: newDatabaseName, - databaseType: newDatabaseType, - javaName: newJavaName, - javaType: newJavaType - }; - - if (!$common.isValidJavaIdentifier(dbField.msg + ' java name', newJavaName)) + if (!$common.isValidJavaIdentifier(dbField.msg + ' java name', dbFieldValue.javaName)) return focusInvalidField(index, 'JavaName' + dbField.id); if ($common.isDefined(model)) { var idx = _.findIndex(model, function (dbMeta) { - return dbMeta.databaseName == newDatabaseName + return dbMeta.databaseName == dbFieldValue.databaseName; }); // Found duplicate. @@ -529,7 +526,7 @@ controlCenterModule.controller('metadataController', [ } idx = _.findIndex(model, function (dbMeta) { - return dbMeta.javaName == newJavaName + return dbMeta.javaName == dbFieldValue.javaName; }); // Found duplicate. @@ -540,22 +537,19 @@ controlCenterModule.controller('metadataController', [ } if (index < 0) { - if (model) - model.push(newItem); - else - backupItem[field.model] = [newItem]; + model.push(dbFieldValue); } else { var item = model[index]; - item.databaseName = newDatabaseName; - item.databaseType = newDatabaseType; - item.javaName = newJavaName; - item.javaType = newJavaType; + item.databaseName = dbFieldValue.databaseName; + item.databaseType = dbFieldValue.databaseType; + item.javaName = dbFieldValue.javaName; + item.javaType = dbFieldValue.javaType; } } else - backupItem[field.model] = [newItem]; + backupItem[field.model] = [dbFieldValue]; $table.tableReset(); }