Skip to content

Fix service bodies page reverting to create form when search has no matches - #1529

Merged
pjaudiomv merged 1 commit into
mainfrom
fix-servicebodies-search-empty-state
Aug 28, 2026
Merged

Fix service bodies page reverting to create form when search has no matches#1529
pjaudiomv merged 1 commit into
mainfrom
fix-servicebodies-search-empty-state

Conversation

@pjaudiomv

Copy link
Copy Markdown
Member

Problem

On the Service Bodies page, typing a search term that matched no service bodies caused the page to collapse into the "Add Service Body" create form, the same empty-state view shown when an account genuinely has no service bodies. This was
confusing because the account has plenty of service bodies; only the current filter had no matches.

Cause

The template chose between the table view and the empty create-form view based on filteredServiceBodies.length the list after the search filter was applied. When a search matched nothing, that length dropped to 0 and the page fell through to the create-form branch.

Fix

Split the filtering into two derived values:

  • editableServiceBodies- every service body the authenticated user can administer, ignoring the search term.
  • filteredServiceBodies - that list further narrowed by the search term.

The outer branch now keys off editableServiceBodies.length, so the search box and table header stay visible as long as the user has any service bodies. An empty search just renders no rows. The create form only appears when the user truly has none - matching the existing behavior of the Users and Formats pages.

Screenshot 2026-08-27 at 9 10 26 PM Screenshot 2026-08-27 at 9 10 16 PM

@pjaudiomv
pjaudiomv requested a review from alanb2718 August 28, 2026 01:24
@pjaudiomv
pjaudiomv force-pushed the fix-servicebodies-search-empty-state branch 3 times, most recently from 1c477b8 to 945fc21 Compare August 28, 2026 20:11
…atches

add changelog entry

Fix meetings list UI glitches

mutliarch

pkg update

Fix lock

fix deprecation in test
@pjaudiomv
pjaudiomv force-pushed the fix-servicebodies-search-empty-state branch from 945fc21 to d889cf0 Compare August 28, 2026 20:15
@pjaudiomv
pjaudiomv merged commit dc765a1 into main Aug 28, 2026
10 checks passed
@pjaudiomv
pjaudiomv deleted the fix-servicebodies-search-empty-state branch August 28, 2026 20:18
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.

1 participant