Skip to content

FOUR-26360 | Pagination Enabled and Shows Loading with a Single Page in Projects - #9118

Open
mcraeteisha wants to merge 3 commits into
developfrom
bugfix/FOUR-26360
Open

mcraeteisha wants to merge 3 commits into
developfrom
bugfix/FOUR-26360

Conversation

@mcraeteisha

@mcraeteisha mcraeteisha commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Ticket: FOUR-26360
On project-related screens, pagination controls still appear interactive when there is only one page (or when the user is already on the first or last page). Hovering shows a locked/disabled cursor, but clicking still triggers a fetch and shows the table loading state.

onPageChange always called fetch() after clamping the page number. When navigation was already at the first or last page, the clamped page matched the current page, but a redundant API request still ran and refreshed the listing.
This PR updates core ProcessMaker pagination shared by listings that use Pagination.vue and the common datatable mixin. Matching fixes in package-projects, package-comments, and package-smart-extract cover package-local datatable copies used by those packages’ listings. Multi-page pagination is unchanged when the page actually advances.

Solution

processmaker

  • In resources/js/components/common/mixins/datatable.js, onPageChange records the previous page and returns before fetch() when the resolved page is unchanged (disabled first/prev/next/last or no page change).
  • In resources/js/components/common/Pagination.vue, disabled controls use stronger disabled styling (opacity) and keep the disabled background on hover so hover styles do not override the locked state.

package-projects (8552e86)

  • In resources/js/projects/components/common/mixins/datatable.js, apply the same skip-redundant-fetch guard in onPageChange.
  • Update the projects listing default perPage from 10 to 15.

package-comments (2efb2a2)

  • In resources/js/components/common/mixins/datatable.js, apply the same skip-redundant-fetch guard in onPageChange.

package-smart-extract (2a1f3de)

  • In resources/js/components/common/mixins/datatable.js, apply the same skip-redundant-fetch guard in onPageChange.
  • Update the default perPage from 10 to 15.

How To Test

Manual Tests

  1. Go to Projects, create a project, add some assets, and open a listing that has only one page of results.
  2. Hover the pagination arrows: they appear locked/disabled; clicking them does not fire another list API request or show the table loading state. With enough assets for multiple pages, next/prev still advance the page and load the expected results.

ci:deploy
ci:package-projects:bugfix/FOUR-26360
ci:package-comments:bugfix/FOUR-26360
ci:package-smart-extract:bugfix/FOUR-26360

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

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.
@cursor

cursor Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
UI and listing-fetch behavior only; no auth, data, or API contract changes.

Overview
Fixes pagination firing list API calls and loading spinners when users click prev/next/first/last while already on the first or last page (or when the resolved page does not change).

The shared datatable mixin’s onPageChange now compares the page before and after clamping and returns without fetch() when nothing changed. refreshListing() was added so delete/archive flows still reload the table (replacing pagination.loadPage(1), which would no-op when already on page 1). Process archive and process template delete now call refreshListing() instead.

Auth clients listing gets the same skip guard in its local onPageChange. Pagination.vue disabled controls get clearer styling (opacity, hover no longer looks active).

Multi-page navigation when the page actually changes is unchanged.

Reviewed by Cursor Bugbot for commit a4d673f. Bugbot is set up for automated code reviews on this repo. Configure here.

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-f75f6147b9.engk8s.processmaker.net

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-f75f6147b9.engk8s.processmaker.net

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.
@decisions-sonarqube

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-f75f6147b9.engk8s.processmaker.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants