Skip to content

Commit

Permalink
Reduce pager page link maximum from 11 -> 7
Browse files Browse the repository at this point in the history
  • Loading branch information
djjuhasz committed Oct 9, 2024
1 parent 2124363 commit 2297a7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions dashboard/src/stores/__tests__/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe("usePackageStore", () => {
});
packageStore.updatePager;
expect(packageStore.pager).toEqual(<Pager>{
maxPages: 11,
maxPages: 7,
current: 4,
first: 1,
last: 7,
Expand All @@ -285,25 +285,25 @@ describe("usePackageStore", () => {
});
packageStore.updatePager;
expect(packageStore.pager).toEqual(<Pager>{
maxPages: 11,
maxPages: 7,
current: 9,
first: 4,
last: 14,
first: 6,
last: 12,
total: 29,
pages: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
pages: [6, 7, 8, 9, 10, 11, 12],
});

packageStore.$patch((state) => {
state.page = { limit: 20, offset: 540, total: 573 };
});
packageStore.updatePager;
expect(packageStore.pager).toEqual(<Pager>{
maxPages: 11,
maxPages: 7,
current: 28,
first: 19,
first: 23,
last: 29,
total: 29,
pages: [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
pages: [23, 24, 25, 26, 27, 28, 29],
});
});
});
2 changes: 1 addition & 1 deletion dashboard/src/stores/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const usePackageStore = defineStore("package", {
page: { limit: 20 } as api.EnduroPage,

// Pager contains a list of pages numbers to show in the pager.
pager: { maxPages: 11 } as Pager,
pager: { maxPages: 7 } as Pager,

// User-interface interactions between components.
ui: {
Expand Down

0 comments on commit 2297a7f

Please sign in to comment.