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.
This commit is contained in:
Arpit Mohan 2020-02-05 14:41:53 +05:30
parent ec07fb5162
commit ffc7328e13
3 changed files with 9 additions and 3 deletions

View File

@ -28,7 +28,7 @@ public class ActionConfiguration {
*/
Integer timeoutInMillisecond;
Boolean isPaginated;
PaginationType paginationType = PaginationType.NONE;
// API fields
String path;

View File

@ -0,0 +1,5 @@
package com.appsmith.external.models;
public enum PaginationType {
NONE, PAGE_NO, URL
}

View File

@ -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<ActionRepository, Action, Str
// If the action is paginated, update the configurations to update the correct URL.
if (action.getActionConfiguration() != null &&
action.getActionConfiguration().getIsPaginated() != null &&
action.getActionConfiguration().getIsPaginated() &&
action.getActionConfiguration().getPaginationType() != null &&
PaginationType.URL.equals(action.getActionConfiguration().getPaginationType()) &&
executeActionDTO.getPaginationField() != null) {
datasourceConfiguration = updateDatasourceConfigurationForPagination(actionConfigurationTemp, datasourceConfigurationTemp, executeActionDTO.getPaginationField());
actionConfiguration = updateActionConfigurationForPagination(actionConfigurationTemp, executeActionDTO.getPaginationField());