You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2019/01/02 10:50:31 UTC
[ambari] branch trunk updated: AMBARI-25076 Select Service page:
Show Yarn and MR2 as separate services for selection instead of single
selection (Yarn+MapReduce2)
This is an automated email from the ASF dual-hosted git repository.
atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 78ad4f5 AMBARI-25076 Select Service page: Show Yarn and MR2 as separate services for selection instead of single selection (Yarn+MapReduce2)
78ad4f5 is described below
commit 78ad4f572b631797d0675d3cef753b5237521188
Author: Andrii Tkach <at...@apache.org>
AuthorDate: Wed Jan 2 11:56:17 2019 +0200
AMBARI-25076 Select Service page: Show Yarn and MR2 as separate services for selection instead of single selection (Yarn+MapReduce2)
---
ambari-web/app/models/stack_service.js | 9 +++------
ambari-web/app/models/stack_version/service_simple.js | 5 +----
ambari-web/test/controllers/wizard/step4_test.js | 7 +++++--
ambari-web/test/models/stack_service_test.js | 8 +++-----
ambari-web/test/models/stack_version/service_simple_test.js | 6 ------
5 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index b911360..d06960f 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -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 = [];
@@ -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 = {
diff --git a/ambari-web/app/models/stack_version/service_simple.js b/ambari-web/app/models/stack_version/service_simple.js
index a31c829..a90fe97 100644
--- a/ambari-web/app/models/stack_version/service_simple.js
+++ b/ambari-web/app/models/stack_version/service_simple.js
@@ -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'];
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index 91b7354..bd1facf 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -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')
}));
});
diff --git a/ambari-web/test/models/stack_service_test.js b/ambari-web/test/models/stack_service_test.js
index 2d76a8b..27761c0 100644
--- a/ambari-web/test/models/stack_service_test.js
+++ b/ambari-web/test/models/stack_service_test.js
@@ -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');
@@ -113,11 +116,6 @@ describe('App.StackService', function () {
result: false
},
{
- serviceName: 'MAPREDUCE2',
- isInstallable: true,
- result: true
- },
- {
serviceName: 'KERBEROS',
isInstallable: false,
result: true
diff --git a/ambari-web/test/models/stack_version/service_simple_test.js b/ambari-web/test/models/stack_version/service_simple_test.js
index ae00f9c..5ed2daf 100644
--- a/ambari-web/test/models/stack_version/service_simple_test.js
+++ b/ambari-web/test/models/stack_version/service_simple_test.js
@@ -31,12 +31,6 @@ describe('App.ServiceSimple', function () {
var cases = [
{
- name: 'MAPREDUCE2',
- doNotShowAndInstall: false,
- isHidden: true,
- title: 'MapReduce2 isn\'t displayed in wizard as separate service'
- },
- {
name: 'KERBEROS',
doNotShowAndInstall: true,
isHidden: true,