Browse Source

Revert "AMBARI-21205 Make ToggleKerberos and AddDeleteService experimental features (Duc Le via rzang)"

This reverts commit 57bb1365e414c1f110d2d142fa198fb8e043af95.
Jaimin Jetly 8 years ago
parent
commit
7e0fe29136

+ 2 - 4
ambari-web/app/config.js

@@ -86,11 +86,9 @@ App.supports = {
   addingNewRepository: false,
   kerberosStackAdvisor: true,
   logCountVizualization: false,
-  createAlerts: false,
-  enabledWizardForHostOrderedUpgrade: true,
   manageJournalNode: true,
-  enableToggleKerberos: true,
-  enableAddDeleteServices: true
+  createAlerts: false,
+  enabledWizardForHostOrderedUpgrade: true
 };
 
 if (App.enableExperimental) {

+ 1 - 1
ambari-web/app/routes/add_service_routes.js

@@ -24,7 +24,7 @@ module.exports = App.WizardRoute.extend({
   route: '/service/add',
 
   enter: function (router) {
-    if (App.isAuthorized('SERVICE.ADD_DELETE_SERVICES') && App.supports.enableAddDeleteServices) {
+    if (App.isAuthorized('SERVICE.ADD_DELETE_SERVICES')) {
       // `getSecurityStatus` call is required to retrieve information related to kerberos type: Manual or automated kerberos
       router.get('mainController').isLoading.call(router.get('clusterController'),'isClusterNameLoaded').done(function () {
         App.router.get('mainAdminKerberosController').getSecurityStatus().always(function () {

+ 1 - 1
ambari-web/app/routes/main.js

@@ -460,7 +460,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
 
       route: '/kerberos',
       enter: function (router, transition) {
-        if (router.get('loggedIn') && (!App.isAuthorized('CLUSTER.TOGGLE_KERBEROS') || !App.supports.enableToggleKerberos)) {
+        if (router.get('loggedIn') && !App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')) {
           router.transitionTo('main.dashboard.index');
         }
       },

+ 15 - 19
ambari-web/app/templates/main/admin/kerberos.hbs

@@ -20,22 +20,20 @@
     <div>
       <p class="text-success">{{t admin.security.enabled}}
         {{#isAuthorized "CLUSTER.TOGGLE_KERBEROS"}}
-            {{#if App.supports.enableToggleKerberos}}
-              <button class="btn btn-padding btn-warning admin-disable-security-btn" {{bindAttr disabled="isKerberosButtonsDisabled"}} {{action notifySecurityOffPopup target="controller"}}>{{t admin.kerberos.button.disable}} </button>
-              {{#unless isManualKerberos}}
-                <button class="btn btn-success" id="regenerate-keytabs" {{bindAttr disabled="isKerberosButtonsDisabled"}} {{action regenerateKeytabs target="controller"}}>
-                  <i class="glyphicon glyphicon-repeat"></i> {{t admin.kerberos.button.regenerateKeytabs}}</button>
-                {{#if App.isCredentialStorePersistent}}
-                  <button class="btn btn-primary" {{action showManageKDCCredentialsPopup target="controller"}}>{{t admin.kerberos.credentials.store.menu.label}}</button>
-                {{/if}}
-              {{/unless}}
-              <br/>
-              {{#unless isEditMode}}
-                <a href="#" {{action makeConfigsEditable target="controller"}} class="pull-right">
-                  {{t common.edit}}
-                </a>
-              {{/unless}}
+          <button class="btn btn-padding btn-warning admin-disable-security-btn" {{bindAttr disabled="isKerberosButtonsDisabled"}} {{action notifySecurityOffPopup target="controller"}}>{{t admin.kerberos.button.disable}} </button>
+          {{#unless isManualKerberos}}
+            <button class="btn btn-success" id="regenerate-keytabs" {{bindAttr disabled="isKerberosButtonsDisabled"}} {{action regenerateKeytabs target="controller"}}>
+              <i class="glyphicon glyphicon-repeat"></i> {{t admin.kerberos.button.regenerateKeytabs}}</button>
+            {{#if App.isCredentialStorePersistent}}
+              <button class="btn btn-primary" {{action showManageKDCCredentialsPopup target="controller"}}>{{t admin.kerberos.credentials.store.menu.label}}</button>
             {{/if}}
+          {{/unless}}
+          <br/>
+          {{#unless isEditMode}}
+            <a href="#" {{action makeConfigsEditable target="controller"}} class="pull-right">
+              {{t common.edit}}
+            </a>
+          {{/unless}}
         {{/isAuthorized}}
       </p>
     </div>
@@ -53,10 +51,8 @@
     <div>
       <p class="muted background-text">{{t admin.security.disabled}}
       {{#isAuthorized "CLUSTER.TOGGLE_KERBEROS"}}
-        {{#if App.supports.enableToggleKerberos}}
-          <a class="btn btn-padding btn-success admin-enable-security-btn" {{action checkAndStartKerberosWizard target="controller"}}>{{t admin.kerberos.button.enable}} </a>
-          <br/>
-        {{/if}}
+        <a class="btn btn-padding btn-success admin-enable-security-btn" {{action checkAndStartKerberosWizard target="controller"}}>{{t admin.kerberos.button.enable}} </a>
+        <br/>
       {{/isAuthorized}}
       </p>
     </div>

+ 2 - 4
ambari-web/app/templates/main/service/all_services_actions.hbs

@@ -22,14 +22,12 @@
   </div>
   <ul class="dropdown-menu">
     {{#isAuthorized "SERVICE.ADD_DELETE_SERVICES"}}
-      {{#if App.supports.enableAddDeleteServices}}
-        <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}>
+      <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}>
         <a href="#"
           {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}
           {{action gotoAddService target="view.serviceController"}}>
           <i class="glyphicon glyphicon-plus"></i> {{t services.service.add}}</a>
-        </li>
-      {{/if}}
+      </li>
     {{/isAuthorized}}
     {{#isAuthorized "SERVICE.START_STOP"}}
       <li class="divider"></li>

+ 6 - 8
ambari-web/app/views/main/admin.js

@@ -39,14 +39,12 @@ App.MainAdminView = Em.View.extend({
       });
     }
     if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS') || (App.get('upgradeInProgress') || App.get('upgradeHolding')) ) {
-      if (App.supports.enableToggleKerberos) {
-        items.push({
-          name: 'kerberos',
-          url: 'adminKerberos.index',
-          label: Em.I18n.t('common.kerberos'),
-          disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
-        });
-      }
+      items.push({
+        name: 'kerberos',
+        url: 'adminKerberos.index',
+        label: Em.I18n.t('common.kerberos'),
+        disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
+      });
     }
     if ((App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') && App.isAuthorized('SERVICE.MANAGE_AUTO_START, CLUSTER.MANAGE_AUTO_START')) || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) {
       if (App.supports.serviceAutoStart) {

+ 1 - 1
ambari-web/app/views/main/admin/stack_upgrade/services_view.js

@@ -56,7 +56,7 @@ App.MainAdminStackServicesView = Em.View.extend({
    * @param event
    */
   goToAddService: function (event) {
-    if (!App.isAuthorized('SERVICE.ADD_DELETE_SERVICES') || !App.supports.enableAddDeleteServices) {
+    if (!App.isAuthorized('SERVICE.ADD_DELETE_SERVICES')) {
       return;
     } else if (event.context == "KERBEROS") {
       App.router.get('mainAdminKerberosController').checkAndStartKerberosWizard();

+ 7 - 9
ambari-web/app/views/main/menu.js

@@ -118,15 +118,13 @@ App.MainSideMenuView = Em.CollectionView.extend({
           });
         }
         if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS') || upg) {
-          if (App.supports.enableToggleKerberos) {
-            categories.push({
-              name: 'kerberos',
-              url: 'kerberos/',
-              label: Em.I18n.t('common.kerberos'),
-              disabled: App.get('upgradeInProgress') || App.get('upgradeHolding'),
-              href: router.urlFor('main.admin.adminKerberos')
-            });
-          }
+          categories.push({
+            name: 'kerberos',
+            url: 'kerberos/',
+            label: Em.I18n.t('common.kerberos'),
+            disabled: App.get('upgradeInProgress') || App.get('upgradeHolding'),
+            href: router.urlFor('main.admin.adminKerberos')
+          });
         }
         if ((App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') && App.isAuthorized('SERVICE.MANAGE_AUTO_START, CLUSTER.MANAGE_AUTO_START')) || upg) {
           if (App.supports.serviceAutoStart) {

+ 1 - 1
ambari-web/app/views/main/service/item.js

@@ -289,7 +289,7 @@ App.MainServiceItemView = Em.View.extend({
       options.push(actionMap.DOWNLOAD_CLIENT_CONFIGS);
     }
 
-    if (App.isAuthorized("SERVICE.ADD_DELETE_SERVICES") && App.supports.enableAddDeleteServices) {
+    if (App.isAuthorized("SERVICE.ADD_DELETE_SERVICES")) {
       options.push(actionMap.DELETE_SERVICE);
     }
 

+ 0 - 1
ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js

@@ -34,7 +34,6 @@ describe('App.MainAdminStackServicesView', function () {
       sinon.stub(App.router, 'get').returns(mock);
       sinon.spy(mock, 'checkAndStartKerberosWizard');
       isAccessibleMock = sinon.stub(App, 'isAuthorized');
-      App.set('supports.enableAddDeleteServices', true);
     });
     afterEach(function() {
       App.get('router').transitionTo.restore();