Skip to content

Commit e2d9bf9

Browse files
committed
"updateHypertool" chain
1 parent 272911d commit e2d9bf9

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,20 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
9999

100100
_updateServiceData: function(serviceData) {
101101
serviceData["resourceType"] = "service";
102-
const servicesList = this._resourcesList;
103-
const index = servicesList.findIndex(service => service["key"] === serviceData["key"] && service["version"] === serviceData["version"]);
102+
const appsList = this._resourcesList;
103+
const index = appsList.findIndex(service => service["key"] === serviceData["key"] && service["version"] === serviceData["version"]);
104104
if (index !== -1) {
105-
servicesList[index] = serviceData;
105+
appsList[index] = serviceData;
106+
this._reloadCards();
107+
}
108+
},
109+
110+
_updateHypertoolData: function(hypertoolData) {
111+
hypertoolData["resourceType"] = "hypertool";
112+
const appsList = this._resourcesList;
113+
const index = appsList.findIndex(service => service["uuid"] === hypertoolData["uuid"]);
114+
if (index !== -1) {
115+
appsList[index] = hypertoolData;
106116
this._reloadCards();
107117
}
108118
},

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
4141
"updateStudy": "qx.event.type.Data",
4242
"updateTemplate": "qx.event.type.Data",
4343
"updateService": "qx.event.type.Data",
44+
"updateHypertool": "qx.event.type.Data",
4445
"publishTemplate": "qx.event.type.Data",
4546
"tagClicked": "qx.event.type.Data",
4647
"emptyStudyClicked": "qx.event.type.Data"
@@ -998,7 +999,8 @@ qx.Class.define("osparc.dashboard.CardBase", {
998999
[
9991000
"updateStudy",
10001001
"updateTemplate",
1001-
"updateService"
1002+
"updateService",
1003+
"updateHypertool",
10021004
].forEach(ev => {
10031005
resourceDetails.addListener(ev, e => this.fireDataEvent(ev, e.getData()));
10041006
});

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
288288
resourcesContainer.addListener("updateStudy", e => this._updateStudyData(e.getData()));
289289
resourcesContainer.addListener("updateTemplate", e => this._updateTemplateData(e.getData()));
290290
resourcesContainer.addListener("updateService", e => this._updateServiceData(e.getData()));
291+
resourcesContainer.addListener("updateHypertool", e => this._updateHypertoolData(e.getData()));
291292
resourcesContainer.addListener("publishTemplate", e => this.fireDataEvent("publishTemplate", e.getData()));
292293
resourcesContainer.addListener("tagClicked", e => this._searchBarFilter.addTagActiveFilter(e.getData()));
293294
resourcesContainer.addListener("emptyStudyClicked", e => this._deleteResourceRequested(e.getData()));
@@ -529,6 +530,10 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
529530
throw new Error("Abstract method called!");
530531
},
531532

533+
_updateHypertoolData: function(serviceData) {
534+
throw new Error("Abstract method called!");
535+
},
536+
532537
_startStudyById: function(studyId, openCB, cancelCB, isStudyCreation = false) {
533538
if (isStudyCreation) {
534539
this.fireDataEvent("changeTab", "studiesTab");
@@ -761,6 +766,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
761766
resourceDetails.addListener("updateStudy", e => this._updateStudyData(e.getData()));
762767
resourceDetails.addListener("updateTemplate", e => this._updateTemplateData(e.getData()));
763768
resourceDetails.addListener("updateService", e => this._updateServiceData(e.getData()));
769+
resourceDetails.addListener("updateHypertool", e => this._updateHypertoolData(e.getData()));
764770
resourceDetails.addListener("publishTemplate", e => {
765771
win.close();
766772
this.fireDataEvent("publishTemplate", e.getData());

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
6666
"updateStudy": "qx.event.type.Data",
6767
"updateTemplate": "qx.event.type.Data",
6868
"updateService": "qx.event.type.Data",
69+
"updateHypertool": "qx.event.type.Data",
6970
"publishTemplate": "qx.event.type.Data",
7071
"tagClicked": "qx.event.type.Data",
7172
"emptyStudyClicked": "qx.event.type.Data",
@@ -238,6 +239,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
238239
"updateStudy",
239240
"updateTemplate",
240241
"updateService",
242+
"updateHypertool",
241243
"publishTemplate",
242244
"tagClicked",
243245
"emptyStudyClicked"

0 commit comments

Comments
 (0)