diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/AppendMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/AppendMethod.java index d5ee54eed9..50f5f84535 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/AppendMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/AppendMethod.java @@ -37,7 +37,7 @@ public class AppendMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkAppendMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkAppendMethod.java index 0b898f18fa..66c2d30842 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkAppendMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkAppendMethod.java @@ -38,7 +38,7 @@ public class BulkAppendMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkUpdateMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkUpdateMethod.java index e0e8737e79..1d1830e26e 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkUpdateMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/BulkUpdateMethod.java @@ -38,7 +38,7 @@ public class BulkUpdateMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/ClearMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/ClearMethod.java index 069c1afa0f..a232cceb5b 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/ClearMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/ClearMethod.java @@ -22,7 +22,7 @@ public class ClearMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSpreadsheetRange() == null || methodConfig.getSpreadsheetRange().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Data Range"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/CopyMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/CopyMethod.java index 1c90da56d4..4b60e3f012 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/CopyMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/CopyMethod.java @@ -22,7 +22,7 @@ public class CopyMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetId() == null || methodConfig.getSheetId().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet Id"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteRowMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteRowMethod.java index d3f51c4735..003bee6b8d 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteRowMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteRowMethod.java @@ -30,7 +30,7 @@ public class DeleteRowMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteSheetMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteSheetMethod.java index 5651ef5a20..ef2ab8ba42 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteSheetMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/DeleteSheetMethod.java @@ -32,7 +32,7 @@ public class DeleteSheetMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (GoogleSheets.SHEET.equalsIgnoreCase(methodConfig.getDeleteFormat())) { if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetValuesMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetValuesMethod.java index c0aa5f51cb..992ec87379 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetValuesMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetValuesMethod.java @@ -33,14 +33,21 @@ public class GetValuesMethod implements Method { this.objectMapper = objectMapper; } + // Used to capture the range of columns in this request. The handling for this regex makes sure that + // all possible combinations of A1 notation for a range map to a common format Pattern findAllRowsPattern = Pattern.compile("([a-zA-Z]*)\\d*:([a-zA-Z]*)\\d*"); + + // The starting row for a range is captured using this pattern to find its relative index from table heading Pattern findOffsetRowPattern = Pattern.compile("(\\d+):"); + + // Since the value for this pattern is coming from an API response, it also contains the sheet name + // We use this pattern to retrieve only range information Pattern sheetRangePattern = Pattern.compile(".*!([a-zA-Z]*)\\d*:([a-zA-Z]*)\\d*"); @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name"); diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/InfoMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/InfoMethod.java index 14fd0f25b5..ec85c1ebe6 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/InfoMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/InfoMethod.java @@ -23,7 +23,7 @@ public class InfoMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } return true; diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/UpdateMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/UpdateMethod.java index 2c125b9f75..9bb5104a0d 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/UpdateMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/UpdateMethod.java @@ -35,7 +35,7 @@ public class UpdateMethod implements Method { @Override public boolean validateMethodRequest(MethodConfig methodConfig) { if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) { - throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Id"); + throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url"); } if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) { throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");