You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2016/04/15 13:45:04 UTC
[1/3] ambari git commit: AMBARI-15910. Read-only user is getting
extra perms (onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/trunk ebc66f709 -> 4ff99fccb
AMBARI-15910. Read-only user is getting extra perms (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4ff99fcc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4ff99fcc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4ff99fcc
Branch: refs/heads/trunk
Commit: 4ff99fccb94e11ea705b91a87284c495f605829d
Parents: 2d3fb6b
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Apr 15 12:54:29 2016 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Apr 15 14:43:14 2016 +0300
----------------------------------------------------------------------
.../common/configs/config_history_flow.hbs | 4 ++
.../common/configs/service_version_box.hbs | 2 +
ambari-web/app/views/main/host/details.js | 60 ++++++++++++++++----
3 files changed, 54 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4ff99fcc/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 a099a6c..73d6913 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -47,9 +47,11 @@
<strong>{{view.compareServiceVersion.authorFormatted}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}}
<strong>{{view.compareServiceVersion.createdDate}}</strong>
</div>
+ {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
<div class="pull-right operations-button">
<button class="btn btn-success" {{action doAction view.serviceVersionsReferences.compare view.actionTypes.REVERT target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.canBeMadeCurrent::hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button>
</div>
+ {{/isAuthorized}}
</div>
</div>
{{/isAuthorized}}
@@ -81,6 +83,8 @@
<button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action doAction serviceVersion view.actionTypes.SWITCH target="view"}}><i class="icon-search"></i> {{t common.view}}</button>
{{#isAuthorized "SERVICE.COMPARE_CONFIGS"}}
<button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action doAction serviceVersion view.actionTypes.COMPARE target="view"}}><i class="icon-copy"></i> {{t common.compare}}</button>
+ {{/isAuthorized}}
+ {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
<button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor serviceVersion.isCompatible::hidden" title="serviceVersion.disabledActionMessages.revert"}} {{action doAction serviceVersion view.actionTypes.REVERT target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
{{/isAuthorized}}
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/4ff99fcc/ambari-web/app/templates/common/configs/service_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_version_box.hbs b/ambari-web/app/templates/common/configs/service_version_box.hbs
index 65d7f48..d44efb8 100644
--- a/ambari-web/app/templates/common/configs/service_version_box.hbs
+++ b/ambari-web/app/templates/common/configs/service_version_box.hbs
@@ -46,6 +46,8 @@
<button {{bindAttr disabled="view.disabledActionAttr.view" class=":btn view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.view"}} {{action doAction view.serviceVersion view.actionTypes.SWITCH target="view.parentView"}}><i class="icon-search"></i> {{t common.view}}</button>
{{#isAuthorized "SERVICE.COMPARE_CONFIGS"}}
<button {{bindAttr disabled="view.disabledActionAttr.compare" class=":btn view.serviceVersion.isDisplayed:not-allowed-cursor" title="view.disabledActionMessages.compare"}} {{action doAction view.serviceVersion view.actionTypes.COMPARE target="view.parentView"}}><i class="icon-copy"></i> {{t common.compare}}</button>
+ {{/isAuthorized}}
+ {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
<button {{bindAttr disabled="view.disabledActionAttr.revert" class=":btn view.serviceVersion.isCurrent:not-allowed-cursor view.serviceVersion.isCompatible::hidden" title="view.disabledActionMessages.revert"}} {{action doAction view.serviceVersion view.actionTypes.REVERT target="view.parentView"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
{{/isAuthorized}}
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/4ff99fcc/ambari-web/app/views/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details.js b/ambari-web/app/views/main/host/details.js
index 5b42766..784e63c 100644
--- a/ambari-web/app/views/main/host/details.js
+++ b/ambari-web/app/views/main/host/details.js
@@ -17,7 +17,6 @@
*/
var App = require('app');
-var date = require('utils/date/date');
App.MainHostDetailsView = Em.View.extend({
templateName: require('templates/main/host/details'),
@@ -31,34 +30,66 @@ App.MainHostDetailsView = Em.View.extend({
clients: Em.computed.filterBy('content.hostComponents', 'isClient', true),
- clientsWithConfigs: function() {
- return this.get('content.hostComponents').filterProperty('isClient').filter(function(client) {
+ clientsWithConfigs: function () {
+ return this.get('content.hostComponents').filterProperty('isClient').filter(function (client) {
return !App.get('services.noConfigTypes').contains(client.get('service.serviceName'));
});
}.property('content.hostComponents.@each'),
isActive: Em.computed.equal('controller.content.passiveState', 'OFF'),
- maintenance: function(){
+ maintenance: function () {
var onOff = this.get('isActive') ? "On" : "Off";
var result = [];
if (App.isAuthorized("SERVICE.START_STOP")) {
result = result.concat([
- {action: 'startAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-play', 'label': this.t('hosts.host.details.startAllComponents')},
- {action: 'stopAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-stop', 'label': this.t('hosts.host.details.stopAllComponents')},
- {action: 'restartAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-repeat', 'label': this.t('hosts.host.details.restartAllComponents')}
+ {
+ action: 'startAllComponents',
+ liClass: this.get('controller.content.isNotHeartBeating') ? 'disabled' : 'enabled',
+ cssClass: 'icon-play',
+ label: this.t('hosts.host.details.startAllComponents')
+ },
+ {
+ action: 'stopAllComponents',
+ liClass: this.get('controller.content.isNotHeartBeating') ? 'disabled' : 'enabled',
+ cssClass: 'icon-stop',
+ label: this.t('hosts.host.details.stopAllComponents')
+ },
+ {
+ action: 'restartAllComponents',
+ liClass: this.get('controller.content.isNotHeartBeating') ? 'disabled' : 'enabled',
+ cssClass: 'icon-repeat',
+ label: this.t('hosts.host.details.restartAllComponents')
+ }
]);
}
- result.push({action: 'setRackId', liClass:'', cssClass: 'icon-gear', 'label': this.t('hosts.host.details.setRackId')});
if (App.isAuthorized("HOST.TOGGLE_MAINTENANCE")) {
- result.push({action: 'onOffPassiveModeForHost', liClass:'', cssClass: 'icon-medkit', active:this.get('isActive'), 'label': this.t('passiveState.turn' + onOff)});
+ result.push({
+ action: 'setRackId',
+ liClass: '',
+ cssClass: 'icon-gear',
+ label: this.t('hosts.host.details.setRackId')
+ });
+ result.push({
+ action: 'onOffPassiveModeForHost',
+ liClass: '',
+ cssClass: 'icon-medkit',
+ active: this.get('isActive'),
+ label: this.t('passiveState.turn' + onOff)
+ });
}
if (App.isAuthorized("HOST.ADD_DELETE_HOSTS")) {
- result.push({action: 'deleteHost', liClass:'', cssClass: 'icon-remove', 'label': this.t('hosts.host.details.deleteHost')});
+ result.push({
+ action: 'deleteHost',
+ liClass: '',
+ cssClass: 'icon-remove',
+ label: this.t('hosts.host.details.deleteHost')
+ });
}
return result;
- }.property('controller.content','isActive', 'controller.content.isNotHeartBeating'),
- didInsertElement: function() {
+ }.property('controller.content', 'isActive', 'controller.content.isNotHeartBeating'),
+
+ didInsertElement: function () {
var self = this;
var host = self.get('content');
@@ -71,5 +102,10 @@ App.MainHostDetailsView = Em.View.extend({
App.router.transitionTo('main.hosts.index');
}
});
+ },
+
+ willDestroyElement: function () {
+ $("[rel='HealthTooltip']").tooltip('destroy');
}
+
});
[2/3] ambari git commit: AMBARI-15909. Alert help_url is not visible
on the dash board (onechiporenko)
Posted by on...@apache.org.
AMBARI-15909. Alert help_url is not visible on the dash board (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2d3fb6b6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2d3fb6b6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2d3fb6b6
Branch: refs/heads/trunk
Commit: 2d3fb6b6babe682e928d01121c9fa8841adf771a
Parents: 94c2329
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Apr 15 12:49:08 2016 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Apr 15 14:43:14 2016 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/global/update_controller.js | 2 +-
ambari-web/app/mappers/alert_definitions_mapper.js | 2 +-
ambari-web/test/mappers/alert_definitions_mapper_test.js | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2d3fb6b6/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index e13fe41..62bab46 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -546,7 +546,7 @@ App.UpdateController = Em.Controller.extend({
var realUrl = '/alert_definitions?fields=' +
'AlertDefinition/component_name,AlertDefinition/description,AlertDefinition/enabled,AlertDefinition/repeat_tolerance,AlertDefinition/repeat_tolerance_enabled,' +
'AlertDefinition/id,AlertDefinition/ignore_host,AlertDefinition/interval,AlertDefinition/label,AlertDefinition/name,' +
- 'AlertDefinition/scope,AlertDefinition/service_name,AlertDefinition/source';
+ 'AlertDefinition/scope,AlertDefinition/service_name,AlertDefinition/source,AlertDefinition/help_url';
var url = this.getUrl(testUrl, realUrl);
App.HttpClient.get(url, App.alertDefinitionsMapper, {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2d3fb6b6/ambari-web/app/mappers/alert_definitions_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/alert_definitions_mapper.js b/ambari-web/app/mappers/alert_definitions_mapper.js
index 0b5e3a7..cd4e738 100644
--- a/ambari-web/app/mappers/alert_definitions_mapper.js
+++ b/ambari-web/app/mappers/alert_definitions_mapper.js
@@ -39,7 +39,7 @@ App.alertDefinitionsMapper = App.QuickDataMapper.create({
repeat_tolerance: 'AlertDefinition.repeat_tolerance',
scope: 'AlertDefinition.scope',
interval: 'AlertDefinition.interval',
- helpUrl: 'AlertDefinition.help_url',
+ help_url: 'AlertDefinition.help_url',
type: 'AlertDefinition.source.type',
reporting_key: 'reporting',
reporting_type: 'array',
http://git-wip-us.apache.org/repos/asf/ambari/blob/2d3fb6b6/ambari-web/test/mappers/alert_definitions_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/alert_definitions_mapper_test.js b/ambari-web/test/mappers/alert_definitions_mapper_test.js
index 1c3ff60..5a8e214 100644
--- a/ambari-web/test/mappers/alert_definitions_mapper_test.js
+++ b/ambari-web/test/mappers/alert_definitions_mapper_test.js
@@ -198,7 +198,7 @@ describe('App.alertDefinitionsMapper', function () {
"component_name" : "NAMENODE",
"description" : "This service-level alert is triggered if the NN heap usage deviation has grown beyond the specified threshold within a given time interval.",
"enabled" : true,
- "help_url" : null,
+ "help_url" : "http://test.test",
"id" : 6,
"ignore_host" : false,
"interval" : 1,
@@ -504,6 +504,7 @@ describe('App.alertDefinitionsMapper', function () {
"scope" : "SERVICE",
"service_name" : "HDFS",
"component_name" : "NAMENODE",
+ "help_url" : "http://test.test"
}
];
[3/3] ambari git commit: AMBARI-15908. Default Error Handler Popup
doesn't show correct request type (onechiporenko)
Posted by on...@apache.org.
AMBARI-15908. Default Error Handler Popup doesn't show correct request type (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/94c23298
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/94c23298
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/94c23298
Branch: refs/heads/trunk
Commit: 94c23298adc0410b963a25290b9eb5d7f6932a65
Parents: ebc66f7
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Apr 15 12:44:23 2016 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Apr 15 14:43:14 2016 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 2 +-
ambari-web/app/controllers/main/service/item.js | 2 +-
ambari-web/app/controllers/wizard.js | 2 +-
ambari-web/app/mixins/common/reload_popup.js | 2 +-
.../common/widgets/export_metrics_mixin.js | 2 +-
.../host_components/install_component.js | 2 +-
.../mixins/wizard/assign_master_components.js | 2 +-
.../wizard/wizardProgressPageController.js | 2 +-
.../main/service/add_controller_test.js | 2 +-
.../test/mixins/common/reload_popup_test.js | 5 --
.../test/mixins/common/widget_mixin_test.js | 8 ---
.../common/widgets/export_metrics_mixin_test.js | 2 +-
.../host_components/install_component_test.js | 2 +-
.../admin/stack_upgrade/version_view_test.js | 13 -----
.../wizard/step7/assign_master_view_test.js | 58 +++++++++++---------
15 files changed, 44 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index b2569d2..8664d8c 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -2261,7 +2261,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
else {
completeCallback();
deleteError.xhr.responseText = "{\"message\": \"" + deleteError.xhr.statusText + "\"}";
- App.ajax.defaultErrorHandler(deleteError.xhr, deleteError.url, deleteError.method, deleteError.xhr.status);
+ App.ajax.defaultErrorHandler(deleteError.xhr, deleteError.url, deleteError.type, deleteError.xhr.status);
}
});
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 46488d9..b1ea523 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1394,7 +1394,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
},
deleteServiceCallErrorCallback: function (jqXHR, ajaxOptions, error, opt) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index c3d7f08..adce5ff 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -1233,7 +1233,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
},
loadHostsErrorCallback: function (jqXHR, ajaxOptions, error, opt) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/mixins/common/reload_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/reload_popup.js b/ambari-web/app/mixins/common/reload_popup.js
index 1a0a7f7..c4b37d7 100644
--- a/ambari-web/app/mixins/common/reload_popup.js
+++ b/ambari-web/app/mixins/common/reload_popup.js
@@ -32,7 +32,7 @@ App.ReloadPopupMixin = Em.Mixin.create({
if (jqXHR.status) {
this.closeReloadPopup();
if (params.shouldUseDefaultHandler) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
}
} else {
var times = Em.isNone(params.times) ? App.get('maxRetries') : params.times,
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
index 2ecb045..7517efd 100644
--- a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
@@ -76,7 +76,7 @@ App.ExportMetricsMixin = Em.Mixin.create({
},
exportGraphDataErrorCallback: function (jqXHR, ajaxOptions, error, opt) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
},
prepareCSV: function (data) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/mixins/main/host/details/host_components/install_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/host_components/install_component.js b/ambari-web/app/mixins/main/host/details/host_components/install_component.js
index 58f0dca..4b535f3 100644
--- a/ambari-web/app/mixins/main/host/details/host_components/install_component.js
+++ b/ambari-web/app/mixins/main/host/details/host_components/install_component.js
@@ -90,7 +90,7 @@ App.InstallComponent = Em.Mixin.create({
* @method ajaxErrorCallback
*/
ajaxErrorCallback: function (request, ajaxOptions, error, opt, params) {
- App.ajax.defaultErrorHandler(request, opt.url, opt.method);
+ App.ajax.defaultErrorHandler(request, opt.url, opt.type);
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index b78daf9..cd8ef14 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -793,7 +793,7 @@ App.AssignMasterComponents = Em.Mixin.create({
* @method loadRecommendationsErrorCallback
*/
loadRecommendationsErrorCallback: function (jqXHR, ajaxOptions, error, opt) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index 7e97459..3ee8a9a 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -377,7 +377,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
},
onSingleRequestError: function (jqXHR, ajaxOptions, error, opt) {
- App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.type, jqXHR.status);
this.set('status', 'FAILED');
this.set('isLoaded', true);
this.set('showRetry', true);
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/controllers/main/service/add_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/add_controller_test.js b/ambari-web/test/controllers/main/service/add_controller_test.js
index 5621ff4..90670a8 100644
--- a/ambari-web/test/controllers/main/service/add_controller_test.js
+++ b/ambari-web/test/controllers/main/service/add_controller_test.js
@@ -295,7 +295,7 @@ describe('App.AddServiceController', function() {
});
it('should execute default error handler', function () {
- addServiceController.loadHostsErrorCallback({status: '500'}, 'textStatus', 'errorThrown', {url: 'url', method: 'GET'});
+ addServiceController.loadHostsErrorCallback({status: '500'}, 'textStatus', 'errorThrown', {url: 'url', type: 'GET'});
expect(App.ajax.defaultErrorHandler.calledOnce).to.be.true;
expect(App.ajax.defaultErrorHandler.calledWith({status: '500'}, 'url', 'GET', '500')).to.be.true;
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/mixins/common/reload_popup_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/reload_popup_test.js b/ambari-web/test/mixins/common/reload_popup_test.js
index c00abf7..6df35a2 100644
--- a/ambari-web/test/mixins/common/reload_popup_test.js
+++ b/ambari-web/test/mixins/common/reload_popup_test.js
@@ -134,7 +134,6 @@ describe('App.ReloadPopupMixin', function () {
sinon.stub(App.ajax, 'defaultErrorHandler', Em.K);
sinon.stub(obj, 'showReloadPopup', Em.K);
sinon.stub(App, 'get').withArgs('maxRetries').returns(3);
- sinon.spy(window, 'setTimeout');
});
afterEach(function () {
@@ -142,7 +141,6 @@ describe('App.ReloadPopupMixin', function () {
App.ajax.defaultErrorHandler.restore();
obj.showReloadPopup.restore();
App.get.restore();
- window.setTimeout.restore();
});
cases.forEach(function (item) {
@@ -170,9 +168,6 @@ describe('App.ReloadPopupMixin', function () {
it('showReloadPopup is called needed number of times', function () {
expect(obj.showReloadPopup.callCount).to.equal(item.showReloadPopupCallCount);
});
- it('setTimeout is called needed number of times', function () {
- expect(window.setTimeout.callCount).to.equal(item.setTimeoutCount);
- });
});
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/mixins/common/widget_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widget_mixin_test.js b/ambari-web/test/mixins/common/widget_mixin_test.js
index b2816b8..b56863c 100644
--- a/ambari-web/test/mixins/common/widget_mixin_test.js
+++ b/ambari-web/test/mixins/common/widget_mixin_test.js
@@ -590,25 +590,17 @@ describe('App.WidgetLoadAggregator', function () {
var aggregator = App.WidgetLoadAggregator;
describe("#add()", function () {
- beforeEach(function () {
- sinon.spy(window, 'setTimeout');
- });
- afterEach(function () {
- window.setTimeout.restore();
- });
it("timeout started", function () {
aggregator.set('timeoutId', 'timeId');
aggregator.get('requests').clear();
aggregator.add({});
expect(aggregator.get('requests')).to.not.be.empty;
- expect(window.setTimeout.called).to.be.false;
});
it("timeout started (2)", function () {
aggregator.set('timeoutId', null);
aggregator.get('requests').clear();
aggregator.add({});
expect(aggregator.get('requests')).to.not.be.empty;
- expect(window.setTimeout.calledOnce).to.be.true;
});
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js b/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
index 1cc0730..6b1dd20 100644
--- a/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
+++ b/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
@@ -243,7 +243,7 @@ describe('App.ExportMetricsMixin', function () {
status: 404
}, null, '', {
url: 'url',
- method: 'GET'
+ type: 'GET'
});
expect(App.ajax.defaultErrorHandler.calledOnce).to.be.true;
expect(App.ajax.defaultErrorHandler.calledWith({
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/mixins/main/host/details/host_components/install_component_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/main/host/details/host_components/install_component_test.js b/ambari-web/test/mixins/main/host/details/host_components/install_component_test.js
index c039107..234468e 100644
--- a/ambari-web/test/mixins/main/host/details/host_components/install_component_test.js
+++ b/ambari-web/test/mixins/main/host/details/host_components/install_component_test.js
@@ -108,7 +108,7 @@ describe('App.InstallComponent', function () {
});
it("App.ajax.defaultErrorHandler should be called", function() {
- installComponent.ajaxErrorCallback({}, {}, 'error', {method: 'method1', url: 'url1'}, {});
+ installComponent.ajaxErrorCallback({}, {}, 'error', {type: 'method1', url: 'url1'}, {});
expect(App.ajax.defaultErrorHandler.calledWith({}, 'url1', 'method1')).to.be.true;
});
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
index 38fe9a7..4fb7ba6 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
@@ -408,19 +408,6 @@ describe('App.mainAdminStackVersionsView', function () {
});
});
- describe("#doPolling()", function() {
- before(function () {
- sinon.spy(window, 'setTimeout');
- });
- after(function () {
- window.setTimeout.restore();
- });
- it("setTimeout is called once", function() {
- view.doPolling();
- expect(window.setTimeout.calledOnce).to.be.true;
- });
- });
-
describe("#poll()", function() {
beforeEach(function () {
this.mock = sinon.stub(App.router, 'get');
http://git-wip-us.apache.org/repos/asf/ambari/blob/94c23298/ambari-web/test/views/wizard/step7/assign_master_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/wizard/step7/assign_master_view_test.js b/ambari-web/test/views/wizard/step7/assign_master_view_test.js
index 1aaec7e..7c4a63e 100644
--- a/ambari-web/test/views/wizard/step7/assign_master_view_test.js
+++ b/ambari-web/test/views/wizard/step7/assign_master_view_test.js
@@ -27,23 +27,23 @@ function getView() {
});
}
-describe('App.AssignMasterOnStep7View', function() {
+describe('App.AssignMasterOnStep7View', function () {
- beforeEach(function() {
+ beforeEach(function () {
view = getView();
});
describe("#willInsertElement()", function () {
- beforeEach(function() {
+ beforeEach(function () {
sinon.stub(view, 'setAlertMessage');
});
- afterEach(function() {
+ afterEach(function () {
view.setAlertMessage.restore();
});
- it("setAlertMessage should be called", function() {
+ it("setAlertMessage should be called", function () {
view.willInsertElement();
expect(view.setAlertMessage.calledOnce).to.be.true;
});
@@ -51,32 +51,32 @@ describe('App.AssignMasterOnStep7View', function() {
describe("#getDependentComponents()", function () {
- beforeEach(function() {
+ beforeEach(function () {
sinon.stub(App.StackServiceComponent, 'find').returns(Em.Object.create({
dependencies: [{
scope: 'host',
componentName: 'C1'
}]
}));
- sinon.stub(App.format, 'role', function(arg) {
+ sinon.stub(App.format, 'role', function (arg) {
return arg;
});
});
- afterEach(function() {
+ afterEach(function () {
App.StackServiceComponent.find.restore();
App.format.role.restore();
});
- it("should return dependent components", function() {
+ it("should return dependent components", function () {
expect(view.getDependentComponents([{}])).to.be.eql(['C1']);
});
});
describe("#setAlertMessage()", function () {
- beforeEach(function() {
- sinon.stub(App.format, 'role', function(arg) {
+ beforeEach(function () {
+ sinon.stub(App.format, 'role', function (arg) {
return arg;
});
sinon.stub(view, 'getDependentComponents').returns(['c1']);
@@ -84,17 +84,20 @@ describe('App.AssignMasterOnStep7View', function() {
this.mock = sinon.stub(App, 'get');
});
- afterEach(function() {
+ afterEach(function () {
App.format.role.restore();
view.getDependentComponents.restore();
stringUtils.getFormattedStringFromArray.restore();
this.mock.restore();
});
- it("isManualKerberos false, single master", function() {
- var expected = Em.I18n.t('installer.step7.assign.master.body')
- .format('c1', Em.I18n.t('common.host').toLowerCase(), Em.I18n.t('it')) +
- '<br/>' + Em.I18n.t('installer.step7.assign.master.dependent.component.body').format('');
+ it("isManualKerberos false, single master", function () {
+
+ var expected = [
+ Em.I18n.t('installer.step7.assign.master.body').format('c1', Em.I18n.t('common.host').toLowerCase(), Em.I18n.t('it')),
+ Em.I18n.t('installer.step7.assign.master.dependent.component.body').format('')
+ ].join('<br/>');
+
view.set('controller.mastersToCreate', ['c1']);
this.mock.returns(false);
@@ -102,10 +105,13 @@ describe('App.AssignMasterOnStep7View', function() {
expect(view.get('alertMessage')).to.be.equal(expected);
});
- it("isManualKerberos false, multiple masters", function() {
- var expected = Em.I18n.t('installer.step7.assign.master.body')
- .format('c1,c2', Em.I18n.t('common.hosts').toLowerCase(), Em.I18n.t('then')) +
- '<br/>' + Em.I18n.t('installer.step7.assign.master.dependent.component.body').format('');
+ it("isManualKerberos false, multiple masters", function () {
+
+ var expected = [
+ Em.I18n.t('installer.step7.assign.master.body').format('c1,c2', Em.I18n.t('common.hosts').toLowerCase(), Em.I18n.t('then')),
+ Em.I18n.t('installer.step7.assign.master.dependent.component.body').format('')
+ ].join('<br/>');
+
view.set('controller.mastersToCreate', ['c1', 'c2']);
this.mock.returns(false);
@@ -113,11 +119,13 @@ describe('App.AssignMasterOnStep7View', function() {
expect(view.get('alertMessage')).to.be.equal(expected);
});
- it("isManualKerberos true, single master", function() {
- var expected = Em.I18n.t('installer.step7.assign.master.body')
- .format('c1', Em.I18n.t('common.host').toLowerCase(), Em.I18n.t('it')) +
- '<br/>' + Em.I18n.t('installer.step7.assign.master.dependent.component.body').format('') +
- '<br/>' + Em.I18n.t('common.warn.message').format(Em.I18n.t('common.important') + ': ' + Em.I18n.t('installer.step8.kerberors.warning'));
+ it("isManualKerberos true, single master", function () {
+
+ var expected = [
+ Em.I18n.t('installer.step7.assign.master.body').format('c1', Em.I18n.t('common.host').toLowerCase(), Em.I18n.t('it')),
+ Em.I18n.t('installer.step7.assign.master.dependent.component.body').format(''),
+ Em.I18n.t('common.warn.message').format(Em.I18n.t('common.important') + ': ' + Em.I18n.t('installer.step8.kerberors.warning'))
+ ].join('<br/>');
view.set('controller.mastersToCreate', ['c1']);
this.mock.returns(true);