fix(companies): render every site on the company detail Sites card (MAPPS-316) #345

Merged
YousifShkara merged 1 commit from fix/MAPPS-316-sites-card-show-all into main 2026-06-25 11:41:40 +02:00
Owner

QA report: a company shows N sites in the Sites card header badge
but only N-or-fewer rows are visible with no way to reach the rest.

Two stacked caps were hiding the tail:

  • sites_resource fetched ?per_page=5 (MAPPS-247's preview-cap
    policy, copied from Contacts above it).
  • CompanySitesCard then rendered only page.data.iter().take(3)
    (MAPPS-249's three-row preview policy).

Other resource cards on the same page (Contacts, Tickets, Contracts,
Projects) carry a "View all" link to a filtered list page so a
capped preview is escapable. Sites has no equivalent destination, so
the cap was a dead end - the badge said 6 but the user saw 3 with no
way forward.

Fix:

  • Raise the fetch to ?per_page=200. Sites per company are small
    in practice (typical 1-20; hard ceiling well under 100), so a
    high ceiling renders every site inline without justifying a
    dedicated list page.
  • Drop .take(3) so the render reflects what the fetch returned.

Header badge stays accurate (it already read meta.total, not the
preview length). New / edit / delete affordances per row are
unaffected.

#MAPPS-316

QA report: a company shows N sites in the Sites card header badge but only N-or-fewer rows are visible with no way to reach the rest. Two stacked caps were hiding the tail: - `sites_resource` fetched `?per_page=5` (MAPPS-247's preview-cap policy, copied from Contacts above it). - `CompanySitesCard` then rendered only `page.data.iter().take(3)` (MAPPS-249's three-row preview policy). Other resource cards on the same page (Contacts, Tickets, Contracts, Projects) carry a "View all" link to a filtered list page so a capped preview is escapable. Sites has no equivalent destination, so the cap was a dead end - the badge said 6 but the user saw 3 with no way forward. Fix: - Raise the fetch to `?per_page=200`. Sites per company are small in practice (typical 1-20; hard ceiling well under 100), so a high ceiling renders every site inline without justifying a dedicated list page. - Drop `.take(3)` so the render reflects what the fetch returned. Header badge stays accurate (it already read `meta.total`, not the preview length). New / edit / delete affordances per row are unaffected. #MAPPS-316
fix(companies): render every site on the company detail Sites card (MAPPS-316)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m16s
Create release / Create release from merged PR (pull_request) Has been skipped
4eb31a4cac
QA report: a company shows N sites in the Sites card header badge
but only N-or-fewer rows are visible with no way to reach the rest.

Two stacked caps were hiding the tail:
- `sites_resource` fetched `?per_page=5` (MAPPS-247's preview-cap
  policy, copied from Contacts above it).
- `CompanySitesCard` then rendered only `page.data.iter().take(3)`
  (MAPPS-249's three-row preview policy).

Other resource cards on the same page (Contacts, Tickets, Contracts,
Projects) carry a "View all" link to a filtered list page so a
capped preview is escapable. Sites has no equivalent destination, so
the cap was a dead end - the badge said 6 but the user saw 3 with no
way forward.

Fix:
- Raise the fetch to `?per_page=200`. Sites per company are small
  in practice (typical 1-20; hard ceiling well under 100), so a
  high ceiling renders every site inline without justifying a
  dedicated list page.
- Drop `.take(3)` so the render reflects what the fetch returned.

Header badge stays accurate (it already read `meta.total`, not the
preview length). New / edit / delete affordances per row are
unaffected.

#MAPPS-316
YousifShkara deleted branch fix/MAPPS-316-sites-card-show-all 2026-06-25 11:41:41 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!345
No description provided.