Skip to content

Commit

Permalink
AMBARI-25076 Select Service page: Show Yarn and MR2 as separate servi…
Browse files Browse the repository at this point in the history
…ces for selection instead of single selection (Yarn+MapReduce2)
  • Loading branch information
atkach committed Jan 2, 2019
1 parent 0717fb8 commit 78ad4f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
9 changes: 3 additions & 6 deletions ambari-web/app/models/stack_service.js
Expand Up @@ -221,9 +221,8 @@ App.StackService = DS.Model.extend({
}.property('coSelectedServices', 'serviceName'),

isHiddenOnSelectServicePage: function () {
var hiddenServices = ['MAPREDUCE2'];
return hiddenServices.contains(this.get('serviceName')) || !this.get('isInstallable') || this.get('doNotShowAndInstall');
}.property('serviceName', 'isInstallable'),
return !this.get('isInstallable') || this.get('doNotShowAndInstall');
}.property('isInstallable', 'doNotShowAndInstall'),

doNotShowAndInstall: function () {
var skipServices = [];
Expand Down Expand Up @@ -351,9 +350,7 @@ App.StackService.componentsOrderForService = {
};

//@TODO: Write unit test for no two keys in the object should have any intersecting elements in their values
App.StackService.coSelected = {
'YARN': ['MAPREDUCE2']
};
App.StackService.coSelected = {};


App.StackService.reviewPageHandlers = {
Expand Down
5 changes: 1 addition & 4 deletions ambari-web/app/models/stack_version/service_simple.js
Expand Up @@ -25,10 +25,7 @@ App.ServiceSimple = DS.Model.extend({
latestVersion: DS.attr('string'),
isAvailable: DS.attr('boolean'),
isUpgradable: DS.attr('boolean'),
isHidden: function () {
var hiddenServices = ['MAPREDUCE2'];
return hiddenServices.contains(this.get('name')) || this.get('doNotShowAndInstall');
}.property('name'),
isHidden: Em.computed.alias('doNotShowAndInstall'),

doNotShowAndInstall: function () {
var skipServices = ['KERBEROS'];
Expand Down
7 changes: 5 additions & 2 deletions ambari-web/test/controllers/wizard/step4_test.js
Expand Up @@ -190,13 +190,16 @@ describe('App.WizardStep4Controller', function () {
beforeEach(function () {
controller.clear();
Object.keys(testCase.condition).forEach(function (id) {
controller.pushObject(App.StackService.createRecord({
controller.pushObject(Em.Object.create({
serviceName: id,
isSelected: testCase.condition[id],
canBeSelected: true,
isInstalled: false,
coSelectedServices: function() {
return App.StackService.coSelected[this.get('serviceName')] || [];
var coSelected = {
'YARN': ['MAPREDUCE2']
};
return coSelected[this.get('serviceName')] || [];
}.property('serviceName')
}));
});
Expand Down
8 changes: 3 additions & 5 deletions ambari-web/test/models/stack_service_test.js
Expand Up @@ -98,6 +98,9 @@ describe('App.StackService', function () {
expect(ss.get('displayNameOnSelectServicePage')).to.equal('HDFS');
});
it('Present coSelectedServices', function () {
ss.reopen({
coSelectedServices: ['MAPREDUCE2']
});
ss.set('serviceName', 'YARN');
ss.set('displayName', 'YARN');
ss.propertyDidChange('displayNameOnSelectServicePage');
Expand All @@ -112,11 +115,6 @@ describe('App.StackService', function () {
isInstallable: true,
result: false
},
{
serviceName: 'MAPREDUCE2',
isInstallable: true,
result: true
},
{
serviceName: 'KERBEROS',
isInstallable: false,
Expand Down
6 changes: 0 additions & 6 deletions ambari-web/test/models/stack_version/service_simple_test.js
Expand Up @@ -30,12 +30,6 @@ describe('App.ServiceSimple', function () {
describe('#isHidden', function () {

var cases = [
{
name: 'MAPREDUCE2',
doNotShowAndInstall: false,
isHidden: true,
title: 'MapReduce2 isn\'t displayed in wizard as separate service'
},
{
name: 'KERBEROS',
doNotShowAndInstall: true,
Expand Down

0 comments on commit 78ad4f5

Please sign in to comment.