Bläddra i källkod

Revert "AMBARI-3054. User Preference to show 'Background Operations'.(xiwang)"

This reverts commit b6f0bc4e5542e3155012aea118dcac3f94c6ac4f.
Srimanth Gunturi 11 år sedan
förälder
incheckning
0e6ca79085

+ 0 - 1
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');

+ 1 - 3
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 {

+ 0 - 95
ambari-web/app/controllers/main/admin/user_settings.js

@@ -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);
-      }
-    });
-  }
-});

+ 8 - 22
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({
   }
 
 });
-

+ 1 - 3
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");

+ 4 - 12
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');

+ 0 - 4
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',
 

+ 1 - 7
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) {

+ 0 - 15
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*/

+ 0 - 29
ambari-web/app/templates/main/admin/userSettings.hbs

@@ -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>

+ 0 - 11
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);

+ 0 - 1
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');

+ 0 - 2
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"}} &nbsp;' +
-      '{{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>',

+ 0 - 5
ambari-web/app/views/main/admin.js

@@ -46,11 +46,6 @@ App.MainAdminView = Em.View.extend({
       url: 'adminCluster',
       label: Em.I18n.t('common.cluster')
     });
-    items.push({
-      name: 'userSettings',
-      url: 'adminUserSettings',
-      label: Em.I18n.t('common.userSettings')
-    });
     items.push({
       name: 'misc',
       url: 'adminMisc',