Repository: provectus/kafka-ui
Issue: Default pagination for backend and frontend are different.
Labels: type/bug

**Describe the bug**

Default pagination for backend is 20:
```java
	private static final Integer DEFAULT_PAGE_SIZE = 20;
```
Default pagination for fronted is 25:
```ts
	export const PER_PAGE = 25;
```
This result in this behavior:
1.	When you first open the topics list in the browser you get 20 topics (1…20)
2.	When you click the “Next page” you get 25 topics from 25 to 50
3.	If you want to see topics 21...25 you need to click “Previous” to see them
4.	If you happen to have 21...25 topics the next page is empty

**Set up**
docker master image

**Expected behavior**
Default pagination for backend and frontend should be same.



Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
index 63dd249200b..26285840461 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
@@ -43,7 +43,7 @@
 @Service
 @RequiredArgsConstructor
 public class ClusterService {
-  private static final Integer DEFAULT_PAGE_SIZE = 20;
+  private static final Integer DEFAULT_PAGE_SIZE = 25;
 
   private final ClustersStorage clustersStorage;
   private final ClusterMapper clusterMapper;


Test patch:
diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ClusterServiceTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ClusterServiceTest.java
index 76e3e79944d..4f27026d2da 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ClusterServiceTest.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ClusterServiceTest.java
@@ -33,7 +33,7 @@ class ClusterServiceTest {
   private ClustersStorage clustersStorage;
 
   @Test
-  public void shouldListFirst20Topics() {
+  public void shouldListFirst25Topics() {
     var topicName = UUID.randomUUID().toString();
 
     when(clustersStorage.getClusterByName(topicName))
@@ -51,8 +51,8 @@ public void shouldListFirst20Topics() {
     var topics = clusterService.getTopics(topicName,
         Optional.empty(), Optional.empty(), Optional.empty(),
         Optional.empty(), Optional.empty());
-    assertThat(topics.getPageCount()).isEqualTo(5);
-    assertThat(topics.getTopics()).hasSize(20);
+    assertThat(topics.getPageCount()).isEqualTo(4);
+    assertThat(topics.getTopics()).hasSize(25);
     assertThat(topics.getTopics()).map(Topic::getName).isSorted();
   }
 
@@ -97,8 +97,8 @@ public void shouldCorrectlyHandleNonPositivePageNumberAndPageSize() {
 
     var topics = clusterService.getTopics(topicName, Optional.of(0), Optional.of(-1),
         Optional.empty(), Optional.empty(), Optional.empty());
-    assertThat(topics.getPageCount()).isEqualTo(5);
-    assertThat(topics.getTopics()).hasSize(20);
+    assertThat(topics.getPageCount()).isEqualTo(4);
+    assertThat(topics.getTopics()).hasSize(25);
     assertThat(topics.getTopics()).map(Topic::getName).isSorted();
   }
 
@@ -122,8 +122,8 @@ public void shouldListBotInternalAndNonInternalTopics() {
     var topics = clusterService.getTopics(topicName,
         Optional.empty(), Optional.empty(), Optional.of(true),
         Optional.empty(), Optional.empty());
-    assertThat(topics.getPageCount()).isEqualTo(5);
-    assertThat(topics.getTopics()).hasSize(20);
+    assertThat(topics.getPageCount()).isEqualTo(4);
+    assertThat(topics.getTopics()).hasSize(25);
     assertThat(topics.getTopics()).map(Topic::getName).isSorted();
   }
 
@@ -148,8 +148,8 @@ public void shouldListOnlyNonInternalTopics() {
     var topics = clusterService.getTopics(topicName,
         Optional.empty(), Optional.empty(), Optional.of(true),
         Optional.empty(), Optional.empty());
-    assertThat(topics.getPageCount()).isEqualTo(5);
-    assertThat(topics.getTopics()).hasSize(20);
+    assertThat(topics.getPageCount()).isEqualTo(4);
+    assertThat(topics.getTopics()).hasSize(25);
     assertThat(topics.getTopics()).map(Topic::getName).isSorted();
   }
 
@@ -198,8 +198,8 @@ public void shouldListTopicsOrderedByPartitionsCount() {
     var topics = clusterService.getTopics(topicName,
         Optional.empty(), Optional.empty(), Optional.empty(),
         Optional.empty(), Optional.of(TopicColumnsToSort.TOTAL_PARTITIONS));
-    assertThat(topics.getPageCount()).isEqualTo(5);
-    assertThat(topics.getTopics()).hasSize(20);
+    assertThat(topics.getPageCount()).isEqualTo(4);
+    assertThat(topics.getTopics()).hasSize(25);
     assertThat(topics.getTopics()).map(Topic::getPartitionCount).isSorted();
   }
 }