From 32187defe74043f6dbe8d0511c5eef4b2cecbb83 Mon Sep 17 00:00:00 2001 From: sondermanish Date: Wed, 11 Sep 2024 23:44:04 +0530 Subject: [PATCH] added changes --- .../external/models/DatasourceConfiguration.java | 2 ++ .../server/migrations/MigrationHelperMethods.java | 10 +++++++--- .../migrations/utils/JsonSchemaMigrationHelper.java | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DatasourceConfiguration.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DatasourceConfiguration.java index 5a81b66b730..637879eb75b 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DatasourceConfiguration.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DatasourceConfiguration.java @@ -34,8 +34,10 @@ public class DatasourceConfiguration implements AppsmithDomain { @JsonView({Views.Public.class, FromRequest.class}) AuthenticationDTO authentication; + @JsonView({Views.Public.class, FromRequest.class}) SSHConnection sshProxy; + @JsonView({Views.Public.class, FromRequest.class}) Boolean sshProxyEnabled; @JsonView({Views.Public.class, FromRequest.class, Git.class}) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java index f5e69fb04b6..277a3ac5768 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java @@ -1237,7 +1237,7 @@ public static void setThemeSettings(Application.ThemeSetting themeSetting) { } } - public static boolean conditionForDefaultRestDatasourceMigration(NewAction action) { + public static boolean conditionForDefaultRestDatasource(NewAction action) { if (action.getUnpublishedAction() == null || action.getUnpublishedAction().getDatasource() == null) { return false; @@ -1259,8 +1259,12 @@ public static boolean conditionForDefaultRestDatasourceMigration(NewAction actio // Two separate types of checks over here, it's either the obvious certain way to identify or // the likely chance that the datasource is present. - boolean isActionDefaultRestDatasource = - certainCheckForDefaultRestDatasource || probableCheckForDefaultRestDatasource; + return certainCheckForDefaultRestDatasource || probableCheckForDefaultRestDatasource; + } + + private static boolean conditionForDefaultRestDatasourceMigration(NewAction action) { + boolean isActionDefaultRestDatasource = conditionForDefaultRestDatasource(action); + Datasource actionDatasource = action.getUnpublishedAction().getDatasource(); // condition to check if the action has missing url or has no config at all boolean isDatasourceConfigurationOrUrlMissing = actionDatasource.getDatasourceConfiguration() == null diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/utils/JsonSchemaMigrationHelper.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/utils/JsonSchemaMigrationHelper.java index e6442a7991d..dc7a3d95d8b 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/utils/JsonSchemaMigrationHelper.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/utils/JsonSchemaMigrationHelper.java @@ -44,7 +44,7 @@ public Mono addDatasourceConfigurationToDefaultRestApiActions( return newActionService .findAllByApplicationIdAndViewMode( branchedApplication.getId(), Boolean.FALSE, Optional.empty(), Optional.empty()) - .filter(MigrationHelperMethods::conditionForDefaultRestDatasourceMigration) + .filter(MigrationHelperMethods::conditionForDefaultRestDatasource) .collectMap(NewAction::getGitSyncId); }) .map(newActionMap -> {