From 833dae58ce43fb44e7f377dc31ff35871f99f0bb Mon Sep 17 00:00:00 2001 From: Ainur <59531286+yagudin10@users.noreply.github.com> Date: Tue, 14 May 2024 11:31:24 +0200 Subject: [PATCH] CB-5060 add beta features config param (#2599) * CB-5109 add beta features config param * CB-5109 rename param * CB-5060 feat: disable beta features * CB-5109 add param to config file --------- Co-authored-by: Alexey Co-authored-by: kseniaguzeeva <112612526+kseniaguzeeva@users.noreply.github.com> --- .../DefaultConfiguration/cloudbeaver.conf | 3 +++ .../sample-databases/SQLiteConfiguration/cloudbeaver.conf | 3 +++ .../io/cloudbeaver/model/app/BaseWebAppConfiguration.java | 8 ++++++++ .../io.cloudbeaver.server/schema/service.core.graphqls | 1 + .../src/io/cloudbeaver/model/WebServerConfig.java | 7 +++++++ webapp/packages/core-root/src/ServerConfigResource.ts | 4 ++++ .../core-sdk/src/queries/session/serverConfig.gql | 1 + 7 files changed, 27 insertions(+) diff --git a/config/sample-databases/DefaultConfiguration/cloudbeaver.conf b/config/sample-databases/DefaultConfiguration/cloudbeaver.conf index 5d312f814a..d963e4b388 100644 --- a/config/sample-databases/DefaultConfiguration/cloudbeaver.conf +++ b/config/sample-databases/DefaultConfiguration/cloudbeaver.conf @@ -94,6 +94,9 @@ "h2:h2_embedded", "h2:h2_embedded_v2", "clickhouse:yandex_clickhouse" + ], + disabledBetaFeatures: [ + ] } diff --git a/config/sample-databases/SQLiteConfiguration/cloudbeaver.conf b/config/sample-databases/SQLiteConfiguration/cloudbeaver.conf index d7cbcc590d..4347944a9e 100644 --- a/config/sample-databases/SQLiteConfiguration/cloudbeaver.conf +++ b/config/sample-databases/SQLiteConfiguration/cloudbeaver.conf @@ -89,6 +89,9 @@ "h2:h2_embedded", "h2:h2_embedded_v2", "clickhouse:yandex_clickhouse" + ], + disabledBetaFeatures: [ + ] } diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java index f73dab7cf8..ab30ce377d 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java @@ -33,11 +33,14 @@ public abstract class BaseWebAppConfiguration implements WebAppConfiguration { protected boolean resourceManagerEnabled; protected boolean showReadOnlyConnectionInfo; protected String[] enabledFeatures; + protected String[] disabledBetaFeatures; + public BaseWebAppConfiguration() { this.plugins = new LinkedHashMap<>(); this.resourceManagerEnabled = true; this.enabledFeatures = null; + this.disabledBetaFeatures = new String[0]; this.showReadOnlyConnectionInfo = false; } @@ -46,6 +49,7 @@ public BaseWebAppConfiguration(BaseWebAppConfiguration src) { this.defaultUserTeam = src.defaultUserTeam; this.resourceManagerEnabled = src.resourceManagerEnabled; this.enabledFeatures = src.enabledFeatures; + this.disabledBetaFeatures = src.disabledBetaFeatures; this.showReadOnlyConnectionInfo = src.showReadOnlyConnectionInfo; } @@ -104,4 +108,8 @@ public void setEnabledFeatures(String[] enabledFeatures) { public boolean isShowReadOnlyConnectionInfo() { return showReadOnlyConnectionInfo; } + + public String[] getDisabledBetaFeatures() { + return disabledBetaFeatures; + } } diff --git a/server/bundles/io.cloudbeaver.server/schema/service.core.graphqls b/server/bundles/io.cloudbeaver.server/schema/service.core.graphqls index 8fac64a3b7..9aa007ffb4 100644 --- a/server/bundles/io.cloudbeaver.server/schema/service.core.graphqls +++ b/server/bundles/io.cloudbeaver.server/schema/service.core.graphqls @@ -153,6 +153,7 @@ type ServerConfig { distributed: Boolean! enabledFeatures: [ID!]! + disabledBetaFeatures: [ID!] @since(version: "24.0.5") enabledAuthProviders: [ID!]! supportedLanguages: [ ServerLanguage! ]! services: [ WebServiceConfig ] diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebServerConfig.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebServerConfig.java index c0fefa9ced..d4f09a9ce6 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebServerConfig.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebServerConfig.java @@ -21,6 +21,7 @@ import io.cloudbeaver.server.CBApplication; import io.cloudbeaver.server.CBPlatform; import io.cloudbeaver.service.security.PasswordPolicyConfiguration; +import org.jkiss.code.Nullable; import org.jkiss.dbeaver.model.meta.Property; import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings; import org.jkiss.dbeaver.registry.language.PlatformLanguageDescriptor; @@ -155,6 +156,12 @@ public String[] getEnabledFeatures() { return application.getAppConfiguration().getEnabledFeatures(); } + @Property + @Nullable + public String[] getDisabledBetaFeatures() { + return application.getAppConfiguration().getDisabledBetaFeatures(); + } + @Property public String[] getEnabledAuthProviders() { return application.getAppConfiguration().getEnabledAuthProviders(); diff --git a/webapp/packages/core-root/src/ServerConfigResource.ts b/webapp/packages/core-root/src/ServerConfigResource.ts index 840a5781d6..b8ab5c11b3 100644 --- a/webapp/packages/core-root/src/ServerConfigResource.ts +++ b/webapp/packages/core-root/src/ServerConfigResource.ts @@ -157,6 +157,10 @@ export class ServerConfigResource extends CachedDataResource