-
-
Notifications
You must be signed in to change notification settings - Fork 852
allow Search Displays to use all columns from their Saved Search #34178
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
base: master
Are you sure you want to change the base?
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
|
Ohh, nice use of the Toggle element! |
Haha there are all of a sudden toggles absolutely everywhere 😁 |
91731af to
43d07e8
Compare
| console.log(this.columns); | ||
| console.log(this.settings.columns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. fixed
43d07e8 to
08aa7c7
Compare
08aa7c7 to
2be7202
Compare
|
@ufundo this is a neat idea but I have to wonder, if a display uses the default columns, then what's the point of creating the display? Aside from a few other settings (header/footer, etc) the bulk of display configuration is the columns themselves. I would guess that 90% of users who create displays do so to configure the columns: rename headers, rewrite text, add in-place edit, configure links and buttons; all that stuff is lost with that toggle. |
In broad terms this is a step towards making the default search display more like a normal display rather than a magic thing. Currently if you want to use a search, you have three choices: a) use the Search Display listing page - but then you can't add filters, can't give it custom permissions, can't use the afform placement tags to make dashboard widget, include in the listing b) you can create a display, and put it in an afform. That's 2 extra steps, and your columns get fixed. If you add new columns to the search, you have to add them to the display as well, which is faff. If we enable adding [all custom fields] to a search, the display isn't going to adapt c) if you use the default display, you can't make any edits to the headers/actions etc. If at a later point you decide you do want to customise the display of the columns, you can't. You have to create a display, try to update your afform to use it, it's a faff. I think adding a setting like this makes (B) work. It also means we could start to phase out (A) and (C) so that (B) is the easy common path which works for all cases, compared to at the moment where we have 3 slightly different ways to view a search kit listing, each with slightly different limitations. |
This could be a nice follow on. But I think it does require a three way control, which is never great from a user perspective. You'd need 3 modes: Having said that, maybe a |
Yea, there's even a difference between the defaults and the magic thing. In your screencast you can see that extra unlabeled column with hamburger menus for edit/delete/disable actions. But if you flip the toggle to enable custom columns, it disappears. |
Before
After
Technical Details
The motivation here is that, unlike the other table settings for headers/tallies/actions etc, the Display columns somewhat duplicates the Search Display it depends on.
Comments
This is useful for reporting. You can generate a Managed Search Display which includes a somewhat dynamic list of Custom Fields (like https://lab.civicrm.org/extensions/search_kit_report_starter_pack/-/merge_requests/30), and you can create a Search Display that show them all.
It's first step on an alternative to #33959 .
TODO:
Demo:
Screencast.from.2025-11-28.17-40-16.mp4
Note how currently adding those columns after you create the display requires adding on the search, then going to the display and adding the column from the dropdown.