Repository: ambari Updated Branches: refs/heads/trunk 6ba07c192 -> 33ed5921d
http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/common/configs/services_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js index 24086f7..3e56c40 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -40,11 +40,10 @@ App.ServiceConfigView = Em.View.extend({ supportsHostOverrides: function () { switch (this.get('controller.name')) { case 'wizardStep7Controller': - return App.supports.hostOverridesInstaller && (this.get('controller.selectedService.serviceName') !== 'MISC'); + return this.get('controller.selectedService.serviceName') !== 'MISC'; case 'mainServiceInfoConfigsController': - return App.supports.hostOverrides; case 'mainHostServiceConfigsController': - return App.supports.hostOverridesHost; + return true; default: return false; } @@ -845,709 +844,4 @@ App.ServiceConfigTab = Ember.View.extend({ var serviceName = this.get('controller.selectedService.serviceName'); this.$('a[href="#' + serviceName + '"]').tab('show'); } -}); - -/** - * custom view for capacity scheduler category - * @type {*} - */ -App.ServiceConfigCapacityScheduler = App.ServiceConfigsByCategoryView.extend({ - templateName: require('templates/common/configs/capacity_scheduler'), - category: null, - service: null, - serviceConfigs: null, - customConfigs: function(){ - return App.config.get('preDefinedCustomConfigs'); - }.property('App.config.preDefinedCustomConfigs'), - /** - * configs filtered by capacity-scheduler category - */ - categoryConfigs: function () { - return this.get('serviceConfigs').filterProperty('category', this.get('category.name')); - }.property('queueObserver', 'serviceConfigs.@each'), - /** - * rewrote method to avoid incompatibility with parent - */ - filteredCategoryConfigs: function () { - return this.get('categoryConfigs'); - }.property(), - advancedConfigs: function () { - return this.get('categoryConfigs').filterProperty('isQueue', undefined) || []; - }.property('categoryConfigs.@each'), - didInsertElement: function () { - this._super(); - this.createEmptyQueue(this.get('customConfigs').filterProperty('isQueue')); - }, - //list of fields which will be populated by default in a new queue - fieldsToPopulate: function(){ - if(App.get('isHadoop2Stack')){ - return ["yarn.scheduler.capacity.root.<queue-name>.user-limit-factor", - "yarn.scheduler.capacity.root.<queue-name>.state"]; - } - return [ - "mapred.capacity-scheduler.queue.<queue-name>.minimum-user-limit-percent", - "mapred.capacity-scheduler.queue.<queue-name>.user-limit-factor", - "mapred.capacity-scheduler.queue.<queue-name>.supports-priority", - "mapred.capacity-scheduler.queue.<queue-name>.maximum-initialized-active-tasks", - "mapred.capacity-scheduler.queue.<queue-name>.maximum-initialized-active-tasks-per-user", - "mapred.capacity-scheduler.queue.<queue-name>.init-accept-jobs-factor" - ]; - }.property('App.isHadoop2Stack'), - /** - * create empty queue - * take some queue then copy it and set all config values to null - * @param customConfigs - */ - createEmptyQueue: function (customConfigs) { - var emptyQueue = { - name: '<queue-name>', - configs: [] - }; - var fieldsToPopulate = this.get('fieldsToPopulate'); - customConfigs.forEach(function (config) { - var newConfig = $.extend({}, config); - if (fieldsToPopulate.contains(config.name)) { - newConfig.value = config.defaultValue; - } - newConfig = App.ServiceConfigProperty.create(newConfig); - newConfig.validate(); - emptyQueue.configs.push(newConfig); - }); - this.set('emptyQueue', emptyQueue); - }, - deriveQueueNames: function(configs){ - var queueNames = []; - configs.mapProperty('name').forEach(function(name){ - var queueName; - if(App.get('isHadoop2Stack')){ - queueName = /^yarn\.scheduler\.capacity\.root\.(.*?)\./.exec(name); - } else { - queueName = /^mapred\.capacity-scheduler\.queue\.(.*?)\./.exec(name); - } - if(queueName){ - queueNames.push(queueName[1]); - } - }); - return queueNames.uniq(); - }, - queues: function(){ - var configs = this.get('categoryConfigs').filterProperty('isQueue', true); - var queueNames = this.deriveQueueNames(configs); - var queues = []; - - queueNames.forEach(function(queueName){ - queues.push({ - name: queueName, - color: this.generateColor(queueName), - configs: this.groupConfigsByQueue(queueName, configs) - }) - }, this); - return queues; - }.property('queueObserver'), - /** - * group configs by queue - * @param queueName - * @param configs - */ - groupConfigsByQueue: function (queueName, configs) { - var customConfigs = []; - var queue = []; - this.get('customConfigs').forEach(function(_config){ - var copy = $.extend({}, _config); - copy.name = _config.name.replace('<queue-name>', queueName); - customConfigs.push(copy); - }); - configs.forEach(function (config) { - var customConfig = customConfigs.findProperty('name', config.get('name')); - if (customConfig) { - config.set('description', customConfig.description); - config.set('displayName', customConfig.displayName); - config.set('isRequired', customConfig.isRequired); - config.set('unit', customConfig.unit); - config.set('displayType', customConfig.displayType); - config.set('valueRange', customConfig.valueRange); - config.set('isVisible', customConfig.isVisible); - config.set('inTable', customConfig.inTable); - config.set('index', customConfig.index); - queue.push(config); - } - }); - if(queue.length < customConfigs.length){ - this.addMissingProperties(queue, customConfigs); - } - return queue; - }, - /** - * add missing properties to queue when they don't come from server - * @param queue - * @param customConfigs - */ - addMissingProperties: function(queue, customConfigs){ - customConfigs.forEach(function(_config){ - var serviceConfigProperty; - if(!queue.someProperty('name', _config.name)){ - _config.value = _config.defaultValue; - serviceConfigProperty = App.ServiceConfigProperty.create(_config); - serviceConfigProperty.validate(); - queue.push(serviceConfigProperty); - } - }, this); - }, - /** - * convert queues to table content - */ - tableContent: function () { - var result = []; - this.get('queues').forEach(function (queue) { - var usersAndGroups = queue.configs.findProperty('name', this.getUserAndGroupNames(queue.name)[0]).get('value'); - usersAndGroups = (usersAndGroups) ? usersAndGroups.split(' ') : ['']; - if (usersAndGroups.length == 1) { - usersAndGroups.push(''); - } - var queueObject = { - name: queue.name, - color: 'background-color:' + queue.color + ';', - configs: this.sortByIndex(queue.configs.filterProperty('inTable')) - }; - //push acl_submit_jobs users - queueObject.configs.unshift({ - value: usersAndGroups[1], - inTable: true, - displayName: Em.I18n.t('common.users') - }); - //push acl_submit_jobs groups - queueObject.configs.unshift({ - value: usersAndGroups[0], - inTable: true, - displayName: Em.I18n.t('services.mapReduce.config.queue.groups') - }); - result.push(queueObject); - }, this); - return result; - }.property('queues'), - /** - * create headers depending on existed properties in queue - */ - tableHeaders: function(){ - var headers = [ - Em.I18n.t('services.mapReduce.config.queue.name') - ]; - return (this.get('tableContent').length) ? - headers.concat(this.get('tableContent').objectAt(0).configs.filterProperty('inTable').mapProperty('displayName')): - headers; - }.property('tableContent'), - queueObserver: null, - /** - * uses as template for adding new queue - */ - emptyQueue: {}, - /** - * get capacities sum of queues except of current - * @param queueName - * @return {Number} - */ - getQueuesCapacitySum: function(queueName){ - var capacitySum = 0; - this.get('queues').filter(function(queue){ - return queue.name !== queueName; - }).forEach(function(queue){ - capacitySum = capacitySum + window.parseInt(queue.configs.find(function(config){ - return config.get('name').substr(-9, 9) === '.capacity'; - }).get('value')); - }); - return capacitySum; - }, - /** - * get names of configs, for users and groups, which have different names in HDP1 and HDP2 - * @param queueName - * @return {Array} - */ - getUserAndGroupNames: function(queueName){ - queueName = queueName || '<queue-name>'; - if(App.get('isHadoop2Stack') && this.get('controller.selectedService')) { - if (this.get('controller.selectedService.serviceName') == "YARN") { - return ['yarn.scheduler.capacity.root.' + queueName + '.acl_submit_jobs', - 'yarn.scheduler.capacity.root.' + queueName + '.acl_administer_jobs'] - } - return ['mapred.queue.' + queueName + '.acl-submit-job', - 'mapred.queue.' + queueName + '.acl-administer-jobs'] - } - }, - generateColor: function (str) { - var hash = 0; - for (var i = 0; i < str.length; i++) { - hash = str.charCodeAt(i) + ((hash << 5) - hash); - } - return '#' + Number(Math.abs(hash)).toString(16).concat('00000').substr(0, 6); - }, - /** - * add new queue - * add created configs to serviceConfigs with current queue name - * @param queue - */ - addQueue: function (queue) { - var serviceConfigs = this.get('serviceConfigs'); - var admin = []; - var submit = []; - var submitConfig; - var adminConfig; - queue.name = queue.configs.findProperty('name', 'queueName').get('value'); - queue.configs.forEach(function (config) { - var adminName = this.getUserAndGroupNames()[1]; - var submitName = this.getUserAndGroupNames()[0]; - if(config.name == adminName){ - if (config.type == 'USERS') { - admin[0] = config.value; - } - if (config.type == 'GROUPS') { - admin[1] = config.value; - } - if (config.isQueue) { - adminConfig = config; - } - } - if(config.name == submitName){ - if (config.type == 'USERS') { - submit[0] = config.value; - } - if (config.type == 'GROUPS') { - submit[1] = config.value; - } - if (config.isQueue) { - submitConfig = config; - } - } - config.set('name', config.get('name').replace('<queue-name>', queue.name)); - config.set('value', config.get('value').toString()); - if (config.isQueue) { - serviceConfigs.push(config); - } - }, this); - adminConfig.set('value', admin.join(' ')); - submitConfig.set('value', submit.join(' ')); - this.set('queueObserver', App.dateTime()); - }, - /** - * delete queue - * delete configs from serviceConfigs which have current queue name - * @param queue - */ - deleteQueue: function (queue) { - var serviceConfigs = this.get('serviceConfigs'); - var configNames = queue.configs.filterProperty('isQueue').mapProperty('name'); - for (var i = 0, l = serviceConfigs.length; i < l; i++) { - if (configNames.contains(serviceConfigs[i].name)) { - serviceConfigs.splice(i, 1); - l--; - i--; - } - } - this.set('queueObserver', App.dateTime()); - }, - /** - * save changes that was made to queue - * edit configs from serviceConfigs which have current queue name - * @param queue - */ - editQueue: function (queue) { - var serviceConfigs = this.get('serviceConfigs'); - var configNames = queue.configs.filterProperty('isQueue').mapProperty('name'); - serviceConfigs.forEach(function (_config) { - var configName = _config.get('name'); - var admin = []; - var submit = []; - //comparison executes including 'queue.<queue-name>' to avoid false matches - var queueNamePrefix = App.get('isHadoop2Stack') ? 'root.' : 'queue.'; - if (configNames.contains(_config.get('name'))) { - if(configName == this.getUserAndGroupNames(queue.name)[0]){ - submit = queue.configs.filterProperty('name', configName); - submit = submit.findProperty('type', 'USERS').get('value') + ' ' + submit.findProperty('type', 'GROUPS').get('value'); - _config.set('value', submit); - } else if(configName == this.getUserAndGroupNames(queue.name)[1]){ - admin = queue.configs.filterProperty('name', configName); - admin = admin.findProperty('type', 'USERS').get('value') + ' ' + admin.findProperty('type', 'GROUPS').get('value'); - _config.set('value', admin); - } else { - _config.set('value', queue.configs.findProperty('name', _config.get('name')).get('value').toString()); - } - _config.set('name', configName.replace(queueNamePrefix + queue.name, queueNamePrefix + queue.configs.findProperty('name', 'queueName').get('value'))); - } - }, this); - this.set('queueObserver', App.dateTime()); - }, - pieChart: App.ChartPieView.extend({ - w: 200, - h: 200, - queues: null, - didInsertElement: function () { - this.update(); - }, - data: [{"label":"default", "value":100}], - update: function () { - var self = this; - var data = []; - var queues = this.get('queues'); - var capacitiesSum = 0; - queues.forEach(function (queue) { - var value = window.parseInt(queue.configs.find(function(_config){ - return _config.get('name').substr(-9, 9) === '.capacity'; - }).get('value')); - data.push({ - label: queue.name, - value: value, - color: queue.color - }) - }); - - data.mapProperty('value').forEach(function (capacity) { - capacitiesSum += capacity; - }); - if (capacitiesSum < 100) { - data.push({ - label: Em.I18n.t('common.empty'), - value: (100 - capacitiesSum), - color: 'transparent', - isEmpty: true - }) - } - $(d3.select(this.get('selector'))[0]).children().remove(); - this.set('data', data); - this.set('palette', new Rickshaw.Color.Palette({ - scheme: data.mapProperty('color') - })); - this.appendSvg(); - - this.get('arcs') - .on("click",function (d, i) { - var event = {context: d.data.label}; - if (d.data.isEmpty !== true) self.get('parentView').queuePopup(event); - }).on('mouseover', function (d, i) { - var position = d3.svg.mouse(this); - var label = $('#section_label'); - label.css('left', position[0] + 100); - label.css('top', position[1] + 100); - label.text(d.data.label); - label.show(); - }) - .on('mouseout', function (d, i) { - $('#section_label').hide(); - }) - - }.observes('queues'), - donut: d3.layout.pie().sort(null).value(function (d) { - return d.value; - }) - }), - /** - * open popup with chosen queue - * @param event - */ - queuePopup: function (event) { - //if queueName was handed that means "Edit" mode, otherwise "Add" mode - var queueName = event.context || null; - var self = this; - App.ModalPopup.show({ - didInsertElement: function () { - if (queueName) { - this.set('header', Em.I18n.t('services.mapReduce.config.editQueue')); - this.set('secondary', Em.I18n.t('common.save')); - if (self.get('queues').length > 1 && self.get('canEdit')) { - this.set('delete', Em.I18n.t('common.delete')); - } - } - }, - header: Em.I18n.t('services.mapReduce.config.addQueue'), - secondary: Em.I18n.t('common.add'), - primary: Em.I18n.t('common.cancel'), - delete: null, - isError: function () { - if (!self.get('canEdit')) { - return true; - } - var content = this.get('content'); - var configs = content.configs.filter(function (config) { - return !(config.name == self.getUserAndGroupNames(content.name)[0] || - config.name == self.getUserAndGroupNames(content.name)[1] && - config.isQueue); - }); - return configs.someProperty('isValid', false); - }.property('content.configs.@each.isValid'), - onDelete: function () { - var view = this; - App.ModalPopup.show({ - header: Em.I18n.t('popup.confirmation.commonHeader'), - body: Em.I18n.t('hosts.delete.popup.body'), - primary: Em.I18n.t('yes'), - onPrimary: function () { - self.deleteQueue(view.get('content')); - view.hide(); - this.hide(); - } - }); - }, - onSecondary: function () { - if (queueName) { - self.editQueue(this.get('content')); - } else { - self.addQueue(this.get('content')); - } - this.hide(); - }, - /** - * Queue properties order: - * 1. Queue Name - * 2. Capacity - * 3. Max Capacity - * 4. Users - * 5. Groups - * 6. Admin Users - * 7. Admin Groups - * 8. Support Priority - * ... - */ - content: function () { - var content = (queueName) ? self.get('queues').findProperty('name', queueName) : self.get('emptyQueue'); - var configs = []; - // copy of queue configs - content.configs.forEach(function (config, index) { - if(config.get('name').substr(-9, 9) === '.capacity') { - //added validation function for capacity property - config.reopen({ - validate: function () { - var value = this.get('value'); - var isError = false; - var capacitySum = self.getQueuesCapacitySum(content.name); - if (value == '') { - if (this.get('isRequired')) { - this.set('errorMessage', 'This is required'); - isError = true; - } else { - return; - } - } - if (!isError) { - if (!validator.isValidInt(value)) { - this.set('errorMessage', 'Must contain digits only'); - isError = true; - } - } - if (!isError) { - if ((capacitySum + parseInt(value)) > 100) { - isError = true; - this.set('errorMessage', 'The sum of capacities more than 100'); - } - if (!isError) { - this.set('errorMessage', ''); - } - } - }.observes('value') - }); - } - if (config.name == 'mapred.capacity-scheduler.queue.' + content.name + '.supports-priority') { - if (config.get('value') == 'true' || config.get('value') === true) { - config.set('value', true); - } else { - config.set('value', false); - } - } - if(config.name === 'yarn.scheduler.capacity.root.' + content.name + '.state'){ - config.reopen({ - validate: function(){ - var value = this.get('value'); - this._super(); - if(!this.get('errorMessage')){ - if(!(value === 'STOPPED' || value === 'RUNNING')){ - this.set('errorMessage', 'State value should be RUNNING or STOPPED'); - } - } - }.observes('value') - }) - } - configs[index] = App.ServiceConfigProperty.create(config); - }); - content = { - name: content.name, - configs: configs - }; - content = this.insertExtraConfigs(content); - content.configs = self.sortByIndex(content.configs); - return content; - }.property(), - footerClass: Ember.View.extend({ - classNames: ['modal-footer', 'host-checks-update'], - templateName: require('templates/common/configs/queuePopup_footer') - }), - bodyClass: Ember.View.extend({ - templateName: require('templates/common/configs/queuePopup_body') - }), - /** - * Insert extra config in popup according to queue - * - * the mapred.queue.default.acl-administer-jobs turns into two implicit configs: - * "Admin Users" field and "Admin Groups" field - * the mapred.queue.default.acl-submit-job turns into two implicit configs: - * "Users" field and "Groups" field - * Add implicit config that contain "Queue Name" - * @param content - * @return {*} - */ - insertExtraConfigs: function (content) { - var that = this; - var admin = content.configs.findProperty('name', self.getUserAndGroupNames(content.name)[1]).get('value'); - var submit = content.configs.findProperty('name', self.getUserAndGroupNames(content.name)[0]).get('value'); - admin = (admin) ? admin.split(' ') : ['']; - submit = (submit) ? submit.split(' ') : ['']; - if (admin.length < 2) { - admin.push(''); - } - if (submit.length < 2) { - submit.push(''); - } - var nameField = App.ServiceConfigProperty.create({ - name: 'queueName', - displayName: Em.I18n.t('services.mapReduce.extraConfig.queue.name'), - description: Em.I18n.t('services.mapReduce.description.queue.name'), - value: (content.name == '<queue-name>') ? '' : content.name, - validate: function () { - var queueNames = self.get('queues').mapProperty('name'); - var value = this.get('value'); - var isError = false; - var regExp = /^[a-z]([\_\-a-z0-9]{0,50})\$?$/i; - if (value == '') { - if (this.get('isRequired')) { - this.set('errorMessage', 'This is required'); - isError = true; - } else { - return; - } - } - if (!isError) { - if ((queueNames.indexOf(value) !== -1) && (value != content.name)) { - this.set('errorMessage', 'Queue name is already used'); - isError = true; - } - } - if (!isError) { - if (!regExp.test(value)) { - this.set('errorMessage', 'Incorrect input'); - isError = true; - } - } - if (!isError) { - this.set('errorMessage', ''); - } - }.observes('value'), - isRequired: true, - isVisible: true, - isEditable: self.get('canEdit'), - index: 0 - }); - nameField.validate(); - content.configs.unshift(nameField); - - var submitUser = App.ServiceConfigProperty.create({ - name: self.getUserAndGroupNames(content.name)[0], - displayName: Em.I18n.t('common.users'), - value: submit[0], - description: Em.I18n.t('services.mapReduce.description.queue.submit.user'), - isRequired: true, - isVisible: true, - type: 'USERS', - displayType: "UNIXList", - isEditable: self.get('canEdit'), - index: 3 - }); - - var submitGroup = App.ServiceConfigProperty.create({ - name: self.getUserAndGroupNames(content.name)[0], - displayName: Em.I18n.t('services.mapReduce.config.queue.groups'), - description: Em.I18n.t('services.mapReduce.description.queue.submit.group'), - value: submit[1], - isRequired: true, - isVisible: true, - "displayType": "UNIXList", - type: 'GROUPS', - isEditable: self.get('canEdit'), - index: 4 - }); - - var adminUser = App.ServiceConfigProperty.create({ - name: self.getUserAndGroupNames(content.name)[1], - displayName: Em.I18n.t('services.mapReduce.config.queue.adminUsers'), - description: Em.I18n.t('services.mapReduce.description.queue.admin.user'), - value: admin[0], - isRequired: true, - isVisible: true, - type: 'USERS', - displayType: "UNIXList", - isEditable: self.get('canEdit'), - index: 5 - }); - - var adminGroup = App.ServiceConfigProperty.create({ - name: self.getUserAndGroupNames(content.name)[1], - displayName: Em.I18n.t('services.mapReduce.config.queue.adminGroups'), - value: admin[1], - description: Em.I18n.t('services.mapReduce.description.queue.admin.group'), - isRequired: true, - isVisible: true, - "displayType": "UNIXList", - type: 'GROUPS', - isEditable: self.get('canEdit'), - index: 6 - }); - - submitUser.reopen({ - validate: function () { - that.userGroupValidation(this, submitGroup); - }.observes('value') - }); - submitGroup.reopen({ - validate: function () { - that.userGroupValidation(this, submitUser); - }.observes('value') - }); - adminUser.reopen({ - validate: function () { - that.userGroupValidation(this, adminGroup); - }.observes('value') - }); - adminGroup.reopen({ - validate: function () { - that.userGroupValidation(this, adminUser); - }.observes('value') - }); - - submitUser.validate(); - adminUser.validate(); - content.configs.push(submitUser); - content.configs.push(submitGroup); - content.configs.push(adminUser); - content.configs.push(adminGroup); - - return content; - }, - /** - * Validate by follow rules: - * Users can be blank. If it is blank, Groups must not be blank. - * Groups can be blank. If it is blank, Users must not be blank. - * @param context - * @param boundConfig - */ - userGroupValidation: function (context, boundConfig) { - if (context.get('value') == '') { - if (boundConfig.get('value') == '') { - context._super(); - } else { - boundConfig.validate(); - } - } else { - if (boundConfig.get('value') == '') { - boundConfig.set('errorMessage', ''); - } - context._super(); - } - } - }) - } -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/common/quick_view_link_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index ce859e6..1bb5cb0 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -221,17 +221,15 @@ App.QuickViewLinks = Em.View.extend({ return item.host_components.someProperty('HostRoles.component_name', 'HBASE_MASTER'); }); var activeMaster, standbyMasters, otherMasters; - if (App.supports.multipleHBaseMasters) { - activeMaster = masterComponents.filter(function (item) { - return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'true'); - }); - standbyMasters = masterComponents.filter(function (item) { - return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'false'); - }); - otherMasters = masterComponents.filter(function (item) { - return !(item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'true') || item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'false')); - }); - } + activeMaster = masterComponents.filter(function (item) { + return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'true'); + }); + standbyMasters = masterComponents.filter(function (item) { + return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'false'); + }); + otherMasters = masterComponents.filter(function (item) { + return !(item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'true') || item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'false')); + }); if (masterComponents.length > 1) { // need all hbase_masters hosts in quick links if (activeMaster) { @@ -389,7 +387,6 @@ App.QuickViewLinks = Em.View.extend({ case "oozie": case "ganglia": case "nagios": - case "hue": case "storm": case "falcon": return "_blank"; http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/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 89c0d6d..829da20 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -33,13 +33,11 @@ App.MainAdminView = Em.View.extend({ url: 'adminServiceAccounts', label: Em.I18n.t('common.serviceAccounts') }); - if (App.supports.secureCluster) { - items.push({ - name: 'security', - url: 'adminSecurity.index', - label: Em.I18n.t('common.security') - }); - } + items.push({ + name: 'security', + url: 'adminSecurity.index', + label: Em.I18n.t('common.security') + }); return items; }.property(''), http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/dashboard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard.js b/ambari-web/app/views/main/dashboard.js index 9705203..265f2e4 100644 --- a/ambari-web/app/views/main/dashboard.js +++ b/ambari-web/app/views/main/dashboard.js @@ -24,28 +24,24 @@ App.MainDashboardView = Em.View.extend({ templateName: require('templates/main/dashboard'), selectedBinding: 'controller.selectedCategory', - categories: function () { - var categories = [ - { - name: 'widgets', - url: 'dashboard.index', - label: Em.I18n.t('dashboard.widgets.title') - }, - { - name: 'charts', - url: 'dashboard.charts.index', - label: Em.I18n.t('dashboard.heatmaps.title') - } - ]; - if (App.get('supports.configHistory')) { - categories.push({ - name: 'configHistory', - url: 'dashboard.configHistory', - label: Em.I18n.t('dashboard.configHistory.title') - }) + categories: [ + { + name: 'widgets', + url: 'dashboard.index', + label: Em.I18n.t('dashboard.widgets.title') + }, + { + name: 'charts', + url: 'dashboard.charts.index', + label: Em.I18n.t('dashboard.heatmaps.title') + }, + { + name: 'configHistory', + url: 'dashboard.configHistory', + label: Em.I18n.t('dashboard.configHistory.title') } - return categories; - }.property('App.supports.configHistory'), + ], + NavItemView: Ember.View.extend({ tagName: 'li', classNameBindings: 'isActive:active'.w(), http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/dashboard/widgets/hbase_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js index ba93812..bde4246 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js @@ -40,28 +40,17 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ * Passive master components */ passiveMasters: function () { - if (App.supports.multipleHBaseMasters) { - return this.get('masters').filterProperty('haStatus', 'false'); - } - return []; + return this.get('masters').filterProperty('haStatus', 'false'); }.property('masters'), /** * One(!) active master component */ activeMaster: function () { - if(App.supports.multipleHBaseMasters) { - return this.get('masters').findProperty('haStatus', 'true'); - } else { - return this.get('masters')[0]; - } + return this.get('masters').findProperty('haStatus', 'true'); }.property('masters'), activeMasterTitle: function(){ - if (App.supports.multipleHBaseMasters) { - return this.t('service.hbase.activeMaster'); - } else { - return this.get('activeMaster.host.publicHostName'); - } + return this.t('service.hbase.activeMaster'); }.property('activeMaster'), hbaseMasterWebUrl: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/host/details/host_component_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_view.js b/ambari-web/app/views/main/host/details/host_component_view.js index 790e4ba..9f4929d 100644 --- a/ambari-web/app/views/main/host/details/host_component_view.js +++ b/ambari-web/app/views/main/host/details/host_component_view.js @@ -205,7 +205,7 @@ App.HostComponentView = Em.View.extend({ * @type {bool} */ isReassignable: function () { - return App.supports.reassignMaster && App.get('components.reassignable').contains(this.get('content.componentName')) && App.router.get('mainHostController.hostsCountMap')['TOTAL'] > 1; + return App.get('components.reassignable').contains(this.get('content.componentName')) && App.router.get('mainHostController.hostsCountMap')['TOTAL'] > 1; }.property('content.componentName'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/host/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/menu.js b/ambari-web/app/views/main/host/menu.js index 5490eb1..0cd19b3 100644 --- a/ambari-web/app/views/main/host/menu.js +++ b/ambari-web/app/views/main/host/menu.js @@ -22,18 +22,17 @@ App.MainHostMenuView = Em.CollectionView.extend({ tagName: 'ul', classNames: ["nav", "nav-tabs"], content: function () { - var array = [ { - label: 'Summary', - routing: 'summary' - } - /* { label:'Audit', routing:'audit'} */ + var array = [ + { + label: 'Summary', + routing: 'summary' + } + /* { label:'Audit', routing:'audit'} */ ]; - if (App.supports.hostOverridesHost) { - array.push({ - label: 'Configs', - routing: 'configs' - }); - } + array.push({ + label: 'Configs', + routing: 'configs' + }); return array; }.property(''), http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/host/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js index 3ccf01c..fe431d8 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -245,9 +245,6 @@ App.MainHostSummaryView = Em.View.extend({ * @type {String[]} */ installableClientComponents: function() { - if (!App.supports.deleteHost) { - return []; - } var clientComponents = App.StackServiceComponent.find().filterProperty('isClient'); var installedServices = this.get('installedServices'); var installedClients = this.get('clients').mapProperty('componentName'); http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/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 89e9ac8..6c68f53 100644 --- a/ambari-web/app/views/main/menu.js +++ b/ambari-web/app/views/main/menu.js @@ -138,13 +138,11 @@ App.MainMenuView = Em.CollectionView.extend({ url: 'serviceAccounts', label: Em.I18n.t('common.serviceAccounts') }); - if (App.supports.secureCluster) { - categories.push({ - name: 'security', - url: 'security/', - label: Em.I18n.t('common.security') - }); - } + categories.push({ + name: 'security', + url: 'security/', + label: Em.I18n.t('common.security') + }); } return categories; }.property('') http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/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 e52b2d8..ef6fb21 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -95,7 +95,7 @@ App.MainServiceItemView = Em.View.extend({ action: 'enableRMHighAvailability', label: Em.I18n.t('admin.rm_highAvailability.button.enable'), cssClass: 'icon-arrow-up', - isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled') + isHidden: App.get('isRMHaEnabled') }, MOVE_COMPONENT: { action: 'reassignMaster', @@ -130,7 +130,7 @@ App.MainServiceItemView = Em.View.extend({ action: this.get('controller.isSeveralClients') ? '' : 'downloadClientConfigs', label: Em.I18n.t('services.service.actions.downloadClientConfigs'), cssClass: 'icon-download-alt', - isHidden: !(App.get('supports.downloadClientConfigs') && this.get('controller.content.hostComponents').findProperty('isClient')), + isHidden: !this.get('controller.content.hostComponents').findProperty('isClient'), disabled: false, hasSubmenu: this.get('controller.isSeveralClients'), submenuOptions: this.get('controller.clientComponents') http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/main/service/services/hbase.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/hbase.js b/ambari-web/app/views/main/service/services/hbase.js index e70310c..e27197f 100644 --- a/ambari-web/app/views/main/service/services/hbase.js +++ b/ambari-web/app/views/main/service/services/hbase.js @@ -32,10 +32,7 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ * Passive master components */ passiveMasters: function () { - if(App.supports.multipleHBaseMasters){ - return this.get('masters').filterProperty('haStatus', 'false'); - } - return []; + return this.get('masters').filterProperty('haStatus', 'false'); }.property('masters'), @@ -54,19 +51,11 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ * One(!) active master component */ activeMaster: function () { - if(App.supports.multipleHBaseMasters){ - return this.get('masters').findProperty('haStatus', 'true'); - } else { - return this.get('masters')[0]; - } + return this.get('masters').findProperty('haStatus', 'true'); }.property('masters'), activeMasterTitle: function(){ - if(App.supports.multipleHBaseMasters){ - return this.t('service.hbase.activeMaster'); - } else { - return this.get('activeMaster.host.publicHostName'); - } + return this.t('service.hbase.activeMaster'); }.property('activeMaster'), masterServerHeapSummary: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/app/views/wizard/controls_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js index ae9f721..e607c69 100644 --- a/ambari-web/app/views/wizard/controls_view.js +++ b/ambari-web/app/views/wizard/controls_view.js @@ -365,7 +365,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend({ * * @method handleDBConnectionProperty **/ - handleDBConnectionProperty: function() { + handleDBConnectionProperty: function () { if (!['addServiceController', 'installerController'].contains(App.clusterStatus.wizardControllerName)) return; var handledProperties = ['oozie_database', 'hive_database']; var currentValue = this.get('serviceConfig.value'); @@ -375,16 +375,16 @@ App.ServiceConfigRadioButtons = Ember.View.extend({ var currentDBType = currentValue.match(databasesTypes)[0]; var existingDatabase = /existing/gi.test(currentValue); // db connection check button show up if existed db selected - if (App.supports.databaseConnection) { - var propertyAppendTo1 = this.get('categoryConfigsAll').findProperty('displayName', 'Database URL'); - if (currentDB && existingDatabase) { - if (handledProperties.contains(this.get('serviceConfig.name'))) { - if (propertyAppendTo1) propertyAppendTo1.set('additionalView', App.CheckDBConnectionView.extend({databaseName: currentDB})); - } - } else { - propertyAppendTo1.set('additionalView', null); + + var propertyAppendTo1 = this.get('categoryConfigsAll').findProperty('displayName', 'Database URL'); + if (currentDB && existingDatabase) { + if (handledProperties.contains(this.get('serviceConfig.name'))) { + if (propertyAppendTo1) propertyAppendTo1.set('additionalView', App.CheckDBConnectionView.extend({databaseName: currentDB})); } + } else { + propertyAppendTo1.set('additionalView', null); } + // warning msg under database type radio buttons, to warn the user to setup jdbc driver if existed db selected var propertyHive = this.get('categoryConfigsAll').findProperty('displayName', 'Hive Database'); var propertyOozie = this.get('categoryConfigsAll').findProperty('displayName', 'Oozie Database'); http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/global/update_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/global/update_controller_test.js b/ambari-web/test/controllers/global/update_controller_test.js index df4420e..45622bd 100644 --- a/ambari-web/test/controllers/global/update_controller_test.js +++ b/ambari-web/test/controllers/global/update_controller_test.js @@ -60,15 +60,7 @@ describe('App.UpdateController', function () { expect(App.updater.run.called).to.equal(false); }); - it('isWorking = true, App.supports.hostOverrides = false', function () { - App.supports.hostOverrides = false; - controller.set('isWorking', true); - expect(App.updater.run.callCount).to.equal(5); - controller.set('isWorking', false); - }); - - it('isWorking = true, App.supports.hostOverrides = true', function () { - App.supports.hostOverrides = true; + it('isWorking = true', function () { controller.set('isWorking', true); expect(App.updater.run.callCount).to.equal(6); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/main/host/details_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index 084fc8d..84f5773 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -1641,11 +1641,6 @@ describe('App.MainHostDetailsController', function () { controller.confirmDeleteHost.restore(); }); - it('App.supports.deleteHost = false', function () { - App.supports.deleteHost = false; - expect(controller.validateAndDeleteHost()).to.be.false; - App.supports.deleteHost = true; - }); it('masterComponents exist', function () { controller.set('mockHostComponentsInfo', {masterComponents: [ {} http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/main/service/info/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service/info/config_test.js b/ambari-web/test/controllers/main/service/info/config_test.js index a7dcb0b..d2aee1a 100644 --- a/ambari-web/test/controllers/main/service/info/config_test.js +++ b/ambari-web/test/controllers/main/service/info/config_test.js @@ -1040,17 +1040,10 @@ describe("App.MainServiceInfoConfigsController", function () { }, { siteName: "mapred-queue-acls", - method: false, - capacitySchedulerUi: false - }, - { - siteName: "mapred-queue-acls", - method: "createSiteObj", - capacitySchedulerUi: true + method: false } ]; - var capacitySchedulerUi = App.supports.capacitySchedulerUi; beforeEach(function() { sinon.stub(mainServiceInfoConfigsController, "createCoreSiteObj", Em.K); sinon.stub(mainServiceInfoConfigsController, "createSiteObj", Em.K); @@ -1060,12 +1053,10 @@ describe("App.MainServiceInfoConfigsController", function () { afterEach(function() { mainServiceInfoConfigsController.createCoreSiteObj.restore(); mainServiceInfoConfigsController.createSiteObj.restore(); - App.supports.capacitySchedulerUi = capacitySchedulerUi; }); tests.forEach(function(t) { it("create object for " + t.siteName + " run method " + t.method, function() { - App.supports.capacitySchedulerUi = t.capacitySchedulerUi; mainServiceInfoConfigsController.set("content.serviceName", t.serviceName); mainServiceInfoConfigsController.createConfigObject(t.siteName, "versrion1"); if (t.method) { http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/main/service_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service_test.js b/ambari-web/test/controllers/main/service_test.js index 808bbe7..9ffd7a3 100644 --- a/ambari-web/test/controllers/main/service_test.js +++ b/ambari-web/test/controllers/main/service_test.js @@ -123,67 +123,6 @@ describe('App.MainServiceController', function () { }); - describe('#isAllServicesInstalled', function() { - - beforeEach(function() { - sinon.stub(App.StackService, 'find', function() { - return [ - {serviceName: 's1'}, - {serviceName: 's2'}, - {serviceName: 'HUE'} - ]; - }); - mainServiceController.set('content', {}); - }); - - afterEach(function() { - App.StackService.find.restore(); - }); - - it('should be false if content is not loaded', function() { - expect(mainServiceController.get('isAllServicesInstalled')).to.be.false; - }); - - var tests = Em.A([ - { - hue: false, - content: ['', ''], - m: 'no hue', - e: true - }, - { - hue: false, - content: [''], - m: 'no hue (2)', - e: false - }, - { - hue: true, - content: ['', '', ''], - m: 'hue', - e: true - }, - { - hue: false, - content: ['', ''], - m: 'hue (2)', - e: true - } - ]).forEach(function(test) { - it(test.m, function() { - mainServiceController.reopen({content: {content: test.content}}); - sinon.stub(App, 'get', function(k) { - if ('supports.hue' == k) return test.hue; - return Em.get(App, k); - }); - var r = mainServiceController.get('isAllServicesInstalled'); - App.get.restore(); - expect(r).to.equal(test.e); - }); - }); - - }); - describe('#cluster', function() { var tests = Em.A([ http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/wizard/step6_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step6_test.js b/ambari-web/test/controllers/wizard/step6_test.js index e1fadaa..3f9d3f8 100644 --- a/ambari-web/test/controllers/wizard/step6_test.js +++ b/ambari-web/test/controllers/wizard/step6_test.js @@ -357,57 +357,6 @@ describe('App.WizardStep6Controller', function () { }); }); - describe('#validate', function () { - var tests = Em.A([ - { - controllerName: 'addHostController', - method: 'validateEachHost', - r: true, - e: true - }, - { - controllerName: 'addHostController', - method: 'validateEachHost', - r: false, - e: false - }, - { - controllerName: 'addServiceController', - method: 'validateEachComponent', - r: true, - e: true - }, - { - controllerName: 'addServiceController', - method: 'validateEachComponent', - r: false, - e: false - }, - { - controllerName: 'installerController', - method: 'validateEachComponent', - r: true, - e: true - }, - { - controllerName: 'installerController', - method: 'validateEachComponent', - r: false, - e: false - } - ]); - tests.forEach(function (test) { - it(test.controllerName + ' ' + test.method + ' returns ' + test.r.toString(), function () { - sinon.stub(controller, test.method, function () { - return test.r - }); - controller.set('content.controllerName', test.controllerName); - expect(controller.callClientSideValidation()).to.equal(test.e); - controller[test.method].restore(); - }); - }); - }); - describe('#getMasterComponentsForHost', function () { var tests = Em.A([ { http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/wizard/step7_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index d405426..c752bc0 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -935,36 +935,16 @@ describe('App.InstallerStep7Controller', function () { }); Em.A([ { - hostOverridesInstaller: false, installedServiceNames: [], - m: 'hostOverridesInstaller is false, installedServiceNames is empty', - e: { - loadConfigGroups: false, - loadInstalledServicesConfigGroups: false - } - }, - { - hostOverridesInstaller: false, - installedServiceNames: ['s1', 's2'], - m: 'hostOverridesInstaller is false, installedServiceNames is n\'t empty', - e: { - loadConfigGroups: false, - loadInstalledServicesConfigGroups: false - } - }, - { - hostOverridesInstaller: true, - installedServiceNames: [], - m: 'hostOverridesInstaller is true, installedServiceNames is empty', + m: 'installedServiceNames is empty', e: { loadConfigGroups: true, loadInstalledServicesConfigGroups: false } }, { - hostOverridesInstaller: true, installedServiceNames: ['s1', 's2', 's3'], - m: 'hostOverridesInstaller is true, installedServiceNames isn\'t empty', + m: 'installedServiceNames isn\'t empty', e: { loadConfigGroups: true, loadInstalledServicesConfigGroups: true @@ -1101,14 +1081,7 @@ describe('App.InstallerStep7Controller', function () { allSelectedServiceNames: ['YARN'], fileConfigsIntoTextarea: true, m: 'should run fileConfigsIntoTextarea and resolveServiceDependencyConfigs', - resolveServiceDependencyConfigs: true, - capacitySchedulerUi: false - }, - { - allSelectedServiceNames: ['YARN'], - m: 'shouldn\'t run fileConfigsIntoTextarea but run resolveServiceDependencyConfigs', - resolveServiceDependencyConfigs: true, - capacitySchedulerUi: true + resolveServiceDependencyConfigs: true }, { allSelectedServiceNames: ['STORM'], @@ -1117,10 +1090,6 @@ describe('App.InstallerStep7Controller', function () { } ]).forEach(function(t) { it(t.m, function () { - sinon.stub(App, 'get', function (k) { - if (k === 'supports.capacitySchedulerUi') return t.capacitySchedulerUi; - return Em.get(App, k); - }); installerStep7Controller.reopen({ allSelectedServiceNames: t.allSelectedServiceNames }); @@ -1135,7 +1104,6 @@ describe('App.InstallerStep7Controller', function () { } else { expect(installerStep7Controller.resolveServiceDependencyConfigs.calledOnce).to.equal(false); } - App.get.restore(); }); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/controllers/wizard/step9_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step9_test.js b/ambari-web/test/controllers/wizard/step9_test.js index 4ac8e1f..7ffdcc2 100644 --- a/ambari-web/test/controllers/wizard/step9_test.js +++ b/ambari-web/test/controllers/wizard/step9_test.js @@ -1138,7 +1138,7 @@ describe('App.InstallerStep9Controller', function () { expect(App.ajax.send.called).to.equal(false); }); it('should call App.ajax.send', function () { - c.set('content', {cluster: {name: 'n'}, controllerName: 'installerController'}); + c.set('content', Ember.Object.create({cluster: {name: 'n'}, controllerName: 'installerController'})); c.isAllComponentsInstalled(); expect(App.ajax.send.args[0][0].data).to.eql({cluster: 'n'}); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/models/stack_service_component_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/stack_service_component_test.js b/ambari-web/test/models/stack_service_component_test.js index c6ab457..b4e9195 100644 --- a/ambari-web/test/models/stack_service_component_test.js +++ b/ambari-web/test/models/stack_service_component_test.js @@ -50,7 +50,6 @@ require('models/stack_service_component'); isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, defaultNoOfMasterHosts: 1, coHostedComponents: [], isOtherComponentCoHosted: false, @@ -104,7 +103,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: true, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, defaultNoOfMasterHosts: 3, coHostedComponents: [], isOtherComponentCoHosted: false, @@ -135,7 +133,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: [], isOtherComponentCoHosted: false, isCoHostedComponent: false @@ -165,7 +162,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: true, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: [], isOtherComponentCoHosted: false, isCoHostedComponent: false @@ -195,7 +191,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: [], isOtherComponentCoHosted: false, isCoHostedComponent: false @@ -225,7 +220,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: [], isOtherComponentCoHosted: false, isCoHostedComponent: true @@ -255,7 +249,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: ['HIVE_METASTORE','WEBHCAT_SERVER'], isOtherComponentCoHosted: true, isCoHostedComponent: false @@ -285,7 +278,6 @@ var componentPropertiesValidationTests = [ isMasterAddableInstallerWizard: false, isHAComponentOnly: false, isRequiredOnAllHosts: false, - isNotPreferableOnAmbariServerHost: false, coHostedComponents: [], isOtherComponentCoHosted: false, isCoHostedComponent: false http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/models/user_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/user_test.js b/ambari-web/test/models/user_test.js index d844472..8084163 100644 --- a/ambari-web/test/models/user_test.js +++ b/ambari-web/test/models/user_test.js @@ -103,8 +103,6 @@ describe('App.EditUserForm', function () { return { getLoginName: Em.K }; - case 'supports.ldapGroupMapping': - return true; default: return Em.get(App, k); } @@ -126,9 +124,8 @@ describe('App.EditUserForm', function () { it('should disable', function () { form.set('object', objectData); - expect(form.get('field.admin.disabled')).to.be.true; + expect(form.get('field.admin.disabled')).to.be.false; }); - }); describe('#isValid', function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/33ed5921/ambari-web/test/views/common/configs/services_config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/common/configs/services_config_test.js b/ambari-web/test/views/common/configs/services_config_test.js index 2014dea..c4b245d 100644 --- a/ambari-web/test/views/common/configs/services_config_test.js +++ b/ambari-web/test/views/common/configs/services_config_test.js @@ -284,20 +284,5 @@ describe('App.ServiceConfigContainerView', function () { }); expect(view.get('childViews.firstObject.serviceConfigsByCategoryView.childViews')).to.have.length(2); }); - it('shouldn\'t add category with custom view if capacitySchedulerUi isn\'t active', function () { - sinon.stub(App, 'get', function(k) { - if (k === 'supports.capacitySchedulerUi') return false; - return Em.get(App, k); - }); - view.set('controller', { - selectedService: { - configCategories: [Em.Object.create({ - isCustomView: true - })] - } - }); - expect(view.get('childViews.firstObject.serviceConfigsByCategoryView.childViews')).to.be.empty; - App.get.restore(); - }); }); });