Skip to content

Commit 5be0c8f

Browse files
committed
NewPlusButton
1 parent e0a69be commit 5be0c8f

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2025 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
qx.Class.define("osparc.dashboard.NewPlusButton", {
19+
extend: qx.ui.form.MenuButton,
20+
21+
construct: function() {
22+
this.base(arguments);
23+
24+
this.set({
25+
appearance: "pb-new",
26+
icon: osparc.dashboard.CardBase.NEW_ICON + "26",
27+
label: this.tr("New"),
28+
font: "text-16",
29+
gap: 15,
30+
padding: 15,
31+
paddingRight: 20,
32+
allowGrowX: false,
33+
});
34+
35+
osparc.utils.Utils.setIdToWidget(this, "newStudyButton");
36+
},
37+
38+
members: {
39+
},
40+
});

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
4242
const mainLayoutWithSideSpacers = new qx.ui.container.Composite(new qx.ui.layout.HBox(spacing))
4343
this._addToMainLayout(mainLayoutWithSideSpacers);
4444

45-
this.__leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)).set({
45+
this._leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)).set({
4646
width: leftColumnWidth
4747
});
48-
mainLayoutWithSideSpacers.add(this.__leftFilters);
48+
mainLayoutWithSideSpacers.add(this._leftFilters);
4949

5050
this.__centerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(15));
5151
mainLayoutWithSideSpacers.add(this.__centerLayout);
@@ -190,7 +190,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
190190
},
191191

192192
members: {
193-
__leftFilters: null,
193+
_leftFilters: null,
194194
_resourceFilter: null,
195195
__centerLayout: null,
196196
_resourceType: null,
@@ -420,7 +420,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
420420
resourceFilter.filterChanged(filterData);
421421
});
422422

423-
this.__leftFilters.add(resourceFilter, {
423+
this._leftFilters.add(resourceFilter, {
424424
flex: 1
425425
});
426426
},

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
882882
}
883883
},
884884

885+
__addNewPlusButton: function() {
886+
const newPlusButton = new osparc.dashboard.NewPlusButton();
887+
this._leftFilters.add(newPlusButton);
888+
},
889+
885890
__addNewStudyButtons: function() {
886891
if (this.getCurrentContext() !== "studiesAndFolders") {
887892
return;
@@ -1044,6 +1049,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10441049
this.__addSortByButton();
10451050
this._addViewModeButton();
10461051

1052+
if (osparc.product.Utils.isProduct("tis") || osparc.product.Utils.isProduct("tiplite")) {
1053+
this.__addNewPlusButton();
1054+
}
1055+
10471056
this._addResourceFilter();
10481057

10491058
this.__connectContexts();

0 commit comments

Comments
 (0)