From 843841393582700e71d158975721124b9b9eb7f5 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Thu, 27 Mar 2025 14:09:45 +0000 Subject: [PATCH] Moved GoogleDrive settings to EEAppConfig. Bean now passing config as an object --- .../software/SPDF/EE/EEAppConfig.java | 12 +++++++++++ .../software/SPDF/config/AppConfig.java | 21 ------------------- .../resources/templates/fragments/common.html | 6 +++--- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java b/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java index f1df7d340..a83b17090 100644 --- a/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java +++ b/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java @@ -11,6 +11,7 @@ import stirling.software.SPDF.EE.KeygenLicenseVerifier.License; import stirling.software.SPDF.model.ApplicationProperties; import stirling.software.SPDF.model.ApplicationProperties.EnterpriseEdition; import stirling.software.SPDF.model.ApplicationProperties.Premium; +import stirling.software.SPDF.model.ApplicationProperties.Premium.ProFeatures.GoogleDrive; @Configuration @Order(Ordered.HIGHEST_PRECEDENCE) @@ -43,6 +44,17 @@ public class EEAppConfig { return applicationProperties.getPremium().getProFeatures().isSsoAutoLogin(); } + @Bean(name = "GoogleDriveEnabled") + public boolean googleDriveEnabled() { + return runningProOrHigher() + && applicationProperties.getPremium().getProFeatures().getGoogleDrive().isEnabled(); + } + + @Bean(name = "GoogleDriveConfig") + public GoogleDrive googleDriveConfig() { + return applicationProperties.getPremium().getProFeatures().getGoogleDrive(); + } + // TODO: Remove post migration public void migrateEnterpriseSettingsToPremium(ApplicationProperties applicationProperties) { EnterpriseEdition enterpriseEdition = applicationProperties.getEnterpriseEdition(); diff --git a/src/main/java/stirling/software/SPDF/config/AppConfig.java b/src/main/java/stirling/software/SPDF/config/AppConfig.java index 3c9f7b8b4..f741a05a4 100644 --- a/src/main/java/stirling/software/SPDF/config/AppConfig.java +++ b/src/main/java/stirling/software/SPDF/config/AppConfig.java @@ -195,25 +195,4 @@ public class AppConfig { public String uuid() { return applicationProperties.getAutomaticallyGenerated().getUUID(); } - - @Bean(name = "GoogleDriveEnabled") - public boolean googleDriveEnabled() { - return applicationProperties.getPremium().isEnabled() - && applicationProperties.getPremium().getProFeatures().getGoogleDrive().isEnabled(); - } - - @Bean(name = "GoogleDriveClientId") - public String googleDriveClientId() { - return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getClientId(); - } - - @Bean(name = "GoogleDriveApiKey") - public String googleDriveApiKey() { - return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getApiKey(); - } - - @Bean(name = "GoogleDriveAppId") - public String googleDriveAppId() { - return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getAppId(); - } } diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html index 2f95ae8b2..b0004cba2 100644 --- a/src/main/resources/templates/fragments/common.html +++ b/src/main/resources/templates/fragments/common.html @@ -268,9 +268,9 @@