You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/02 14:12:39 UTC
[12/16] git commit: AMBARI-7105 Configs: compared v2 -> v1 and make
current note is incorrect. (atkach)
AMBARI-7105 Configs: compared v2 -> v1 and make current note is incorrect. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c59fc3d2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c59fc3d2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c59fc3d2
Branch: refs/heads/branch-alerts-dev
Commit: c59fc3d2d412598c13416ad569577c1e6c0c72ec
Parents: 4a7e06a
Author: atkach <at...@hortonworks.com>
Authored: Mon Sep 1 18:29:07 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Mon Sep 1 18:29:07 2014 +0300
----------------------------------------------------------------------
.../common/configs/config_history_flow.hbs | 4 ++--
.../views/common/configs/config_history_flow.js | 21 ++++++++++++++++++--
2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c59fc3d2/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index b18ca8c..a4e9f79 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -79,7 +79,7 @@
<button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.isDiscardDisabled"}}>{{t common.discard}}</button>
<button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button>
</div>
- <button class="btn btn-success" {{action revert target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.isCurrent:hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button>
+ <button class="btn btn-success" {{action revert view.serviceVersionsReferences.compare target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.isCurrent:hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button>
</div>
</div>
</div>
@@ -134,7 +134,7 @@
<button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.isDiscardDisabled"}}>{{t common.discard}}</button>
<button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button>
</div>
- <button class="btn btn-success" {{action revert target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.isCurrent:hidden"}}>{{view.displayedServiceVersion.makeCurrentButtonText}}</button>
+ <button class="btn btn-success" {{action revert view.serviceVersionsReferences.displayed target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.isCurrent:hidden"}}>{{view.displayedServiceVersion.makeCurrentButtonText}}</button>
</div>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c59fc3d2/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 01fca17..07d315f 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -35,6 +35,21 @@ App.ConfigHistoryFlowView = Em.View.extend({
showFullList: false,
compareServiceVersion: null,
+ /**
+ * In reason of absence of properties dynamic values support which passed to an action,
+ * used property map to get latest values of properties for action
+ */
+ serviceVersionsReferences: {
+ displayed: Em.Object.create({
+ isReference: true,
+ property: 'displayedServiceVersion'
+ }),
+ compare: Em.Object.create({
+ isReference: true,
+ property: 'compareServiceVersion'
+ })
+ },
+
showCompareVersionBar: function() {
return !Em.isNone(this.get('compareServiceVersion'));
}.property('compareServiceVersion'),
@@ -325,8 +340,10 @@ App.ConfigHistoryFlowView = Em.View.extend({
serviceName: this.get('displayedServiceVersion.serviceName'),
notes:''
});
- var versionText = event.context ? event.context.get('versionText') : this.get('displayedServiceVersion.versionText');
- var configGroupName = this.get('displayedServiceVersion.configGroupName');
+ if (serviceConfigVersion.get('isReference')) {
+ serviceConfigVersion = this.get(serviceConfigVersion.get('property'));
+ }
+ var versionText = serviceConfigVersion.get('versionText');
return App.ModalPopup.show({
header: Em.I18n.t('dashboard.configHistory.info-bar.makeCurrent.popup.title'),
serviceConfigNote: Em.I18n.t('services.service.config.configHistory.makeCurrent.message').format(versionText),