Skip to content

Commit ed99c7b

Browse files
committed
JBDS-4484 Fuse Tooling, Fuse and JBoss EAP should not be selected
1 parent 14a925c commit ed99c7b

5 files changed

Lines changed: 19 additions & 15 deletions

File tree

browser/model/installable-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class InstallableItem {
4444

4545
this.isCollapsed = true;
4646
this.option = new Set();
47-
this.selectedOption = 'install';
47+
this.selectedOption = requirement.defaultOption ? requirement.defaultOption : 'install';
4848

4949
this.downloader = null;
5050
this.downloadFolder = this.installerDataSvc.tempDir();

browser/pages/confirm/controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ class ConfirmController {
7777
checkboxModel[node].references=0;
7878
}
7979
for (let node of nodes) {
80-
let watchComponent = () => {
80+
function watchComponent(newv, oldv) {
8181
let installer = checkboxModel[node];
8282
if(installer.isSelected()) {
83-
for(let dep of this.graph.dependenciesOf(node)) {
83+
for(let dep of graph.dependenciesOf(node)) {
8484
let depInstaller = checkboxModel[dep];
8585
if(depInstaller.references === 0 && depInstaller.isNotDetected()) {
8686
depInstaller.selectedOption = 'install';
8787
}
8888
depInstaller.references++;
8989
}
90-
} else {
90+
} else if(!installer.isSelected() && oldv === 'install') {
9191
for(let dep of graph.dependenciesOf(node)) {
9292
let depInstaller = checkboxModel[dep];
9393
depInstaller.references--;
@@ -96,7 +96,7 @@ class ConfirmController {
9696
}
9797
}
9898
}
99-
};
99+
}
100100
this.sc.$watch(`checkboxModel.${node}.selectedOption`, watchComponent);
101101
}
102102
}

requirements.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"additionalLocation": "",
3636
"additionalIus": "com.jboss.devstudio.fuse.feature.feature.group",
3737
"useDownload": false,
38+
"defaultOption": "detected",
3839
"requires": ["devstudio"]
3940
},
4041
"fuseplatform": {
@@ -63,6 +64,7 @@
6364
}
6465
},
6566
"useDownload": true,
67+
"defaultOption": "detected",
6668
"requires": ["jdk"]
6769
},
6870
"fuseplatformkaraf": {
@@ -80,6 +82,7 @@
8082
"fileName": "jboss-fuse-karaf-6.3.0.redhat-187.zip",
8183
"sha256sum": "4ef481bb22f4a9c688d03f46374917e0f2548229f94ebd817c33817baf203b0c",
8284
"useDownload": true,
85+
"defaultOption": "detected",
8386
"requires": ["jdk"]
8487
},
8588
"jbosseap": {
@@ -97,6 +100,7 @@
97100
"fileName": "jboss-eap-7.0.0-installer.jar",
98101
"sha256sum": "8c4432464414ab986d0aa4c6b0faee94b797cf1f66949dd98496ca0ae54d7d35",
99102
"version": "7.0.0.GA",
103+
"defaultOption": "detected",
100104
"requires": ["jdk"]
101105
},
102106
"jdk": {

test/ui/install-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let loadMetadata = require('../../browser/services/metadata');
88
let requirements = loadMetadata(require(path.join(rootPath, 'requirements.json')), process.platform);
99

1010
for (var key in requirements) {
11-
if (requirements[key].bundle === 'tools') {
11+
if (requirements[key].bundle === 'tools' || requirements[key].defaultOption && requirements[key].defaultOption === 'detected') {
1212
delete requirements[key];
1313
}
1414
}
@@ -19,8 +19,7 @@ describe('Installation page', function() {
1919

2020
beforeAll(function() {
2121
browser.ignoreSynchronization = true;
22-
browser.setLocation('install')
23-
.then(function() {
22+
browser.setLocation('install').then(function() {
2423
for (var key in requirements) {
2524
requirements[key].name = requirements[key].name.toUpperCase();
2625
requirements[key].panel = element(By.id(key + '-progress'));

test/unit/pages/confirm/controller-test.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ describe('ConfirmController', function() {
176176
&& (el[0] == 'checkboxModel.jbosseap.selectedOption'
177177
|| el[0] == 'checkboxModel.devstudio.selectedOption'
178178
|| el[0] == 'checkboxModel.fusetools.selectedOption')) {
179-
el[1]();
179+
el[1]('detected', 'install');
180180
}
181181
});
182182
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('detected');
@@ -187,12 +187,13 @@ describe('ConfirmController', function() {
187187
return confirmController.initPage().then(function() {
188188
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('install');
189189
expect(confirmController.sc.checkboxModel.devstudio.selectedOption).equals('install');
190-
expect(confirmController.sc.checkboxModel.jbosseap.selectedOption).equals('install');
190+
expect(confirmController.sc.checkboxModel.jbosseap.selectedOption).equals('detected');
191+
confirmController.sc.checkboxModel.jbosseap.selectedOption = 'install';
191192
$watch.args.forEach(function(el) {
192193
if(el[1].name == 'watchComponent'
193194
&& ( el[0] == 'checkboxModel.jbosseap.selectedOption'
194195
|| el[0] == 'checkboxModel.devstudio.selectedOption')) {
195-
el[1]();
196+
el[1]('install', 'install'); // the same does angular avter initialization
196197
}
197198
});
198199
confirmController.sc.checkboxModel.devstudio.selectedOption = 'detected';
@@ -201,7 +202,7 @@ describe('ConfirmController', function() {
201202
if(el[1].name == 'watchComponent'
202203
&& ( el[0] == 'checkboxModel.jbosseap.selectedOption'
203204
|| el[0] == 'checkboxModel.devstudio.selectedOption')) {
204-
el[1]('detected');
205+
el[1]('detected', 'install');
205206
}
206207
});
207208
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('detected');
@@ -210,7 +211,7 @@ describe('ConfirmController', function() {
210211
$watch.args.forEach(function(el) {
211212
if(el[1].name == 'watchComponent'
212213
&& el[0] == 'checkboxModel.devstudio.selectedOption') {
213-
el[1]('install');
214+
el[1]('install','detected');
214215
}
215216
});
216217
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('install');
@@ -224,14 +225,14 @@ describe('ConfirmController', function() {
224225
$watch.args.forEach(function(el) {
225226
if(el[1].name == 'watchComponent'
226227
&& el[0] == 'checkboxModel.cdk.selectedOption') {
227-
el[1]('detected');
228+
el[1]('install', 'detected');
228229
}
229230
});
230231
confirmController.sc.checkboxModel.cdk.selectedOption = 'detected';
231232
$watch.args.forEach(function(el) {
232233
if(el[1].name == 'watchComponent'
233234
&& el[0] == 'checkboxModel.cdk.selectedOption') {
234-
el[1]('detected');
235+
el[1]('detected', 'install');
235236
}
236237
});
237238
expect(confirmController.sc.checkboxModel.cygwin.selectedOption).equals('detected');

0 commit comments

Comments
 (0)