diff --git a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js index ce42e27e10d..a5904fda2a6 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -100,9 +100,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { initResources: function() { this._resourcesList = []; const promises = [ - this.__getActiveStudy(), - osparc.store.Folders.getInstance().fetchFolders(null) + this.__getActiveStudy() ]; + if (osparc.utils.DisabledPlugins.isFoldersEnabled()) { + promises.push(osparc.store.Folders.getInstance().fetchFolders()); + } Promise.all(promises) .then(() => { this.getChildControl("resources-layout"); @@ -182,11 +184,14 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { // Most probably is a product-stranger user (it can also be that the catalog is down) const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0; if (nStudies === 0) { - Promise.all([ + const promises = [ osparc.store.Store.getInstance().getTemplates(), osparc.service.Store.getServicesLatest(), - osparc.store.Folders.getInstance().fetchFolders(), - ]).then(values => { + ]; + if (osparc.utils.DisabledPlugins.isFoldersEnabled()) { + promises.push(osparc.store.Folders.getInstance().fetchFolders()); + } + Promise.all(promises).then(values => { const templates = values[0]; const services = values[1]; if (templates.length === 0 && Object.keys(services).length === 0) { @@ -388,15 +393,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }, __applyCurrentFolderId: function(currentFolderId) { - osparc.store.Folders.getInstance().fetchFolders(currentFolderId) - .then(() => { - this._resourcesContainer.setResourcesToList([]); - this._resourcesList = []; - this.invalidateStudies(); - - this.__reloadResources(); - }) - .catch(console.error); + if (osparc.utils.DisabledPlugins.isFoldersEnabled()) { + osparc.store.Folders.getInstance().fetchFolders(currentFolderId) + .then(() => { + this._resourcesContainer.setResourcesToList([]); + this._resourcesList = []; + this.invalidateStudies(); + + this.__reloadResources(); + }) + .catch(console.error); + } }, _folderUpdated: function() { diff --git a/services/static-webserver/client/source/class/osparc/store/Folders.js b/services/static-webserver/client/source/class/osparc/store/Folders.js index cd942578047..5b3459852b9 100644 --- a/services/static-webserver/client/source/class/osparc/store/Folders.js +++ b/services/static-webserver/client/source/class/osparc/store/Folders.js @@ -29,6 +29,12 @@ qx.Class.define("osparc.store.Folders", { foldersCached: null, fetchFolders: function(folderId = null) { + if (osparc.auth.Data.getInstance().isGuest()) { + return new Promise(resolve => { + resolve([]); + }); + } + const params = { "url": { folderId diff --git a/services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js b/services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js index 0b250d0d7db..e9e955b1ba9 100644 --- a/services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js +++ b/services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js @@ -29,9 +29,10 @@ qx.Class.define("osparc.utils.DisabledPlugins", { VERSION_CONTROL: "WEBSERVER_VERSION_CONTROL", META_MODELING: "WEBSERVER_META_MODELING", CLUSTERS: "WEBSERVER_CLUSTERS", + FOLDERS: "WEBSERVER_FOLDERS", isFoldersEnabled: function() { - return osparc.utils.Utils.isDevelopmentPlatform(); + return !this.__isPluginDisabled(this.FOLDERS); }, isExportDisabled: function() { diff --git a/services/web/server/src/simcore_service_webserver/application_settings.py b/services/web/server/src/simcore_service_webserver/application_settings.py index 29ee0817c61..00804af2155 100644 --- a/services/web/server/src/simcore_service_webserver/application_settings.py +++ b/services/web/server/src/simcore_service_webserver/application_settings.py @@ -317,6 +317,7 @@ def _get_disabled_public_plugins(self) -> list[str]: public_plugin_candidates: Final = { "WEBSERVER_CLUSTERS", "WEBSERVER_EXPORTER", + "WEBSERVER_FOLDERS", "WEBSERVER_META_MODELING", "WEBSERVER_PAYMENTS", "WEBSERVER_SCICRUNCH", diff --git a/services/web/server/tests/unit/isolated/test_application_settings.py b/services/web/server/tests/unit/isolated/test_application_settings.py index 3a17debb0e9..8300fc3a73c 100644 --- a/services/web/server/tests/unit/isolated/test_application_settings.py +++ b/services/web/server/tests/unit/isolated/test_application_settings.py @@ -216,6 +216,9 @@ def test_settings_to_client_statics_plugins( monkeypatch.setenv("WEBSERVER_VERSION_CONTROL", "0") disable_plugins.add("WEBSERVER_VERSION_CONTROL") + monkeypatch.setenv("WEBSERVER_FOLDERS", "0") + disable_plugins.add("WEBSERVER_FOLDERS") + settings = ApplicationSettings.create_from_envs() statics = settings.to_client_statics()