You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/05/13 19:09:14 UTC
ambari git commit: AMBARI-11107 Remove conditionals for experimental
flag on enhanced dashboard work. (atkach)
Repository: ambari
Updated Branches:
refs/heads/trunk 43dd0cddf -> 868c6da5f
AMBARI-11107 Remove conditionals for experimental flag on enhanced dashboard work. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/868c6da5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/868c6da5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/868c6da5
Branch: refs/heads/trunk
Commit: 868c6da5fa21d7ce31c8f531ac541df858cafcf7
Parents: 43dd0cd
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Wed May 13 18:06:23 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Wed May 13 20:09:04 2015 +0300
----------------------------------------------------------------------
ambari-web/app/config.js | 1 -
ambari-web/app/data/service_graph_config.js | 16 ++++++---------
.../app/mixins/common/widgets/widget_section.js | 10 ++++------
.../app/views/main/service/info/summary.js | 21 +++++++-------------
.../views/main/service/info/summary_test.js | 8 +++++---
5 files changed, 22 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/868c6da5/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 3b74e9e..3089f1a 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -71,7 +71,6 @@ App.supports = {
customizeAgentUserAccount: false,
installGanglia: false,
opsDuringRollingUpgrade: false,
- customizedWidgets: true,
customizedWidgetLayout: false,
enhancedConfigs: true
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/868c6da5/ambari-web/app/data/service_graph_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_graph_config.js b/ambari-web/app/data/service_graph_config.js
index 17a7123..e660b5f 100644
--- a/ambari-web/app/data/service_graph_config.js
+++ b/ambari-web/app/data/service_graph_config.js
@@ -98,16 +98,12 @@ module.exports = {
},
getServiceGraphConfig: function () {
- if (App.get('supports.customizedWidgets')) {
- var servicesWithEnhancedDashboard = ['hdfs', 'yarn', 'hbase'];
- var newServiceObject = jQuery.extend(true, {}, this.allServices);
- servicesWithEnhancedDashboard.forEach(function (_serviceName) {
- newServiceObject[_serviceName] = [];
- });
- return newServiceObject;
- } else {
- return this.allServices;
- }
+ var servicesWithEnhancedDashboard = ['hdfs', 'yarn', 'hbase'];
+ var newServiceObject = jQuery.extend(true, {}, this.allServices);
+ servicesWithEnhancedDashboard.forEach(function (_serviceName) {
+ newServiceObject[_serviceName] = [];
+ });
+ return newServiceObject;
}
};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/868c6da5/ambari-web/app/mixins/common/widgets/widget_section.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_section.js b/ambari-web/app/mixins/common/widgets/widget_section.js
index e147f5f..20863c3 100644
--- a/ambari-web/app/mixins/common/widgets/widget_section.js
+++ b/ambari-web/app/mixins/common/widgets/widget_section.js
@@ -78,7 +78,7 @@ App.WidgetSectionMixin = Ember.Mixin.create({
} else if (this.get('sectionName') === 'SYSTEM_HEATMAPS') {
isServiceWithWidgetdescriptor = true;
}
- return isServiceWithWidgetdescriptor && (App.supports.customizedWidgets || this.sectionNameSuffix === "_HEATMAPS");
+ return isServiceWithWidgetdescriptor;
}.property('content.serviceName'),
/**
@@ -90,13 +90,11 @@ App.WidgetSectionMixin = Ember.Mixin.create({
* @type {Em.A}
*/
widgets: function () {
- if (this.get('isWidgetsLoaded')) {
- if (this.get('activeWidgetLayout.widgets')) {
- return this.get('activeWidgetLayout.widgets').toArray();
- }
+ if (this.get('isWidgetsLoaded') && this.get('activeWidgetLayout.widgets')) {
+ return this.get('activeWidgetLayout.widgets').toArray();
}
return [];
- }.property('isWidgetsLoaded'),
+ }.property('isWidgetsLoaded', 'activeWidgetLayout.widgets'),
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/868c6da5/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 515ed98..1408aee 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -308,20 +308,15 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
constructGraphObjects: function(graphNames) {
var result = [], graphObjects = [], chunkSize = this.get('chunkSize');
var self = this;
+ var serviceName = this.get('controller.content.serviceName');
+ var stackService = App.StackService.find().findProperty('serviceName', serviceName);
- if (App.get('supports.customizedWidgets')) {
- var serviceName = this.get('controller.content.serviceName');
- var stackService = App.StackService.find().findProperty('serviceName', serviceName);
- if (!graphNames && !stackService.get('isServiceWithWidgets')) {
- self.set('serviceMetricGraphs', []);
- self.set('isServiceMetricLoaded', false);
- return;
- }
- } else if (!graphNames) {
+ if (!graphNames && !stackService.get('isServiceWithWidgets')) {
self.set('serviceMetricGraphs', []);
self.set('isServiceMetricLoaded', false);
return;
}
+
// load time range for current service from server
self.getUserPref(self.get('persistKey')).complete(function () {
var index = self.get('currentTimeRangeIndex');
@@ -530,11 +525,9 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
var svcName = this.get('service.serviceName');
var isMetricsSupported = svcName != 'STORM' || App.get('isStormMetricsSupported');
- if (App.get('supports.customizedWidgets')) {
- this.get('controller').getActiveWidgetLayout();
- if (App.get('supports.customizedWidgetLayout')) {
- this.get('controller').loadWidgetLayouts();
- }
+ this.get('controller').getActiveWidgetLayout();
+ if (App.get('supports.customizedWidgetLayout')) {
+ this.get('controller').loadWidgetLayouts();
}
if (svcName && isMetricsSupported) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/868c6da5/ambari-web/test/views/main/service/info/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/info/summary_test.js b/ambari-web/test/views/main/service/info/summary_test.js
index cc9a421..7511cd3 100644
--- a/ambari-web/test/views/main/service/info/summary_test.js
+++ b/ambari-web/test/views/main/service/info/summary_test.js
@@ -29,7 +29,8 @@ describe('App.MainServiceInfoSummaryView', function() {
id: 'HDFS',
serviceName: 'HDFS',
hostComponents: []
- })
+ }),
+ getActiveWidgetLayout: Em.K
}),
alertsController: Em.Object.create(),
service: Em.Object.create()
@@ -163,17 +164,18 @@ describe('App.MainServiceInfoSummaryView', function() {
beforeEach(function () {
sinon.stub(view, 'constructGraphObjects', Em.K);
+ this.mock = sinon.stub(App, 'get');
});
afterEach(function () {
view.constructGraphObjects.restore();
- App.get.restore();
+ this.mock.restore();
});
cases.forEach(function (item) {
it(item.title, function () {
view.set('service.serviceName', item.serviceName);
- sinon.stub(App, 'get').withArgs('isStormMetricsSupported').returns(item.isStormMetricsSupported);
+ this.mock.withArgs('isStormMetricsSupported').returns(item.isStormMetricsSupported);
view.didInsertElement();
expect(view.constructGraphObjects.calledOnce).to.equal(item.isConstructGraphObjectsCalled);
});