From ffc7328e13104edc681e9206512da0dbac7d8e3b Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Wed, 5 Feb 2020 14:41:53 +0530 Subject: [PATCH] Renaming isPaginated to PaginationType to support different types of pagination on the frontend If the API is paginated via the table's page number, then the next and prev URLs in the action don't play any role. Those fields are only required when the paginationType is of type URL. In all other scenarios, the action is executed normally. --- .../com/appsmith/external/models/ActionConfiguration.java | 2 +- .../java/com/appsmith/external/models/PaginationType.java | 5 +++++ .../java/com/appsmith/server/services/ActionServiceImpl.java | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/PaginationType.java diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java index beffc40e45..04ca678e68 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java @@ -28,7 +28,7 @@ public class ActionConfiguration { */ Integer timeoutInMillisecond; - Boolean isPaginated; + PaginationType paginationType = PaginationType.NONE; // API fields String path; diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/PaginationType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/PaginationType.java new file mode 100644 index 0000000000..affd772cb7 --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/PaginationType.java @@ -0,0 +1,5 @@ +package com.appsmith.external.models; + +public enum PaginationType { + NONE, PAGE_NO, URL +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java index eb7cf2a044..53c15c1549 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java @@ -4,6 +4,7 @@ import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.ActionExecutionResult; import com.appsmith.external.models.DatasourceConfiguration; import com.appsmith.external.models.PaginationField; +import com.appsmith.external.models.PaginationType; import com.appsmith.external.models.Param; import com.appsmith.external.plugins.PluginExecutor; import com.appsmith.server.constants.AnalyticsEvents; @@ -388,8 +389,8 @@ public class ActionServiceImpl extends BaseService