Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchKit server-side rendering #21820

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Oct 13, 2021

Overview

Improves SearchKit by doing more of the rendering work server-side. This allows for more nuanced permission checks of actions, better rendering of spreadsheets, and opens the door for advanced token formatting.

Before

The SearchDisplay::run() api was a thin wrapper around *::get(), with not much pre or post-processing. Formatting of results (e.g. token replacements, rewrites, adding links, image handling, and in-place edit processing) happens client-side.

After

The SearchDisplay::run() api does basically all the preprocessing and formatting of results.

Technical Details

This PR just does the refactoring needed to switch the column formatting from client to server. Advanced stuff like ACL checks of links hasn't been added yet, as this PR is already big and complex enough. But that can be added in a followup PR.

Comments

While testing this I noticed extremely poor performance when the search display had some editable columns. I fixed that with #21920

@civibot
Copy link

civibot bot commented Oct 13, 2021

(Standard links)

@civibot civibot bot added the master label Oct 13, 2021
@colemanw colemanw force-pushed the searchKitServerSideRender branch from 16e8f10 to 1ea397d Compare October 20, 2021 18:36
@colemanw colemanw force-pushed the searchKitServerSideRender branch 3 times, most recently from 1f30fb7 to ba6ef69 Compare October 23, 2021 23:01
@colemanw colemanw marked this pull request as ready for review October 23, 2021 23:01
@colemanw colemanw changed the title WIP - SearchKit server-side rendering SearchKit server-side rendering Oct 23, 2021
@colemanw colemanw force-pushed the searchKitServerSideRender branch 2 times, most recently from 738d9ac to 97b5409 Compare October 25, 2021 12:12
Moves logic for resolving field values from the client to the server-side,
which gives more control over formatting, links, and greater consistency
of spreadsheet output.
@colemanw colemanw force-pushed the searchKitServerSideRender branch from 97b5409 to c0fcc64 Compare October 26, 2021 19:56
@monishdeb
Copy link
Member

Tested the patch on local. Executed the headless modified tests.

(r-explain) PASS
(r-run) PASS: test with different entities and performed actions on columns, didn't encounter any breakage.
(r-tech) PASS
(r-code) PASS
(r-test) PASS

@monishdeb monishdeb merged commit d0c97a5 into civicrm:master Oct 28, 2021
@colemanw colemanw deleted the searchKitServerSideRender branch October 28, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants