Skip to content

Commit a912b84

Browse files
committed
connect empty study
1 parent 8685cbb commit a912b84

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
3535

3636
events: {
3737
"createFolder": "qx.event.type.Data",
38+
"newEmptyStudyClicked": "qx.event.type.Data",
3839
"newStudyFromTemplateClicked": "qx.event.type.Data",
3940
"newStudyFromServiceClicked": "qx.event.type.Data",
4041
},
@@ -186,6 +187,13 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
186187

187188
__addEmptyStudyButton: function(newStudyData) {
188189
const menuButton = this.__createFromResourceButton(newStudyData);
190+
191+
menuButton.addListener("tap", () => {
192+
this.fireDataEvent("newEmptyStudyClicked", {
193+
newStudyLabel: newStudyData.newStudyLabel,
194+
});
195+
});
196+
189197
this.__addIcon(menuButton, newStudyData);
190198
this.__addFromResourceButton(menuButton, newStudyData);
191199
},

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
896896
this.__createFolder(data);
897897
}, this);
898898

899+
newPlusButtonMenu.addListener("newEmptyStudyClicked", e => {
900+
const {
901+
newStudyLabel,
902+
} = e.getData();
903+
this.__newEmptyStudyBtnClicked(newStudyLabel);
904+
}, this);
905+
899906
newPlusButtonMenu.addListener("newStudyFromTemplateClicked", e => {
900907
const {
901908
templateData,
@@ -958,7 +965,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
958965
newEmptyStudyBtn.setCardKey("new-study");
959966
newEmptyStudyBtn.subscribeToFilterGroup("searchBarFilter");
960967
osparc.utils.Utils.setIdToWidget(newEmptyStudyBtn, "emptyStudyBtn");
961-
newEmptyStudyBtn.addListener("tap", () => this.__newEmptyStudyBtnClicked());
968+
newEmptyStudyBtn.addListener("tap", () => this.__newEmptyStudyBtnClicked("New Study"));
962969
this._resourcesContainer.addNonResourceCard(newEmptyStudyBtn);
963970
},
964971

@@ -1504,10 +1511,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
15041511
}
15051512
},
15061513

1507-
__newEmptyStudyBtnClicked: function() {
1508-
const minStudyData = osparc.data.model.Study.createMinStudyObject();
1514+
__newEmptyStudyBtnClicked: function(newStudyLabel) {
15091515
const existingNames = this._resourcesList.map(study => study["name"]);
1510-
const title = osparc.utils.Utils.getUniqueName(minStudyData.name, existingNames);
1516+
const title = osparc.utils.Utils.getUniqueName(newStudyLabel, existingNames);
1517+
const minStudyData = osparc.data.model.Study.createMinStudyObject();
15111518
minStudyData["name"] = title;
15121519
minStudyData["workspaceId"] = this.getCurrentWorkspaceId();
15131520
minStudyData["folderId"] = this.getCurrentFolderId();

services/static-webserver/client/source/resource/osparc/new_studies.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@
147147
"category": "osparc",
148148
"resourceType": "study",
149149
"icon": "@FontAwesome5Solid/file/18",
150-
"title": "Workbench",
151-
"newStudyLabel": "New Study",
150+
"title": "Pipeline",
151+
"newStudyLabel": "New Project",
152152
"idToWidget": "emptyStudyBtn"
153153
}]
154154
},
@@ -184,8 +184,8 @@
184184
"category": "osparc",
185185
"resourceType": "study",
186186
"icon": "@FontAwesome5Solid/file/18",
187-
"title": "Workbench",
188-
"newStudyLabel": "New Study",
187+
"title": "Pipeline",
188+
"newStudyLabel": "New Project",
189189
"idToWidget": "emptyStudyBtn"
190190
}]
191191
},

0 commit comments

Comments
 (0)