Skip to content

Add total row to people table showing number of beneficiaries#730

Merged
pylipp merged 2 commits intomasterfrom
copilot/fix-729
Aug 20, 2025
Merged

Add total row to people table showing number of beneficiaries#730
pylipp merged 2 commits intomasterfrom
copilot/fix-729

Conversation

Copy link
Contributor

Copilot AI commented Aug 12, 2025

This PR implements a totals counter for the people table, similar to the existing functionality in the stock table. The counter displays the number of beneficiaries being shown and is influenced by applied filters.

Changes Made

Core Implementation:

  • Added totals calculation to include/people.php that counts displayed beneficiaries after all filtering
  • Displays "Total" and "X beneficiaries" in both header and footer rows (matching stock table behavior)
  • Dynamically calculates column count to properly align with table structure regardless of camp configuration

Key Features:

  • Counter reflects filtered results (search, tags, quick filters, etc.)
  • Handles all conditional columns correctly (tags, last activity, custom fields)
  • Uses the same firstline/listfooter template pattern as stock.php for consistency
  • Maintains proper alignment across different table configurations

Testing:

  • Added comprehensive Cypress E2E test (5_3_People_Totals_Test.js) to verify functionality
  • Tests check that totals display correctly and update when filters are applied
  • All syntax validation passes

Example

Before: People table had no totals information
After: People table shows totals like the stock table:

| Total | 156 beneficiaries |    |    |    |    |    |    |
|-------|-------------------|----|----|----|----|----|----|
| Surname | Firstname | Gender | Age | Family ID | Tokens | Comments | Icons |
| Smith | John | Male | 25 yrs | FAM001 | 50 | Active | 📍 |
| ... more rows ... |
| Total | 156 beneficiaries |    |    |    |    |    |    |

The implementation ensures the counter updates correctly when users apply filters, search, or use tags, providing the same user experience as the existing stock table functionality.

Fixes #729.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cs.symfony.com
    • Triggering command: curl -L REDACTED -o php-cs-fixer.phar (dns block)
  • https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/zje3Wi /usr/bin/composer install (http block)
  • https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/zje3Wi /usr/bin/composer install (http block)
  • https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/zje3Wi /usr/bin/composer install (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor Author

Copilot AI commented Aug 12, 2025

@pylipp 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@pylipp
Copy link
Contributor

pylipp commented Aug 12, 2025

Copilot AI changed the title [WIP] Add total row to people table Add total row to people table showing number of beneficiaries Aug 12, 2025
Copilot AI requested a review from pylipp August 12, 2025 15:34
@pylipp pylipp requested a review from HaGuesto August 12, 2025 16:36
@pylipp pylipp marked this pull request as ready for review August 18, 2025 07:31
Copilot AI and others added 2 commits August 20, 2025 08:47
@pylipp pylipp merged commit a34ff45 into master Aug 20, 2025
1 check passed
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.

Add total row to people table

3 participants