SearchKit - Merge admin results table with searchDisplay code #21069
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This improves and streamlines the SearchKit Angular code to reconcile 2 different ways of fetching, formatting & displaying results. This reduces code duplication, while adding a few features from the admin table to all search display tables.
Before
The SearchDisplay subsystem has its own way of fetching, formatting and displaying a table of results, which looked nearly identical to the table on the SearchKit admin screen, but used completely different code. This redundancy was starting to cause maintenance headaches.
After
Consolidated all search results to use SearchDisplay code. 2 features on the admin table that were missing from SearchDisplays (a search button and adjustable page size) have been added. One "extra" feature from the admin table (the "Search/Auto" toggle) has been dropped; it may have been more confusing than helpful.
Technical Details
This greatly simplifies the SearchKit admin code by handing off the table to a specialized searchDisplay (adapted from
crmSearchDisplayTable
). Builds on the refactoring done in #21049Before / After Comparison
Despite having all its code ripped out, the admin table looks almost identical: