Skip to content

Commit ddeb2e9

Browse files
committed
or -> and
1 parent 1469801 commit ddeb2e9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

services/static-webserver/client/source/class/osparc/study/CreateFunction.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ qx.Class.define("osparc.study.CreateFunction", {
3535
statics: {
3636
isPotentialFunction: function(workbench) {
3737
// in order to create a function, the pipeline needs:
38-
// - at least one parameter or one probe
38+
// - at least one parameter AND one probe
3939
// - for now, only float types are allowed
4040
// - at least one computational service
4141
// - no dynamic services
@@ -51,16 +51,14 @@ qx.Class.define("osparc.study.CreateFunction", {
5151
const dynamics = osparc.study.Utils.extractDynamicServices(workbench);
5252

5353
return (
54-
(parameters.length || probes.length) &&
54+
(parameters.length && probes.length) &&
5555
computationals.length > 0 &&
5656
dynamics.length === 0
5757
);
5858
},
5959

6060
checkExposedInputsOutputs: function(exposedInputs, exposedOutputs) {
61-
console.log("Exposed inputs:", exposedInputs);
62-
console.log("Exposed outputs:", exposedOutputs);
63-
return true;
61+
return Object.values(exposedInputs).some(exposedInputValue => exposedInputValue) && Object.values(exposedOutputs).some(exposedOutputValue => exposedOutputValue);
6462
},
6563
},
6664

@@ -271,7 +269,7 @@ qx.Class.define("osparc.study.CreateFunction", {
271269

272270
__createFunction: function(defaultInputs, exposedInputs, exposedOutputs) {
273271
if (!osparc.study.CreateFunction.checkExposedInputsOutputs(exposedInputs, exposedOutputs)) {
274-
const msg = this.tr("Exposed at least one input or output");
272+
const msg = this.tr("Expose at least one input and one output");
275273
osparc.FlashMessenger.logAs(msg, "ERROR");
276274
return;
277275
}

0 commit comments

Comments
 (0)