You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/10/31 23:48:20 UTC
[3/3] git commit: Revert "AMBARI-3054. User Preference to show
'Background Operations'.(xiwang)"
Revert "AMBARI-3054. User Preference to show 'Background Operations'.(xiwang)"
This reverts commit b6f0bc4e5542e3155012aea118dcac3f94c6ac4f.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/0e6ca790
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0e6ca790
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0e6ca790
Branch: refs/heads/trunk
Commit: 0e6ca79085b19de2306409b23bfc019aa4dd4800
Parents: ea86d69
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Oct 31 15:46:53 2013 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Oct 31 15:46:53 2013 -0700
----------------------------------------------------------------------
ambari-web/app/controllers.js | 1 -
.../global/background_operations_controller.js | 4 +-
.../app/controllers/main/admin/user_settings.js | 95 --------------------
ambari-web/app/controllers/main/host/details.js | 30 ++-----
ambari-web/app/controllers/main/service.js | 4 +-
ambari-web/app/controllers/main/service/item.js | 16 +---
ambari-web/app/messages.js | 4 -
ambari-web/app/routes/main.js | 8 +-
ambari-web/app/styles/application.less | 15 ----
.../app/templates/main/admin/userSettings.hbs | 29 ------
ambari-web/app/utils/host_progress_popup.js | 11 ---
ambari-web/app/views.js | 1 -
ambari-web/app/views/common/modal_popup.js | 2 -
ambari-web/app/views/main/admin.js | 5 --
14 files changed, 15 insertions(+), 210 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 78a5f45..80bfac9 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -44,7 +44,6 @@ require('controllers/main/admin/rollbackHA/step2_controller');
require('controllers/main/admin/rollbackHA/step3_controller');
require('controllers/main/admin/rollbackHA/rollback_wizard_controller');
require('controllers/main/admin/cluster');
-require('controllers/main/admin/user_settings');
require('controllers/main/admin/stack_upgrade_controller');
require('controllers/main/admin/user');
require('controllers/main/admin/misc_controller');
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/controllers/global/background_operations_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/background_operations_controller.js b/ambari-web/app/controllers/global/background_operations_controller.js
index 3ad6a25..323834f 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -224,9 +224,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
*/
showPopup: function(){
App.updater.immediateRun('requestMostRecent');
-
- if(this.get('popupView') && App.HostPopup.get('isBackgroundOperations') && App.HostPopup.get('showServices')){
- this.set ('popupView.isNotShowBgChecked', !App.router.get('mainAdminUserSettingsController').loadShowBgChecked());
+ if(this.get('popupView') && App.HostPopup.get('isBackgroundOperations')){
this.set('popupView.isOpen', true);
$(this.get('popupView.element')).appendTo('#wrapper');
} else {
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/controllers/main/admin/user_settings.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/user_settings.js b/ambari-web/app/controllers/main/admin/user_settings.js
deleted file mode 100644
index 19b1a21..0000000
--- a/ambari-web/app/controllers/main/admin/user_settings.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainAdminUserSettingsController = Em.Controller.extend({
- name:'mainAdminUserSettingsController',
- loadShowBgChecked: function () {
- if (App.testMode) {
- return true;
- } else {
- this.getUserPref(this.persistKey());
- var currentPrefObject = this.get('currentPrefObject');
- if (currentPrefObject != null) {
- return currentPrefObject;
- } else {
- // post persist
- this.postUserPref(this.persistKey(), true);
- return true;
- }
- }
- },
-
- persistKey: function () {
- var loginName = App.router.get('loginName');
- return 'admin-settings-show-bg-' + loginName;
- },
- currentPrefObject: null,
-
- /**
- * get persist value from server with persistKey
- */
- getUserPref: function (key) {
- var self = this;
- var url = App.apiPrefix + '/persist/' + key;
- jQuery.ajax(
- {
- url: url,
- context: this,
- async: false,
- success: function (response) {
- if (response) {
- var value = jQuery.parseJSON(response);
- console.log('Got persist value from server with key: ' + key + '. Value is: ' + response);
- self.set('currentPrefObject', value);
- return value;
- }
- },
- error: function (xhr) {
- // this user is first time login
- if (xhr.status == 404) {
- console.log('Persist did NOT find the key: '+ key);
- self.set('currentPrefObject', null);
- return null;
- }
- },
- statusCode: require('data/statusCodes')
- }
- );
- },
- /**
- * post persist key/value to server, value is object
- */
- postUserPref: function (key, value) {
- var url = App.apiPrefix + '/persist/';
- var keyValuePair = {};
- keyValuePair[key] = JSON.stringify(value);
-
- jQuery.ajax({
- async: false,
- context: this,
- type: "POST",
- url: url,
- data: JSON.stringify(keyValuePair),
- beforeSend: function () {
- console.log('BeforeSend to persist: persistKeyValues', keyValuePair);
- }
- });
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/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 81b95fa..7cdb0c4 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -239,7 +239,7 @@ App.MainHostDetailsController = Em.Controller.extend({
deleted = {xhr: xhr, url: url, method: 'DELETE'};
},
statusCode: require('data/statusCodes')
- });
+ });
return deleted;
},
@@ -278,9 +278,7 @@ App.MainHostDetailsController = Em.Controller.extend({
App.router.get('clusterController').loadUpdatedStatusDelayed(500);
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
});
@@ -351,14 +349,10 @@ App.MainHostDetailsController = Em.Controller.extend({
component.set('workStatus', App.HostComponentStatus.stopped);
},App.testModeDelayForActions);
}
-
} else {
App.router.get('clusterController').loadUpdatedStatusDelayed(500);
}
-
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
},
@@ -471,9 +465,8 @@ App.MainHostDetailsController = Em.Controller.extend({
App.router.get('clusterController').loadUpdatedStatusDelayed(500);
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
+
});
});
},
@@ -527,9 +520,7 @@ App.MainHostDetailsController = Em.Controller.extend({
App.router.get('clusterController').loadUpdatedStatusDelayed(500);
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
}
@@ -557,9 +548,7 @@ App.MainHostDetailsController = Em.Controller.extend({
}
self.doDatanodeDecommission(decommissionHostNames, true);
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
},
@@ -661,9 +650,7 @@ App.MainHostDetailsController = Em.Controller.extend({
decommissionHostNames.splice(index, 1);
self.doDatanodeDecommission(decommissionHostNames, false);
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
},
@@ -873,4 +860,3 @@ App.MainHostDetailsController = Em.Controller.extend({
}
});
-
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index 979e4fb..55e5fa8 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -109,9 +109,7 @@ App.MainServiceController = Em.ArrayController.extend({
var requestId = data.Requests.id;
console.log('requestId is: ' + requestId);
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
},
allServicesCallErrorCallback: function() {
console.log("ERROR");
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/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 8910f65..898d4ef 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -76,9 +76,7 @@ App.MainServiceItemController = Em.Controller.extend({
else {
App.router.get('clusterController').loadUpdatedStatusDelayed(500);// @todo check working without param 500
}
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
},
/**
* Confirmation popup for start/stop services
@@ -142,9 +140,7 @@ App.MainServiceItemController = Em.Controller.extend({
var self = this;
App.showConfirmationPopup(function() {
self.content.set('runRebalancer', true);
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
},
@@ -156,9 +152,7 @@ App.MainServiceItemController = Em.Controller.extend({
var self = this;
App.showConfirmationPopup(function() {
self.content.set('runCompaction', true);
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
});
},
@@ -192,9 +186,7 @@ App.MainServiceItemController = Em.Controller.extend({
runSmokeTestSuccessCallBack: function(data) {
if (data.Requests.id) {
- if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
- App.router.get('backgroundOperationsController').showPopup();
- }
+ App.router.get('backgroundOperationsController').showPopup();
}
else {
console.warn('error during runSmokeTestSuccessCallBack');
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index eb0e755..897f991 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -133,7 +133,6 @@ Em.I18n.translations = {
'common.stats':'Stats',
'common.abort': 'Abort',
'common.misc': 'Misc',
- 'common.userSettings': 'User Settings',
'common.operations': 'Operations',
'common.reinstall': 'Re-Install',
'common.errorPopup.header': 'An error has been encountered',
@@ -873,9 +872,6 @@ Em.I18n.translations = {
'admin.cluster.upgradeAvailable':'Upgrade available',
'admin.cluster.upgradeUnavailable':'Upgrade unavailable',
- 'admin.userSettings.header': 'Customize User Settings',
- 'admin.userSettings.showBgOperations': 'Show background operations dialog when an operation is started',
- 'admin.userSettings.notShowBgOperations': 'Do not show this dialog again when starting a background operation',
'admin.misc.header': 'Service Users and Groups',
'admin.misc.nothingToShow': 'No user accounts to display',
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index ec2dd9a..f0e1670 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -793,13 +793,7 @@ module.exports = Em.Route.extend({
router.get('mainAdminController').connectOutlet('mainAdminAdvanced');
}
}),
- adminUserSettings: Em.Route.extend({
- route: '/userSettings',
- connectOutlets: function (router) {
- router.set('mainAdminController.category', "userSettings");
- router.get('mainAdminController').connectOutlet('mainAdminUserSettings');
- }
- }),
+
adminMisc: Em.Route.extend({
route: '/misc',
connectOutlets: function (router) {
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 49c985e..6568d9b 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1053,16 +1053,6 @@ a:focus {
overflow: auto;
width: 100%;
}
- .modal-footer {
- #footer-checkbox {
- text-align: left;
- padding-top: 3px;
- margin-left: 22px;
- .checkbox {
- margin: 0px;
- }
- }
- }
.modal-body {
@@ -3090,11 +3080,6 @@ table.graphs {
}
}
-.admin-user-settings {
- .checkbox {
- margin: 0px;
- }
-}
/*End Admin*/
/*assign masters*/
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/templates/main/admin/userSettings.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/userSettings.hbs b/ambari-web/app/templates/main/admin/userSettings.hbs
deleted file mode 100644
index 9d87b9b..0000000
--- a/ambari-web/app/templates/main/admin/userSettings.hbs
+++ /dev/null
@@ -1,29 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class="admin-user-settings">
- <div class="header">
- <strong>{{t admin.userSettings.header}}</strong>
- </div>
- <div>
- <label>
- {{view Ember.Checkbox checkedBinding="view.isShowBgChecked" classNames="checkbox"}}
- {{t admin.userSettings.showBgOperations}}
- </label>
- </div>
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/utils/host_progress_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/host_progress_popup.js b/ambari-web/app/utils/host_progress_popup.js
index 5930ed3..9b3006f 100644
--- a/ambari-web/app/utils/host_progress_popup.js
+++ b/ambari-web/app/utils/host_progress_popup.js
@@ -479,17 +479,6 @@ App.HostPopup = Em.Object.create({
template: Ember.Handlebars.compile('{{popupHeaderName}}')
}),
classNames: ['sixty-percent-width-modal'],
- // for the checkbox: do not show this dialog again
- hasFooterCheckbox: true,
- isNotShowBgChecked : null,
- updateNotShowBgChecked: function () {
- var curVal = !this.get('isNotShowBgChecked');
- var key = App.router.get('mainAdminUserSettingsController').persistKey();
- if (!App.testMode) {
- App.router.get('mainAdminUserSettingsController').postUserPref(key, curVal);
- }
- }.observes('isNotShowBgChecked'),
-
autoHeight: false,
closeModelPopup: function () {
this.set('isOpen', false);
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 16be05b..c7980cb 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -72,7 +72,6 @@ require('views/main/admin/rollbackHA/step3_view');
require('views/main/admin/rollbackHA/rollback_wizard_view');
require('views/main/admin/cluster');
require('views/main/admin/misc_view');
-require('views/main/admin/user_settings');
require('views/main/admin/stack_upgrade');
require('views/main/admin/advanced');
require('views/main/admin/advanced/password');
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/views/common/modal_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/modal_popup.js b/ambari-web/app/views/common/modal_popup.js
index f231965..ecb8b5e 100644
--- a/ambari-web/app/views/common/modal_popup.js
+++ b/ambari-web/app/views/common/modal_popup.js
@@ -39,8 +39,6 @@ App.ModalPopup = Ember.View.extend({
'{{#if footerClass}}{{view footerClass}}',
'{{else}}',
'<div class="modal-footer">',
- '{{#if view.hasFooterCheckbox}} <label id="footer-checkbox" class="span8"> {{view Ember.Checkbox classNames="checkbox" checkedBinding="view.isNotShowBgChecked"}} ' +
- '{{t admin.userSettings.notShowBgOperations}}</label> {{/if}}',
'{{#if view.secondary}}<a class="btn" {{action onSecondary target="view"}}>{{view.secondary}}</a>{{/if}}',
'{{#if view.primary}}<a {{bindAttr class="view.enablePrimary::disabled :btn :btn-success"}} {{action onPrimary target="view"}}>{{view.primary}}</a>{{/if}}',
'</div>',
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0e6ca790/ambari-web/app/views/main/admin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js
index 33479a5..0d6ec6c 100644
--- a/ambari-web/app/views/main/admin.js
+++ b/ambari-web/app/views/main/admin.js
@@ -47,11 +47,6 @@ App.MainAdminView = Em.View.extend({
label: Em.I18n.t('common.cluster')
});
items.push({
- name: 'userSettings',
- url: 'adminUserSettings',
- label: Em.I18n.t('common.userSettings')
- });
- items.push({
name: 'misc',
url: 'adminMisc',
label: Em.I18n.t('common.misc')