Skip to content

Commit cc7b229

Browse files
maintenance: project listing
2 parents ba1d76e + 3148d13 commit cc7b229

File tree

8 files changed

+71
-31
lines changed

8 files changed

+71
-31
lines changed

.github/workflows/ci-testing-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,7 @@ jobs:
26562656
if: ${{ always() }}
26572657
needs:
26582658
[
2659-
system-test-e2e,
2659+
# system-test-e2e, NOTE: not required, until Odei will have a look
26602660
system-test-e2e-playwright,
26612661
system-test-environment-setup,
26622662
system-test-public-api,

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

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
405405
services: {
406406
check: "Array",
407407
init: true,
408-
nullable: false,
408+
nullable: true,
409409
apply: "__applyServices",
410410
event: "changeServices",
411411
},
@@ -567,7 +567,11 @@ qx.Class.define("osparc.dashboard.CardBase", {
567567
resourceData["services"] = services;
568568
this.setServices(services);
569569
})
570-
.catch(err => console.error(err));
570+
.catch(err => {
571+
resourceData["services"] = null;
572+
this.setServices(null);
573+
console.error(err);
574+
});
571575

572576
osparc.study.Utils.guessIcon(resourceData)
573577
.then(iconSource => this.setIcon(iconSource));
@@ -688,27 +692,38 @@ qx.Class.define("osparc.dashboard.CardBase", {
688692
},
689693

690694
__applyServices: function(services) {
691-
this.setEmptyWorkbench(services.length === 0);
692-
693-
// Updatable study
694-
if (osparc.study.Utils.anyServiceRetired(services)) {
695-
this.setUpdatable("retired");
696-
} else if (osparc.study.Utils.anyServiceDeprecated(services)) {
697-
this.setUpdatable("deprecated");
698-
} else if (osparc.study.Utils.anyServiceUpdatable(services)) {
699-
this.setUpdatable("updatable");
700-
}
701-
702-
// Block card
703-
const cantReadServices = osparc.study.Utils.getCantReadServices(services);
704-
if (cantReadServices.length) {
695+
const unknownServices = cantReadServices => {
696+
// Block card
705697
this.setBlocked("UNKNOWN_SERVICES");
706698
const image = "@FontAwesome5Solid/ban/";
707-
let toolTipText = this.tr("Inaccessible service(s):");
708-
cantReadServices.forEach(unSrv => {
709-
toolTipText += "<br>" + unSrv.key + ":" + osparc.service.Utils.extractVersionDisplay(unSrv.release);
710-
});
699+
let toolTipText = this.tr("Unknown service(s)");
700+
if (cantReadServices && cantReadServices.length) {
701+
toolTipText = this.tr("Inaccessible service(s)");
702+
cantReadServices.forEach(unSrv => {
703+
toolTipText += "<br>" + unSrv.key + ":" + osparc.service.Utils.extractVersionDisplay(unSrv.release);
704+
});
705+
}
711706
this.__showBlockedCard(image, toolTipText);
707+
};
708+
709+
if (services) {
710+
this.setEmptyWorkbench(services.length === 0);
711+
712+
// Updatable study
713+
if (osparc.study.Utils.anyServiceRetired(services)) {
714+
this.setUpdatable("retired");
715+
} else if (osparc.study.Utils.anyServiceDeprecated(services)) {
716+
this.setUpdatable("deprecated");
717+
} else if (osparc.study.Utils.anyServiceUpdatable(services)) {
718+
this.setUpdatable("updatable");
719+
}
720+
721+
const cantReadServices = osparc.study.Utils.getCantReadServices(services);
722+
if (cantReadServices.length) {
723+
unknownServices(cantReadServices);
724+
}
725+
} else {
726+
unknownServices();
712727
}
713728

714729
this.evaluateMenuButtons();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ qx.Class.define("osparc.dashboard.DataBrowser", {
4343
let control;
4444
switch (id) {
4545
case "tree-folder-view":
46-
control = new osparc.file.TreeFolderView();
46+
control = new osparc.file.TreeFolderView().set({
47+
paddingBottom: 15,
48+
});
4749
this._addToLayout(control, {
4850
flex: 1
4951
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
804804
__getCreateTemplatePage: function() {
805805
if (
806806
!osparc.utils.Resources.isStudy(this.__resourceData) ||
807-
osparc.product.Utils.showTemplates()
807+
!osparc.product.Utils.showTemplates()
808808
) {
809809
return null;
810810
}

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ qx.Class.define("osparc.data.Resources", {
151151
},
152152
postToTemplate: {
153153
method: "POST",
154-
url: statics.API + "/projects?from_study={study_id}&as_template=true&copy_data={copy_data}"
154+
url: statics.API + "/projects?from_study={study_id}&as_template=true&copy_data={copy_data}&hidden={hidden}"
155155
},
156156
open: {
157157
method: "POST",
@@ -303,6 +303,10 @@ qx.Class.define("osparc.data.Resources", {
303303
method: "POST",
304304
url: statics.API + "/projects/{studyId}/workspaces/{workspaceId}:move"
305305
},
306+
updateMetadata: {
307+
method: "PATCH",
308+
url: statics.API + "/projects/{studyId}/metadata"
309+
},
306310
}
307311
},
308312
"conversations": {

services/static-webserver/client/source/class/osparc/desktop/MainPage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ qx.Class.define("osparc.desktop.MainPage", {
240240
const params = {
241241
url: {
242242
"study_id": studyId,
243-
"copy_data": copyData
243+
"copy_data": copyData,
244+
"hidden": false,
244245
},
245246
};
246247
const options = {

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,12 @@ qx.Class.define("osparc.study.CreateFunction", {
282282
__createFunction: function(exposedInputs, exposedOutputs) {
283283
this.__createFunctionBtn.setFetching(true);
284284

285-
// first publish it as a template
285+
// first publish it as a hidden template
286286
const params = {
287287
url: {
288288
"study_id": this.__studyData["uuid"],
289289
"copy_data": true,
290+
"hidden": true,
290291
},
291292
};
292293
const options = {
@@ -298,7 +299,8 @@ qx.Class.define("osparc.study.CreateFunction", {
298299
.then(task => {
299300
task.addListener("resultReceived", e => {
300301
const templateData = e.getData();
301-
this.__doCreateFunction(templateData, exposedInputs, exposedOutputs);
302+
this.__updateTemplateMetadata(templateData);
303+
this.__registerFunction(templateData, exposedInputs, exposedOutputs);
302304
});
303305
})
304306
.catch(err => {
@@ -307,13 +309,27 @@ qx.Class.define("osparc.study.CreateFunction", {
307309
});
308310
},
309311

310-
__doCreateFunction: function(templateData, exposedInputs, exposedOutputs) {
312+
__updateTemplateMetadata: function(templateData) {
313+
const patchData = {
314+
"custom" : {
315+
"hidden": "Base template for function",
316+
}
317+
};
318+
const params = {
319+
url: {
320+
"studyId": templateData["uuid"],
321+
},
322+
data: patchData
323+
};
324+
osparc.data.Resources.fetch("studies", "updateMetadata", params)
325+
.catch(err => console.error(err));
326+
},
327+
328+
__registerFunction: function(templateData, exposedInputs, exposedOutputs) {
311329
const nameField = this.__form.getItem("name");
312330
const descriptionField = this.__form.getItem("description");
313331

314332
const functionData = this.self().createFunctionData(templateData, nameField.getValue(), descriptionField.getValue(), exposedInputs, exposedOutputs);
315-
console.log("functionData", functionData);
316-
317333
const params = {
318334
data: functionData,
319335
};

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ qx.Class.define("osparc.study.Utils", {
355355
},
356356

357357
__getBlockedState: function(studyData) {
358-
if (studyData["services"]) {
358+
if (studyData["services"] === null) {
359+
return "UNKNOWN_SERVICES";
360+
} else if (studyData["services"]) {
359361
const cantReadServices = osparc.study.Utils.getCantReadServices(studyData["services"]);
360362
const inaccessibleServices = osparc.store.Services.getInaccessibleServices(studyData["workbench"]);
361363
if (cantReadServices.length || inaccessibleServices.length) {

0 commit comments

Comments
 (0)