Revert "AMBARI-21205 Make ToggleKerberos and AddDeleteService experimental features (Duc Le via rzang)"
This reverts commit 57bb1365e414c1f110d2d142fa198fb8e043af95. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7e0fe291 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7e0fe291 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7e0fe291 Branch: refs/heads/branch-feature-AMBARI-20859 Commit: 7e0fe2913619f4b70097e3ebcd7fb89e84eee62d Parents: 5af1e53 Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Mon Oct 9 11:26:04 2017 -0700 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Mon Oct 9 11:26:04 2017 -0700 ---------------------------------------------------------------------- ambari-web/app/config.js | 6 ++-- ambari-web/app/routes/add_service_routes.js | 2 +- ambari-web/app/routes/main.js | 2 +- .../app/templates/main/admin/kerberos.hbs | 34 +++++++++----------- .../main/service/all_services_actions.hbs | 6 ++-- ambari-web/app/views/main/admin.js | 14 ++++---- .../main/admin/stack_upgrade/services_view.js | 2 +- ambari-web/app/views/main/menu.js | 16 ++++----- ambari-web/app/views/main/service/item.js | 2 +- .../admin/stack_upgrade/services_view_test.js | 1 - 10 files changed, 36 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index 0963f70..ba1b75d 100644 --- a/ambari-web/app/config.js +++ b/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) { http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/routes/add_service_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index 75b3586..1615f0d 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/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 () { http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 7ed18de..30cc8aa 100644 --- a/ambari-web/app/routes/main.js +++ b/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'); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/templates/main/admin/kerberos.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/kerberos.hbs b/ambari-web/app/templates/main/admin/kerberos.hbs index 2b41122..e7bb618 100644 --- a/ambari-web/app/templates/main/admin/kerberos.hbs +++ b/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> http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/templates/main/service/all_services_actions.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/all_services_actions.hbs b/ambari-web/app/templates/main/service/all_services_actions.hbs index a9e122b..3e87cb2 100644 --- a/ambari-web/app/templates/main/service/all_services_actions.hbs +++ b/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> http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/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 05d0f56..509f380 100644 --- a/ambari-web/app/views/main/admin.js +++ b/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) { http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/views/main/admin/stack_upgrade/services_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js b/ambari-web/app/views/main/admin/stack_upgrade/services_view.js index 25efffe..f566814 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js +++ b/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(); http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/views/main/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js index 32c4f6f..4bb53ae 100644 --- a/ambari-web/app/views/main/menu.js +++ b/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) { http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/app/views/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index 45c783b..37e0904 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/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); } http://git-wip-us.apache.org/repos/asf/ambari/blob/7e0fe291/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js index da75cf2..70d182c 100644 --- a/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js +++ b/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();