From 055cbf3c958a24f7c92f9931e612aefd45d0677e Mon Sep 17 00:00:00 2001 From: Teisha McRae Date: Wed, 28 Oct 2026 17:42:32 -0400 Subject: [PATCH 1/3] Avoid redundant pagination fetches This patch updates the pagination UI to visually mark disabled controls and prevents hover styling from overriding the disabled state. In the datatable mixin, navigation events now skip fetches when the page is already at the first/last value or has not changed, avoiding unnecessary requests and duplicate refreshes. --- resources/js/components/common/Pagination.vue | 4 ++++ resources/js/components/common/mixins/datatable.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/resources/js/components/common/Pagination.vue b/resources/js/components/common/Pagination.vue index ce77a9f252..47854722bb 100644 --- a/resources/js/components/common/Pagination.vue +++ b/resources/js/components/common/Pagination.vue @@ -123,10 +123,14 @@ export default { } &.disabled { cursor: not-allowed; + opacity: 0.5 !important; } &:hover { background-color: white; } + &:hover.disabled { + background-color: #f7f9fb; + } } .pagination-nav-drop { width: 40px; diff --git a/resources/js/components/common/mixins/datatable.js b/resources/js/components/common/mixins/datatable.js index 45521acb4d..d755c0892f 100644 --- a/resources/js/components/common/mixins/datatable.js +++ b/resources/js/components/common/mixins/datatable.js @@ -117,6 +117,7 @@ export default { }, // Handler to change the page based on events fired from our pagination component onPageChange(page) { + const previousPage = this.page; if (page === "next") { this.page += 1; } else if (page === "prev") { @@ -130,6 +131,10 @@ export default { if (this.page > this.data.meta.last_page) { this.page = this.data.meta.last_page; } + // Skip fetch when nav is disabled (already on first/last) or page is unchanged + if (this.page === previousPage) { + return; + } this.fetch(); }, }, From 999550d881f86db60ac630f3aa7efc2645976de6 Mon Sep 17 00:00:00 2001 From: Teisha McRae Date: Thu, 29 Oct 2026 15:37:18 -0400 Subject: [PATCH 2/3] Avoid redundant auth client page fetches --- .../js/admin/auth-clients/components/AuthClientsListing.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/js/admin/auth-clients/components/AuthClientsListing.vue b/resources/js/admin/auth-clients/components/AuthClientsListing.vue index 6b55bcfa32..047a923fd7 100644 --- a/resources/js/admin/auth-clients/components/AuthClientsListing.vue +++ b/resources/js/admin/auth-clients/components/AuthClientsListing.vue @@ -148,6 +148,7 @@ export default { this.fetch(); }, onPageChange(page) { + const previousPage = this.page; if (page == "next") { this.page = this.page + 1; } else if (page == "prev") { @@ -162,6 +163,10 @@ export default { if (this.page > meta.last_page) { this.page = meta.last_page; } + // Skip fetch when nav is disabled (already on first/last) or page is unchanged + if (this.page === previousPage) { + return; + } this.fetch(); }, onNavigate(action, data) { From a4d673f4d2ff29018db15d5fb701b8c2242a7475 Mon Sep 17 00:00:00 2001 From: Teisha McRae Date: Fri, 30 Oct 2026 16:02:06 -0400 Subject: [PATCH 3/3] Refresh listings after archive/delete Added a shared refreshListing helper to reset the datatable page and refetch data after mutation actions. Updated archive and delete flows in process navigation and template listings to use it instead of directly calling pagination.loadPage(1), which could skip the fetch when already on page 1. --- resources/js/components/common/mixins/datatable.js | 6 ++++++ resources/js/components/shared/processNavigation.js | 2 +- .../js/templates/components/ProcessTemplatesListing.vue | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/js/components/common/mixins/datatable.js b/resources/js/components/common/mixins/datatable.js index d755c0892f..069079fcc1 100644 --- a/resources/js/components/common/mixins/datatable.js +++ b/resources/js/components/common/mixins/datatable.js @@ -137,6 +137,12 @@ export default { } this.fetch(); }, + // Explicit refresh after mutations (delete/archive). + // onPageChange skips fetch when already on page 1. + refreshListing() { + this.page = 1; + this.fetch(); + }, }, data() { return { diff --git a/resources/js/components/shared/processNavigation.js b/resources/js/components/shared/processNavigation.js index 313f5e3b46..0de9d76716 100644 --- a/resources/js/components/shared/processNavigation.js +++ b/resources/js/components/shared/processNavigation.js @@ -73,7 +73,7 @@ export default { this.$t("The process was archived."), "success" ); - this.$refs.pagination?.loadPage(1); + this.refreshListing(); }); } ); diff --git a/resources/js/templates/components/ProcessTemplatesListing.vue b/resources/js/templates/components/ProcessTemplatesListing.vue index d870997271..9a3131db54 100644 --- a/resources/js/templates/components/ProcessTemplatesListing.vue +++ b/resources/js/templates/components/ProcessTemplatesListing.vue @@ -298,7 +298,7 @@ this.$t("The process template was deleted."), "success" ); - this.$refs.pagination.loadPage(1); + this.refreshListing(); }); } );