Skip to content

Commit 4628cc8

Browse files
committed
refactors statics
1 parent 8e22e11 commit 4628cc8

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

services/static-webserver/client/source/class/osparc/store/StaticInfo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ qx.Class.define("osparc.store.StaticInfo", {
7070
},
7171

7272
areLicensesEnabled: function() {
73-
const staticKey = "webserverLicenses";
74-
const licensesEnabled = this.getValue(staticKey);
75-
return Boolean(licensesEnabled);
73+
const isDisabled = osparc.utils.DisabledPlugins.isLicensesDisabled();
74+
return !isDisabled;
7675
},
7776

7877
getTrashRetentionDays: function() {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
2828
SCICRUNCH: "WEBSERVER_SCICRUNCH",
2929
VERSION_CONTROL: "WEBSERVER_VERSION_CONTROL",
3030
META_MODELING: "WEBSERVER_META_MODELING",
31+
LICENSES: "WEBSERVER_LICENSES",
3132

3233
isExportDisabled: function() {
3334
return this.__isPluginDisabled(this.EXPORT);
@@ -47,6 +48,10 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
4748
return this.__isPluginDisabled(this.META_MODELING);
4849
},
4950

51+
isLicensesDisabled: function() {
52+
return this.__isPluginDisabled(this.LICENSES);
53+
},
54+
5055
__isPluginDisabled: function(key) {
5156
const statics = osparc.store.Store.getInstance().get("statics");
5257
if (statics) {

services/web/server/src/simcore_service_webserver/licenses/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
class LicensesSettings(BaseCustomSettings):
1313
# ITIS - VIP
1414
LICENSES_ITIS_VIP: Annotated[
15-
ItisVipSettings | None, Field(description="Settings for VIP license models")
15+
ItisVipSettings | None,
16+
Field(
17+
description="Settings for VIP license models",
18+
json_schema_extra={"auto_default_from_env": True},
19+
),
1620
]
1721
LICENSES_ITIS_VIP_SYNCER_ENABLED: bool = False
1822
LICENSES_ITIS_VIP_SYNCER_PERIODICITY: datetime.timedelta = datetime.timedelta(

services/web/server/tests/unit/isolated/test_application_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_settings_to_client_statics_plugins(
8484

8585
assert settings.WEBSERVER_LOGIN
8686

87-
assert statics["webserverLicenses"] == settings.WEBSERVER_LICENSES
87+
assert "webserverLicenses" not in statics
8888

8989
assert (
9090
statics["webserverLogin"]["LOGIN_ACCOUNT_DELETION_RETENTION_DAYS"]

0 commit comments

Comments
 (0)