You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2014/12/29 14:13:30 UTC
ambari git commit: AMBARI-8936 View action is sometimes disabled for
config versions belonging to different config groups. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 4af27666a -> b7dc5dce9
AMBARI-8936 View action is sometimes disabled for config versions belonging to different config groups. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b7dc5dce
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b7dc5dce
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b7dc5dce
Branch: refs/heads/trunk
Commit: b7dc5dce9009f9ec718fdc950c660d9f311a4412
Parents: 4af2766
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Mon Dec 29 14:48:45 2014 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Mon Dec 29 14:48:45 2014 +0200
----------------------------------------------------------------------
.../views/common/configs/config_history_flow.js | 64 +++++++++-----------
1 file changed, 30 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b7dc5dce/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 72fe62b..9253471 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -216,52 +216,48 @@ App.ConfigHistoryFlowView = Em.View.extend({
onChangeConfigGroup: function () {
var serviceVersions = this.get('serviceVersions');
- var displayedVersionGroupName = this.get('displayedServiceVersion.configGroupName');
var selectedGroupName = this.get('controller.selectedConfigGroup.name');
var startIndex = 0;
var currentIndex = 0;
- // switch to other config group
- if ( selectedGroupName != displayedVersionGroupName ) {
- serviceVersions.setEach('isDisplayed', false);
- //display the version belongs to current group
- if (this.get('controller.selectedConfigGroup.isDefault')) {
- // display current in default group
+ serviceVersions.setEach('isDisplayed', false);
+ //display the version belongs to current group
+ if (this.get('controller.selectedConfigGroup.isDefault')) {
+ // display current in default group
+ serviceVersions.forEach(function (serviceVersion, index) {
+ // find current in default group
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')) {
+ serviceVersion.set('isDisplayed', true);
+ currentIndex = index + 1;
+ }
+ });
+ } else {
+ // display current in selected group
+ serviceVersions.forEach(function (serviceVersion, index) {
+ // find current in selected group
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == selectedGroupName) {
+ serviceVersion.set('isDisplayed', true);
+ currentIndex = index + 1;
+ }
+ });
+ // no current version for selected group, show default group current version
+ if (currentIndex == 0) {
serviceVersions.forEach(function (serviceVersion, index) {
// find current in default group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
- serviceVersion.set('isDisplayed', true);
+ if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')) {
currentIndex = index + 1;
- }
- });
- }else {
- // display current in selected group
- serviceVersions.forEach(function (serviceVersion, index) {
- // find current in selected group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == selectedGroupName){
serviceVersion.set('isDisplayed', true);
- currentIndex = index + 1;
}
});
- // no current version for selected group, show default group current version
- if (currentIndex == 0) {
- serviceVersions.forEach(function (serviceVersion, index) {
- // find current in default group
- if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') == Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
- currentIndex = index + 1;
- serviceVersion.set('isDisplayed', true);
- }
- });
- }
}
- // show current version as the last one
- if (currentIndex > this.VERSIONS_IN_FLOW) {
- startIndex = currentIndex - this.VERSIONS_IN_FLOW;
- }
- this.set('startIndex', startIndex);
- this.adjustFlowView();
- this.keepInfoBarAtTop();
}
+ // show current version as the last one
+ if (currentIndex > this.VERSIONS_IN_FLOW) {
+ startIndex = currentIndex - this.VERSIONS_IN_FLOW;
+ }
+ this.set('startIndex', startIndex);
+ this.adjustFlowView();
+ this.keepInfoBarAtTop();
}.observes('controller.selectedConfigGroup.name'),
/**