Skip to content

Commit d993cc4

Browse files
committed
[skip ci] connect Tutorials and Service buttons
1 parent a57a0f7 commit d993cc4

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
400400
width: this.self().SIDE_SPACER_WIDTH
401401
});
402402

403+
resourceFilter.addListener("changeTab", e => {
404+
const contextTab = e.getData();
405+
this.fireDataEvent("changeTab", contextTab);
406+
}, this);
407+
403408
resourceFilter.addListener("changeSharedWith", e => {
404409
const sharedWith = e.getData();
405410
this._searchBarFilter.setSharedWithActiveFilter(sharedWith.id, sharedWith.label);

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

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

3636
events: {
3737
"trashContext": "qx.event.type.Event",
38-
"templatesContext": "qx.event.type.Event",
39-
"servicesContext": "qx.event.type.Event",
38+
"changeTab": "qx.event.type.Data",
4039
"trashStudyRequested": "qx.event.type.Data",
4140
"trashFolderRequested": "qx.event.type.Data",
4241
"changeSharedWith": "qx.event.type.Data",
@@ -89,8 +88,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
8988
this.__workspacesAndFoldersTree.contextChanged(context);
9089

9190
this.__trashButton.setValue(context === "trash");
92-
this.__templatesButton.setValue(context === "templates");
93-
this.__servicesButton.setValue(context === "services");
9491
},
9592

9693
/* WORKSPACES AND FOLDERS */
@@ -224,38 +221,26 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
224221
firstUpperCase: true,
225222
plural: true
226223
});
227-
const templatesButton = this.__templatesButton = new qx.ui.toolbar.RadioButton().set({
228-
value: false,
224+
const templatesButton = new qx.ui.toolbar.Button().set({
229225
appearance: "filter-toggle-button",
230226
label: templateAlias,
231227
icon: "@FontAwesome5Solid/copy/16",
232228
paddingLeft: 10, // align it with the context
233229
});
234230
osparc.utils.Utils.setIdToWidget(templatesButton, "templatesTabBtn");
235-
templatesButton.addListener("changeValue", e => {
236-
const trashEnabled = e.getData();
237-
if (trashEnabled) {
238-
this.fireEvent("templatesContext");
239-
}
240-
});
231+
templatesButton.addListener("tap", () => this.fireDataEvent("changeTab", "templatesTab"));
241232
return templatesButton;
242233
},
243234

244235
__createServices: function() {
245-
const servicesButton = this.__servicesButton = new qx.ui.toolbar.RadioButton().set({
246-
value: false,
236+
const servicesButton = new qx.ui.toolbar.Button().set({
247237
appearance: "filter-toggle-button",
248238
label: this.tr("Services"),
249239
icon: "@FontAwesome5Solid/cogs/16",
250240
paddingLeft: 10, // align it with the context
251241
});
252242
osparc.utils.Utils.setIdToWidget(servicesButton, "servicesTabBtn");
253-
servicesButton.addListener("changeValue", e => {
254-
const trashEnabled = e.getData();
255-
if (trashEnabled) {
256-
this.fireEvent("servicesContext");
257-
}
258-
});
243+
servicesButton.addListener("tap", () => this.fireDataEvent("changeTab", "servicesTab"));
259244
return servicesButton;
260245
},
261246

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"category": "osparc",
148148
"resourceType": "study",
149149
"icon": "@FontAwesome5Solid/file/18",
150-
"title": "Pipeline",
150+
"title": "Empty Pipeline",
151151
"newStudyLabel": "New Project",
152152
"idToWidget": "emptyStudyBtn"
153153
}]
@@ -184,7 +184,7 @@
184184
"category": "osparc",
185185
"resourceType": "study",
186186
"icon": "@FontAwesome5Solid/file/18",
187-
"title": "Pipeline",
187+
"title": "Empty Pipeline",
188188
"newStudyLabel": "New Project",
189189
"idToWidget": "emptyStudyBtn"
190190
}]

0 commit comments

Comments
 (0)