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 2014/07/07 20:44:13 UTC
[1/2] git commit: AMBARI-6395 Hosts section is not loading.(Max
Shepel via atkach)
Repository: ambari
Updated Branches:
refs/heads/trunk e9d8264a5 -> cb1ec1e2a
AMBARI-6395 Hosts section is not loading.(Max Shepel via atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cb1ec1e2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cb1ec1e2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cb1ec1e2
Branch: refs/heads/trunk
Commit: cb1ec1e2a599fe36941c622e840bce6e0ebef908
Parents: e3de7b3
Author: atkach <at...@hortonworks.com>
Authored: Mon Jul 7 21:43:46 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Mon Jul 7 21:44:05 2014 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/global/update_controller.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb1ec1e2/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 6007ba5..6238658 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -187,13 +187,11 @@ App.UpdateController = Em.Controller.extend({
var params = p + self.computeParameters(queryParams),
viewProps = self.computeParameters(viewProperties),
sortProps = self.computeParameters(sortProperties);
- if (!viewProps.length) viewProps = '&';
- if (!sortProps.length) sortProps = '&';
if ((params.length + viewProps.length + sortProps.length) > 0) {
realUrl = App.get('apiPrefix') + '/clusters/' + App.get('clusterName') +
- realUrl.replace('<parameters>', '') + '&' +
- viewProps.substring(0, viewProps.length - 1) + '&' +
- sortProps.substring(0, sortProps.length - 1);
+ realUrl.replace('<parameters>', '') +
+ (viewProps.length > 0 ? '&' + viewProps.substring(0, viewProps.length - 1) : '') +
+ (sortProps.length > 0 ? '&' + sortProps.substring(0, sortProps.length - 1) : '');
App.HttpClient.get(realUrl, App.hostsMapper, {
complete: callback,
doGetAsPost: true,
[2/2] git commit: AMBARI-6406 Move Wizard: assign master step next
button is not disabled, when host input has error. (atkach)
Posted by at...@apache.org.
AMBARI-6406 Move Wizard: assign master step next button is not disabled, when host input has error. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e3de7b3b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e3de7b3b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e3de7b3b
Branch: refs/heads/trunk
Commit: e3de7b3b684af470fb8f5b08279ba28d4f979a48
Parents: e9d8264
Author: atkach <at...@hortonworks.com>
Authored: Mon Jul 7 21:26:14 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Mon Jul 7 21:44:05 2014 +0300
----------------------------------------------------------------------
.../main/service/reassign/step2_controller.js | 26 +++++++++++++++
.../app/controllers/wizard/step5_controller.js | 35 ++------------------
2 files changed, 29 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3de7b3b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step2_controller.js b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
index 35e205c..8964c1b 100644
--- a/ambari-web/app/controllers/main/service/reassign/step2_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
@@ -82,6 +82,32 @@ App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
}
item.set("availableHosts", preparedAvailableHosts.sortProperty('host_name'));
}, this);
+ },
+ /**
+ * Determines if hostName is valid for component:
+ * <ul>
+ * <li>host should have only one component with <code>componentName</code></li>
+ * </ul>
+ * @param {string} componentName
+ * @param {string} selectedHost
+ * @returns {boolean} true - valid, false - invalid
+ * @method isHostNameValid
+ */
+ isHostNameValid: function (componentName, selectedHost) {
+ var isValid = this._super(componentName, selectedHost);
+
+ if (isValid) {
+ var reassigned = 0;
+ var existedComponents = App.HostComponent.find().filterProperty('componentName', this.get('content.reassign.component_name')).mapProperty('hostName');
+ var newComponents = this.get('servicesMasters').mapProperty('selectedHost');
+ existedComponents.forEach(function (host) {
+ if (!newComponents.contains(host)) {
+ reassigned++;
+ }
+ }, this);
+ isValid = !(reassigned !== 1);
+ }
+ return isValid;
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3de7b3b/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index 6bcc467..f004cb0 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -185,41 +185,12 @@ App.WizardStep5Controller = Em.Controller.extend({
* @metohd getIsSubmitDisabled
*/
getIsSubmitDisabled: function () {
- if (!this.get('isReassignWizard')) {
- this.set('submitDisabled', this.get('servicesMasters').someProperty('isHostNameValid', false));
- }
- else {
- App.ajax.send({
- name: 'host_components.all',
- sender: this,
- data: {
- clusterName: App.get('clusterName')
- },
- success: 'getIsSubmitDisabledSuccessCallBack'
- });
- }
+ var isSubmitDisabled = this.get('servicesMasters').someProperty('isHostNameValid', false);
+ this.set('submitDisabled', isSubmitDisabled);
+ return isSubmitDisabled;
}.observes('servicesMasters.@each.selectedHost', 'servicesMasters.@each.isHostNameValid'),
/**
- * Success callback for getIsSubmitDisabled method
- * Set true for Reassign Master Wizard and if more than one master component was reassigned.
- * For installer, addHost and addService verify that provided host names for components are valid
- * @param {object} response
- * @method getIsSubmitDisabledSuccessCallBack
- */
- getIsSubmitDisabledSuccessCallBack: function (response) {
- var reassigned = 0;
- var arr1 = response.items.mapProperty('HostRoles').filterProperty('component_name', this.get('content.reassign.component_name')).mapProperty('host_name');
- var arr2 = this.get('servicesMasters').mapProperty('selectedHost');
- arr1.forEach(function (host) {
- if (!arr2.contains(host)) {
- reassigned++;
- }
- }, this);
- this.set('submitDisabled', reassigned !== 1);
- },
-
- /**
* Clear controller data (hosts, masters etc)
* @method clearStep
*/