You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2014/08/30 02:34:56 UTC
git commit: AMBARI-7092. Config Group: FE change to intgrate new
default group_id and group_name.(xiwang)
Repository: ambari
Updated Branches:
refs/heads/trunk 5ceeeb52b -> b6ff02347
AMBARI-7092. Config Group: FE change to intgrate new default group_id and group_name.(xiwang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b6ff0234
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b6ff0234
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b6ff0234
Branch: refs/heads/trunk
Commit: b6ff0234748ce3d075fc5ab886028b7fa1d6c76e
Parents: 5ceeeb5
Author: Xi Wang <xi...@apache.org>
Authored: Fri Aug 29 17:30:56 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Fri Aug 29 17:34:07 2014 -0700
----------------------------------------------------------------------
.../app/controllers/main/service/info/configs.js | 2 +-
ambari-web/app/messages.js | 1 +
ambari-web/app/models/service_config_version.js | 2 +-
.../app/views/common/configs/config_history_flow.js | 13 +++++++------
4 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b6ff0234/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 992fbc5..39f4997 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -272,7 +272,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
loadServiceConfigVersionsSuccess: function (data, opt, params) {
var self = this;
App.serviceConfigVersionsMapper.map(data);
- self.set('currentVersion', data.items.filterProperty('group_id', null).findProperty('is_current').service_config_version);
+ self.set('currentVersion', data.items.filterProperty('group_id', -1).findProperty('is_current').service_config_version);
self.loadSelectedVersion();
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/b6ff0234/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index b430d8d..fd9772f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2005,6 +2005,7 @@ Em.I18n.translations = {
'dashboard.configHistory.table.version.title' : 'Service',
'dashboard.configHistory.table.configGroup.title' : 'Config Group',
'dashboard.configHistory.table.created.title' : 'Created',
+ 'dashboard.configHistory.table.configGroup.default' : 'default',
'dashboard.configHistory.table.empty' : 'No history to display',
'dashboard.configHistory.table.notes.default': 'Initial configurations for {0}',
'dashboard.configHistory.table.version.versionText' : 'V{0}',
http://git-wip-us.apache.org/repos/asf/ambari/blob/b6ff0234/ambari-web/app/models/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config_version.js b/ambari-web/app/models/service_config_version.js
index 43b6026..0159d35 100644
--- a/ambari-web/app/models/service_config_version.js
+++ b/ambari-web/app/models/service_config_version.js
@@ -39,7 +39,7 @@ App.ServiceConfigVersion = DS.Model.extend({
return Em.I18n.t('dashboard.configHistory.table.current.tooltip').format(this.get('displayName'), this.get('configGroupName'));
}.property('displayName', 'configGroupName'),
configGroupName: function () {
- return this.get('groupName') || (this.get('displayName') + ' ' + Em.I18n.t('common.default'));
+ return this.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default') ? (this.get('displayName') + ' ' + Em.I18n.t('common.default')) : this.get('groupName');
}.property('groupName'),
briefNotes: function () {
return (typeof this.get('notes') === 'string') ? this.get('notes').slice(0, 100) : "";
http://git-wip-us.apache.org/repos/asf/ambari/blob/b6ff0234/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index adadcc2..d2eb084 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -71,17 +71,18 @@ App.ConfigHistoryFlowView = Em.View.extend({
serviceVersions: function () {
var serviceVersions;
var allServiceVersions = App.ServiceConfigVersion.find().filterProperty('serviceName', this.get('serviceName'));
+ var defaultGroup = Em.I18n.t('dashboard.configHistory.table.configGroup.default');
if (this.get('controller.selectedConfigGroup.isDefault')) {
allServiceVersions.forEach(function (version) {
- version.set('isDisabled', !Em.isNone(version.get('groupName')));
+ version.set('isDisabled', ! (version.get('groupName') == defaultGroup));
});
- serviceVersions = allServiceVersions.filterProperty('groupName', null);
+ serviceVersions = allServiceVersions.filterProperty('groupName', defaultGroup);
} else {
// filter out default group(should be grayedOut) and current selectedGroup versions
allServiceVersions.forEach(function (version) {
version.set('isDisabled', !(version.get('groupName') === this.get('controller.selectedConfigGroup.name')));
}, this);
- serviceVersions = allServiceVersions.filterProperty('groupName', null).concat(allServiceVersions.filterProperty('groupName', this.get('controller.selectedConfigGroup.name')));
+ serviceVersions = allServiceVersions.filterProperty('groupName', defaultGroup).concat(allServiceVersions.filterProperty('groupName', this.get('controller.selectedConfigGroup.name')));
}
return serviceVersions.sort(function (a, b) {
return Em.get(a, 'createTime') - Em.get(b, 'createTime');
@@ -140,7 +141,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
// display current in default group
serviceVersions.forEach(function (serviceVersion, index) {
// find current in default group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == null){
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
serviceVersion.set('isDisplayed', true);
currentIndex = index;
}
@@ -170,7 +171,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
// display current in default group
serviceVersions.forEach(function (serviceVersion, index) {
// find current in default group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == null){
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
serviceVersion.set('isDisplayed', true);
currentIndex = index;
@@ -190,7 +191,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
if (currentIndex == 0) {
serviceVersions.forEach(function (serviceVersion, index) {
// find current in default group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == null){
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
serviceVersion.set('isDisplayed', true);
currentIndex = index;