Repository: ambari Updated Branches: refs/heads/trunk c2e0ef76e -> 4acca9415
AMBARI-16911. Enable HS2 Interactive > Select Hosts does not have Cancel and close. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4acca941 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4acca941 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4acca941 Branch: refs/heads/trunk Commit: 4acca94156b2b62c5108132b45f226716efd402b Parents: c2e0ef7 Author: Jaimin Jetly <[email protected]> Authored: Thu May 26 17:06:16 2016 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Thu May 26 17:06:57 2016 -0700 ---------------------------------------------------------------------- .../controllers/main/service/info/summary.js | 2 +- .../wizard/step7/assign_master_controller.js | 35 ++++++++++++++++++-- ambari-web/app/messages.js | 4 +++ .../common/assign_master_components.hbs | 7 +++- .../common/assign_master_components_view.js | 4 +++ .../app/views/main/service/services/hive.js | 3 +- .../views/wizard/step7/assign_master_view.js | 6 ++-- 7 files changed, 53 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/controllers/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js index eb0e850..a410373 100644 --- a/ambari-web/app/controllers/main/service/info/summary.js +++ b/ambari-web/app/controllers/main/service/info/summary.js @@ -271,7 +271,7 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix var hiveEndPoint = { isVisible: hiveSiteDynamicDiscovery, componentName: masterComponent.get('componentName'), - label: masterComponent.get('displayName') + ' Endpoint', + label: masterComponent.get('displayName') + Em.I18n.t('services.service.summary.hiveserver2.jdbc.url.text'), value: Em.I18n.t('services.service.summary.hiveserver2.endpoint.value').format(hiveSiteZkQuorom, hiveSiteZkNameSpace), tooltipText: Em.I18n.t('services.service.summary.hiveserver2.endpoint.tooltip.text').format(masterComponent.get('displayName')) }; http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/controllers/wizard/step7/assign_master_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js index 7a610da..31af2cc 100644 --- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js +++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js @@ -98,16 +98,38 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App if (!this.get('content.controllerName')) { this.loadMasterComponentHosts(); } + var mastersToCreate = this.get('mastersToCreate'); + var masterToCreateDisplayName = App.format.role(mastersToCreate[0]); + var configWidgetContext = this.get('configWidgetContext'); + var config = this.get('configWidgetContext.config'); var popup = App.ModalPopup.show({ classNames: ['full-width-modal', 'add-service-wizard-modal'], - header: Em.I18n.t('admin.highAvailability.wizard.step2.header'), + header: Em.I18n.t('assign.master.popup.header').format(masterToCreateDisplayName), bodyClass: App.AssignMasterOnStep7View.extend({ controller: self }), primary: Em.I18n.t('form.cancel'), showFooter: false, - secondary: null, - showCloseButton: false, + onClose: function () { + this.showWarningPopup(); + }, + showWarningPopup: function() { + var mainPopupContext = this; + var warningPopup = App.ModalPopup.show({ + encodeBody: false, + header: Em.I18n.t('common.warning'), + primaryClass: 'btn-warning', + body: Em.I18n.t('assign.master.popup.cancel.body').format(masterToCreateDisplayName), + onPrimary: function () { + configWidgetContext.toggleProperty('controller.forceUpdateBoundaries'); + var value = config.get('initialValue'); + config.set('value', value); + configWidgetContext.setValue(value); + this.hide(); + mainPopupContext.hide(); + } + }); + }, didInsertElement: function () { this._super(); this.fitHeight(); @@ -369,5 +391,12 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App config.set('recommendedValue', componentHostName); configActionComponent.hostName = componentHostName; this.get('configWidgetContext.config').set('configActionComponent', configActionComponent); + }, + + /** + * function called for onclcik event on cancel button for the popup + */ + onCancel: function() { + this.get('popup').showWarningPopup(); } }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 8763721..29ca44c 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -244,6 +244,7 @@ Em.I18n.translations = { 'common.actions': 'Actions', 'common.maintenance': 'Maintenance', 'common.passive_state': 'Maintenance Mode', + 'common.select': 'Select', 'common.selected': 'Selected', 'common.password': 'Password', 'common.url': 'URL', @@ -906,6 +907,8 @@ Em.I18n.translations = { 'installer.step7.assign.master.dependent.component.body':'If not present {0} will also be installed on the selected host. ', 'installer.step7.missing.service.header':'Missing Service', 'installer.step7.missing.service.body': '{0} service should be added to the cluster to {1}.', + 'assign.master.popup.header':'Select {0} host', + 'assign.master.popup.cancel.body':'Not selecting {0} host will disable interactive query.', 'installer.step8.header': 'Review', @@ -1759,6 +1762,7 @@ Em.I18n.translations = { 'services.service.summary.moreStats':'more stats here', 'services.service.summary.clientCount': '{0} Client Hosts', 'services.service.summary.historyServer': 'History Server Web UI', + 'services.service.summary.hiveserver2.jdbc.url.text': ' JDBC URL', 'services.service.summary.hiveserver2.endpoint.tooltip.text':'JDBC connection string for {0}', 'services.service.summary.hiveserver2.endpoint.value':'jdbc:hive2://{0}/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace={1}', 'services.service.actions.downloadClientConfigs':'Download Client Configs', http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/templates/common/assign_master_components.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/assign_master_components.hbs b/ambari-web/app/templates/common/assign_master_components.hbs index 893d1e6..84cbb0b 100644 --- a/ambari-web/app/templates/common/assign_master_components.hbs +++ b/ambari-web/app/templates/common/assign_master_components.hbs @@ -16,7 +16,9 @@ * limitations under the License. }} <div id="assign-masters"> - <h2>{{view.title}}</h2> +{{#if view.isLoaded}} + <h2>{{view.showTitle}}</h2> +{{/if}} <div class="alert alert-info"> {{{view.alertMessage}}} </div> @@ -147,5 +149,8 @@ {{/if}} {{view.acceptButtonText}} </a> + {{#if view.isCancelButtonVisible}} + <a class="btn pull-right mrm" {{action onCancel target="controller"}}>{{t common.cancel}}</a> + {{/if}} </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/views/common/assign_master_components_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/assign_master_components_view.js b/ambari-web/app/views/common/assign_master_components_view.js index 95ba766..37054c3 100644 --- a/ambari-web/app/views/common/assign_master_components_view.js +++ b/ambari-web/app/views/common/assign_master_components_view.js @@ -28,6 +28,8 @@ App.AssignMasterComponentsView = Em.View.extend({ */ title: '', + showTitle: true, + /** * Alert message to be shown on the page * @type {String} @@ -43,6 +45,8 @@ App.AssignMasterComponentsView = Em.View.extend({ isBackButtonVisible: true, + isCancelButtonVisible: false, + acceptButtonText: Em.I18n.t('common.next') + '→', didInsertElement: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/views/main/service/services/hive.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/hive.js b/ambari-web/app/views/main/service/services/hive.js index d306433..2530e42 100644 --- a/ambari-web/app/views/main/service/services/hive.js +++ b/ambari-web/app/views/main/service/services/hive.js @@ -21,6 +21,7 @@ var App = require('app'); App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({ templateName: require('templates/main/service/services/hive'), serviceName: 'HIVE', + isFullWidth: true, didInsertElement: function () { var controller = this.get('controller'); @@ -52,7 +53,7 @@ App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({ setEllipsis: function() { var $ = this.$(); var text = $.text(); - var MAX_LENGTH = 32; + var MAX_LENGTH = 96; var ellipsis = '...'; var length = MAX_LENGTH > text.length ? text.length : MAX_LENGTH; var start = Math.max(length - ellipsis.length, ellipsis.length); http://git-wip-us.apache.org/repos/asf/ambari/blob/4acca941/ambari-web/app/views/wizard/step7/assign_master_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step7/assign_master_view.js b/ambari-web/app/views/wizard/step7/assign_master_view.js index d6a456f..05f48fc 100644 --- a/ambari-web/app/views/wizard/step7/assign_master_view.js +++ b/ambari-web/app/views/wizard/step7/assign_master_view.js @@ -24,14 +24,16 @@ require('views/wizard/step5_view'); App.AssignMasterOnStep7View = App.AssignMasterComponentsView.extend({ - title: Em.I18n.t('installer.step5.header'), + showTitle: false, - acceptButtonText: Em.I18n.t('common.save'), + acceptButtonText: Em.I18n.t('common.select'), alertMessage: '', isBackButtonVisible: false, + isCancelButtonVisible: true, + willInsertElement: function() { this._super(); this.setAlertMessage();
