Skip to content

Commit 65ccb8d

Browse files
committed
FOLDERS always enabled
1 parent ac272b0 commit 65ccb8d

File tree

5 files changed

+101
-118
lines changed

5 files changed

+101
-118
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
3535
if (resourceType === "study") {
3636
const workspacesContainer = this.__workspacesContainer = new osparc.dashboard.ToggleButtonContainer();
3737
this._add(workspacesContainer);
38-
workspacesContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");
3938

4039
const foldersContainer = this.__foldersContainer = new osparc.dashboard.ToggleButtonContainer();
4140
this._add(foldersContainer);
42-
foldersContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");
4341
}
4442

4543
const nonGroupedContainer = this.__nonGroupedContainer = this.__createFlatList();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
4949
__serviceTypeButtons: null,
5050

5151
__buildLayout: function() {
52-
if (this.__resourceType === "study" && osparc.utils.DisabledPlugins.isFoldersEnabled()) {
52+
if (this.__resourceType === "study") {
5353
this._add(this.__createWorkspacesAndFoldersTree());
5454
this._add(this.__createTrashBin());
5555
} else {

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

Lines changed: 99 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
166166
__reloadWorkspaces: function() {
167167
if (
168168
!osparc.auth.Manager.getInstance().isLoggedIn() ||
169-
!osparc.utils.DisabledPlugins.isFoldersEnabled() ||
170169
this.getCurrentContext() === "studiesAndFolders" ||
171170
this.getCurrentContext() === "search" || // not yet implemented for workspaces
172171
this.__loadingWorkspaces
@@ -212,7 +211,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
212211
__reloadFolders: function() {
213212
if (
214213
!osparc.auth.Manager.getInstance().isLoggedIn() ||
215-
!osparc.utils.DisabledPlugins.isFoldersEnabled() ||
216214
this.getCurrentContext() === "workspaces" ||
217215
this.__loadingFolders
218216
) {
@@ -996,11 +994,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
996994
_createLayout: function() {
997995
this._createSearchBar();
998996

999-
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
1000-
const header = this.__header = new osparc.dashboard.StudyBrowserHeader();
1001-
this.__header.addListener("emptyTrashRequested", () => this.__emptyTrash(), this);
1002-
this._addToLayout(header);
1003-
}
997+
const header = this.__header = new osparc.dashboard.StudyBrowserHeader();
998+
this.__header.addListener("emptyTrashRequested", () => this.__emptyTrash(), this);
999+
this._addToLayout(header);
10041000

10051001
this._createResourcesLayout("studiesList");
10061002

@@ -1074,112 +1070,108 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10741070
},
10751071

10761072
__connectContexts: function() {
1077-
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
1078-
const header = this.__header;
1079-
header.addListener("locationChanged", () => {
1080-
const workspaceId = header.getCurrentWorkspaceId();
1081-
const folderId = header.getCurrentFolderId();
1082-
this._changeContext("studiesAndFolders", workspaceId, folderId);
1083-
}, this);
1073+
const header = this.__header;
1074+
header.addListener("locationChanged", () => {
1075+
const workspaceId = header.getCurrentWorkspaceId();
1076+
const folderId = header.getCurrentFolderId();
1077+
this._changeContext("studiesAndFolders", workspaceId, folderId);
1078+
}, this);
10841079

1085-
const workspacesAndFoldersTree = this._resourceFilter.getWorkspacesAndFoldersTree();
1086-
workspacesAndFoldersTree.addListener("locationChanged", e => {
1087-
const context = e.getData();
1088-
const workspaceId = context["workspaceId"];
1089-
if (workspaceId === -1) {
1090-
this._changeContext("workspaces");
1091-
} else {
1092-
const folderId = context["folderId"];
1093-
this._changeContext("studiesAndFolders", workspaceId, folderId);
1094-
}
1095-
}, this);
1080+
const workspacesAndFoldersTree = this._resourceFilter.getWorkspacesAndFoldersTree();
1081+
workspacesAndFoldersTree.addListener("locationChanged", e => {
1082+
const context = e.getData();
1083+
const workspaceId = context["workspaceId"];
1084+
if (workspaceId === -1) {
1085+
this._changeContext("workspaces");
1086+
} else {
1087+
const folderId = context["folderId"];
1088+
this._changeContext("studiesAndFolders", workspaceId, folderId);
1089+
}
1090+
}, this);
10961091

1097-
this._resourceFilter.addListener("trashContext", () => {
1098-
this._changeContext("trash");
1099-
});
1092+
this._resourceFilter.addListener("trashContext", () => {
1093+
this._changeContext("trash");
1094+
});
11001095

1101-
this._searchBarFilter.addListener("filterChanged", e => {
1102-
const filterData = e.getData();
1103-
if (filterData.text) {
1104-
this._changeContext("search");
1105-
} else {
1106-
const workspaceId = this.getCurrentWorkspaceId();
1107-
const folderId = this.getCurrentFolderId();
1108-
this._changeContext("studiesAndFolders", workspaceId, folderId);
1109-
}
1110-
});
1111-
}
1096+
this._searchBarFilter.addListener("filterChanged", e => {
1097+
const filterData = e.getData();
1098+
if (filterData.text) {
1099+
this._changeContext("search");
1100+
} else {
1101+
const workspaceId = this.getCurrentWorkspaceId();
1102+
const folderId = this.getCurrentFolderId();
1103+
this._changeContext("studiesAndFolders", workspaceId, folderId);
1104+
}
1105+
});
11121106
},
11131107

11141108
_changeContext: function(context, workspaceId = null, folderId = null) {
1115-
if (osparc.utils.DisabledPlugins.isFoldersEnabled()) {
1116-
if (
1117-
context !== "search" && // reload studies for a new search
1118-
context === this.getCurrentContext() &&
1119-
workspaceId === this.getCurrentWorkspaceId() &&
1120-
folderId === this.getCurrentFolderId()
1121-
) {
1122-
// didn't really change
1123-
return;
1124-
}
1125-
1126-
osparc.store.Store.getInstance().setStudyBrowserContext(context);
1127-
this.set({
1128-
currentContext: context,
1129-
currentWorkspaceId: workspaceId,
1130-
currentFolderId: folderId,
1131-
});
1132-
this.resetSelection();
1133-
this.setMultiSelection(false);
1109+
if (
1110+
context !== "search" && // reload studies for a new search
1111+
context === this.getCurrentContext() &&
1112+
workspaceId === this.getCurrentWorkspaceId() &&
1113+
folderId === this.getCurrentFolderId()
1114+
) {
1115+
// didn't really change
1116+
return;
1117+
}
11341118

1135-
// reset lists
1136-
this.__setWorkspacesToList([]);
1137-
this.__setFoldersToList([]);
1138-
this._resourcesList = [];
1139-
this._resourcesContainer.setResourcesToList(this._resourcesList);
1140-
this._resourcesContainer.reloadCards("studies");
1141-
1142-
this._toolbar.show();
1143-
switch (this.getCurrentContext()) {
1144-
case "studiesAndFolders":
1145-
this._searchBarFilter.resetFilters();
1146-
this.__reloadFolders();
1147-
this._loadingResourcesBtn.setFetching(false);
1148-
this.invalidateStudies();
1149-
this.__reloadStudies();
1150-
break;
1151-
case "workspaces":
1152-
this._toolbar.exclude();
1153-
this._searchBarFilter.resetFilters();
1154-
this.__reloadWorkspaces();
1155-
break;
1156-
case "search":
1157-
this.__reloadWorkspaces();
1158-
this.__reloadFolders();
1159-
this._loadingResourcesBtn.setFetching(false);
1160-
this.invalidateStudies();
1161-
this.__reloadStudies();
1162-
break;
1163-
case "trash":
1164-
this._searchBarFilter.resetFilters();
1165-
this.__reloadWorkspaces();
1166-
this.__reloadFolders();
1167-
this._loadingResourcesBtn.setFetching(false);
1168-
this.invalidateStudies();
1169-
this.__reloadStudies();
1170-
break;
1171-
}
1119+
osparc.store.Store.getInstance().setStudyBrowserContext(context);
1120+
this.set({
1121+
currentContext: context,
1122+
currentWorkspaceId: workspaceId,
1123+
currentFolderId: folderId,
1124+
});
1125+
this.resetSelection();
1126+
this.setMultiSelection(false);
11721127

1173-
// notify header
1174-
const header = this.__header;
1175-
header.set({
1176-
currentWorkspaceId: workspaceId,
1177-
currentFolderId: folderId,
1178-
});
1128+
// reset lists
1129+
this.__setWorkspacesToList([]);
1130+
this.__setFoldersToList([]);
1131+
this._resourcesList = [];
1132+
this._resourcesContainer.setResourcesToList(this._resourcesList);
1133+
this._resourcesContainer.reloadCards("studies");
11791134

1180-
// notify Filters on the left
1181-
this._resourceFilter.contextChanged(context, workspaceId, folderId);
1135+
this._toolbar.show();
1136+
switch (this.getCurrentContext()) {
1137+
case "studiesAndFolders":
1138+
this._searchBarFilter.resetFilters();
1139+
this.__reloadFolders();
1140+
this._loadingResourcesBtn.setFetching(false);
1141+
this.invalidateStudies();
1142+
this.__reloadStudies();
1143+
break;
1144+
case "workspaces":
1145+
this._toolbar.exclude();
1146+
this._searchBarFilter.resetFilters();
1147+
this.__reloadWorkspaces();
1148+
break;
1149+
case "search":
1150+
this.__reloadWorkspaces();
1151+
this.__reloadFolders();
1152+
this._loadingResourcesBtn.setFetching(false);
1153+
this.invalidateStudies();
1154+
this.__reloadStudies();
1155+
break;
1156+
case "trash":
1157+
this._searchBarFilter.resetFilters();
1158+
this.__reloadWorkspaces();
1159+
this.__reloadFolders();
1160+
this._loadingResourcesBtn.setFetching(false);
1161+
this.invalidateStudies();
1162+
this.__reloadStudies();
1163+
break;
11821164
}
1165+
1166+
// notify header
1167+
const header = this.__header;
1168+
header.set({
1169+
currentWorkspaceId: workspaceId,
1170+
currentFolderId: folderId,
1171+
});
1172+
1173+
// notify Filters on the left
1174+
this._resourceFilter.contextChanged(context, workspaceId, folderId);
11831175
},
11841176

11851177
__addSortByButton: function() {
@@ -1565,13 +1557,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
15651557
menu.add(billingsSettingsButton);
15661558
}
15671559

1568-
if (writeAccess && osparc.utils.DisabledPlugins.isFoldersEnabled()) {
1569-
menu.addSeparator();
1560+
menu.addSeparator();
15701561

1571-
const moveToButton = this.__getMoveStudyToMenuButton(studyData);
1572-
if (moveToButton) {
1573-
menu.add(moveToButton);
1574-
}
1562+
const moveToButton = this.__getMoveStudyToMenuButton(studyData);
1563+
if (moveToButton) {
1564+
menu.add(moveToButton);
15751565
}
15761566

15771567
if (deleteAccess) {

services/static-webserver/client/source/class/osparc/info/StudyLarge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ qx.Class.define("osparc.info.StudyLarge", {
189189
};
190190
}
191191

192-
if (osparc.utils.DisabledPlugins.isFoldersEnabled() && !this.__isTemplate) {
192+
if (!this.__isTemplate) {
193193
const pathLabel = new qx.ui.basic.Label();
194194
pathLabel.setValue(this.getStudy().getLocationString());
195195
extraInfo["LOCATION"] = {

services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
2929
VERSION_CONTROL: "WEBSERVER_VERSION_CONTROL",
3030
META_MODELING: "WEBSERVER_META_MODELING",
3131
CLUSTERS: "WEBSERVER_CLUSTERS",
32-
FOLDERS: "WEBSERVER_FOLDERS",
33-
34-
isFoldersEnabled: function() {
35-
return !this.__isPluginDisabled(this.FOLDERS);
36-
},
3732

3833
isExportDisabled: function() {
3934
return this.__isPluginDisabled(this.EXPORT);

0 commit comments

Comments
 (0)