Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 609b8c620 -> 835ea08b8
IGNITE-843: Validation popover fixes. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/835ea08b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/835ea08b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/835ea08b Branch: refs/heads/ignite-843 Commit: 835ea08b83eb80d375971f0ec2ec94077c0d1536 Parents: 609b8c6 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Wed Aug 19 09:55:08 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Wed Aug 19 09:55:08 2015 +0700 ---------------------------------------------------------------------- .../main/js/controllers/caches-controller.js | 31 +++++---------- .../src/main/js/controllers/common-module.js | 2 + .../main/js/controllers/metadata-controller.js | 42 ++++++-------------- 3 files changed, 25 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/835ea08b/modules/control-center-web/src/main/js/controllers/caches-controller.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js index 3229604..5c8fb0f 100644 --- a/modules/control-center-web/src/main/js/controllers/caches-controller.js +++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js @@ -135,11 +135,8 @@ controlCenterModule.controller('cachesController', [ var idx = _.indexOf(model, fx); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('SQL function with such class name already exists!'); - - return $table.tableFocusInvalidField(index, 'SqlFx'); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'SqlFx'), 'SQL function with such class name already exists!'); } return true; @@ -162,11 +159,8 @@ controlCenterModule.controller('cachesController', [ }); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('Indexed type with such key class already exists!'); - - return $table.tableFocusInvalidField(index, 'KeyIndexedType'); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'KeyIndexedType'), 'Indexed type with such key class already exists!'); } return true; @@ -309,20 +303,17 @@ controlCenterModule.controller('cachesController', [ } } - if (cacheStoreFactorySelected && !(item.readThrough || item.writeThrough)) { - return showPopoverMessage($scope.panels, 'store-data', 'readThrough', - 'Store is configured but read/write through are not enabled!'); - } - - if ((item.readThrough || item.writeThrough) && !cacheStoreFactorySelected) { + if ((item.readThrough || item.writeThrough) && !cacheStoreFactorySelected) return showPopoverMessage($scope.panels, 'store-data', 'cacheStoreFactory', - 'Read / write through are enabled but store is not configured!'); - } + (item.readThrough ? 'Read' : 'Write') + ' through are enabled but store is not configured!'); - if (item.writeBehindEnabled && !cacheStoreFactorySelected) { + if (item.writeBehindEnabled && !cacheStoreFactorySelected) return showPopoverMessage($scope.panels, 'store-data', 'cacheStoreFactory', 'Write behind enabled but store is not configured!'); - } + + if (cacheStoreFactorySelected && !(item.readThrough || item.writeThrough)) + return showPopoverMessage($scope.panels, 'store-data', 'readThrough', + 'Store is configured but read/write through are not enabled!'); return true; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/835ea08b/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 6d91134..d30292f 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 @@ -652,6 +652,8 @@ controlCenterModule.service('$table', [ function _tableReset() { table.name = 'none'; table.editIndex = -1; + + $common.hidePopover(); } function _tableState(name, editIndex) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/835ea08b/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 404b03d..cb0c501 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 @@ -506,11 +506,8 @@ controlCenterModule.controller('metadataController', [ var idx = _.indexOf(model, name); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('Field with such name already exists!'); - - return $table.tableFocusInvalidField(index, 'TextField'); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'TextField'), 'Field with such name already exists!'); } return true; @@ -539,11 +536,8 @@ controlCenterModule.controller('metadataController', [ }); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('Field with such name already exists!'); - - return $table.tableFocusInvalidField(index, 'Key' + pairField.id); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'Key' + pairField.id), 'Field with such name already exists!'); } } @@ -587,22 +581,16 @@ controlCenterModule.controller('metadataController', [ }); // Found duplicate. - if (idx >= 0 && index != idx) { - $common.showError('Field with such database name already exists!'); - - return $table.tableFocusInvalidField(index, 'DatabaseName' + dbFieldTable.id); - } + if (idx >= 0 && index != idx) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'DatabaseName' + dbFieldTable.id), 'Field with such database name already exists!'); idx = _.findIndex(model, function (dbMeta) { return dbMeta.javaName == dbFieldValue.javaName; }); // Found duplicate. - if (idx >= 0 && index != idx) { - $common.showError('Field with such java name already exists!'); - - return $table.tableFocusInvalidField(index, 'JavaName' + dbFieldTable.id); - } + if (idx >= 0 && index != idx) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'JavaName' + dbFieldTable.id), 'Field with such java name already exists!'); if (index < 0) { model.push(dbFieldValue); @@ -650,11 +638,8 @@ controlCenterModule.controller('metadataController', [ }); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('Group with such name already exists!'); - - return $table.tableFocusInvalidField(index, 'GroupName'); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'GroupName'), 'Group with such name already exists!'); } var item = $scope.backupItem; @@ -763,11 +748,8 @@ controlCenterModule.controller('metadataController', [ }); // Found duplicate. - if (idx >= 0 && idx != index) { - $common.showError('Field with such name already exists in group!'); - - return $table.tableFocusInvalidField(index, 'FieldName'); - } + if (idx >= 0 && idx != index) + return $common.showPopoverMessage(null, null, $table.tableFieldId(index, 'FieldName'), 'Field with such name already exists in group!'); } var group = $scope.backupItem.groups[groupIndex];