Skip to content

Commit b9bfb2c

Browse files
committed
openLocation
1 parent f1b1514 commit b9bfb2c

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ qx.Class.define("osparc.dashboard.FileButtonItem", {
123123
});
124124

125125
const openLocationButton = new qx.ui.menu.Button(this.tr("Open location"), "@FontAwesome5Solid/folder/12");
126-
openLocationButton.addListener("execute", () => this.fireDataEvent("openLocation", this.getFolderId()), this);
127-
osparc.utils.Utils.setIdToWidget(openLocationButton, "openLocationMenuItem");
126+
openLocationButton.addListener("execute", () => this.fireDataEvent("openLocation", {
127+
projectId: file.getProjectId(),
128+
path: file.getPath()
129+
}), this);
128130
menu.add(openLocationButton);
129131

130132
menuButton.setMenu(menu);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
357357
resourcesContainer.addListener("trashWorkspaceRequested", e => this._trashWorkspaceRequested(e.getData()));
358358
resourcesContainer.addListener("untrashWorkspaceRequested", e => this._untrashWorkspaceRequested(e.getData()));
359359
resourcesContainer.addListener("deleteWorkspaceRequested", e => this._deleteWorkspaceRequested(e.getData()));
360+
resourcesContainer.addListener("openLocation", e => this._openLocation(e.getData()));
360361

361362
this._addToLayout(resourcesContainer);
362363
},
@@ -928,7 +929,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
928929
throw new Error("Abstract method called!");
929930
},
930931

931-
_workspaceSelected: function(workspaceId) {
932+
_openLocation: function(data) {
932933
throw new Error("Abstract method called!");
933934
},
934935

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
103103
"changeContext": "qx.event.type.Data",
104104
"studyToFolderRequested": "qx.event.type.Data",
105105
"folderToFolderRequested": "qx.event.type.Data",
106+
"openLocation": "qx.event.type.Data",
106107
},
107108

108109
statics: {

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,30 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
795795
// It will remove the file cards
796796
this._reloadCards();
797797
},
798+
799+
_openLocation: function(fileData) {
800+
const projectId = fileData["projectId"];
801+
const path = fileData["path"];
802+
this.__openStudyDetails(projectId, path);
803+
},
804+
805+
__openStudyDetails: function(projectId, path) {
806+
osparc.store.Study.getInstance().getOne(projectId)
807+
.then(studyData => {
808+
if (studyData) {
809+
const studyDataCopy = osparc.data.model.Study.deepCloneStudyObject(studyData);
810+
studyDataCopy["resourceType"] = "study";
811+
const {
812+
resourceDetails,
813+
window,
814+
} = osparc.dashboard.ResourceDetails.popUpInWindow(studyDataCopy);
815+
resourceDetails.addListener("openStudy", () => {
816+
const openCB = () => window.close();
817+
this._startStudyById(projectId, openCB);
818+
});
819+
}
820+
});
821+
},
798822
// /FILES
799823

800824
__configureStudyCards: function(cards) {

0 commit comments

Comments
 (0)