Skip to content

Commit 4f251cd

Browse files
committed
isPotentialFunction
1 parent fba8218 commit 4f251cd

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
960960
return;
961961
}
962962

963-
if (!osparc.study.Utils.isPotentialFunction(this.__resourceData["workbench"])) {
963+
if (!osparc.study.CreateFunction.isPotentialFunction(this.__resourceData["workbench"])) {
964964
return;
965965
}
966966

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,32 @@ qx.Class.define("osparc.study.CreateFunction", {
3232
this.__buildLayout();
3333
},
3434

35+
statics: {
36+
isPotentialFunction: function(workbench) {
37+
// in order to create a function, the pipeline needs:
38+
// - at least one parameter or one probe
39+
// - for now, only float types are allowed
40+
// - at least one computational service
41+
// - no dynamic services
42+
43+
// const filePickers = osparc.study.Utils.extractFilePickers(workbench);
44+
// const parameters = osparc.study.Utils.extractParameters(workbench);
45+
// const probes = osparc.study.Utils.extractProbes(workbench);
46+
// return (filePickers.length + parameters.length) && probes.length;
47+
48+
const parameters = osparc.study.Utils.extractFunctionableParameters(workbench);
49+
const probes = osparc.study.Utils.extractFunctionableProbes(workbench);
50+
const computationals = osparc.study.Utils.extractComputationalServices(workbench);
51+
const dynamics = osparc.study.Utils.extractDynamicServices(workbench);
52+
53+
return (
54+
(parameters.length || probes.length) &&
55+
computationals.length > 0 &&
56+
dynamics.length === 0
57+
);
58+
},
59+
},
60+
3561
members: {
3662
__studyData: null,
3763
__form: null,

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -270,30 +270,6 @@ qx.Class.define("osparc.study.Utils", {
270270
return parameters;
271271
},
272272

273-
isPotentialFunction: function(workbench) {
274-
// in order to create a function, the pipeline needs:
275-
// - at least one parameter or one probe
276-
// - for now, only float types are allowed
277-
// - at least one computational service
278-
// - no dynamic services
279-
280-
// const filePickers = osparc.study.Utils.extractFilePickers(workbench);
281-
// const parameters = osparc.study.Utils.extractParameters(workbench);
282-
// const probes = osparc.study.Utils.extractProbes(workbench);
283-
// return (filePickers.length + parameters.length) && probes.length;
284-
285-
const parameters = osparc.study.Utils.extractFunctionableParameters(workbench);
286-
const probes = osparc.study.Utils.extractFunctionableProbes(workbench);
287-
const computationals = osparc.study.Utils.extractComputationalServices(workbench);
288-
const dynamics = osparc.study.Utils.extractDynamicServices(workbench);
289-
290-
return (
291-
(parameters.length || probes.length) &&
292-
computationals.length > 0 &&
293-
dynamics.length === 0
294-
);
295-
},
296-
297273
getCantReadServices: function(studyServices = []) {
298274
return studyServices.filter(studyService => studyService["myAccessRights"]["execute"] === false);
299275
},

0 commit comments

Comments
 (0)