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

Add search/display details to searchKitTasks hook - allows for eg. filtering actions by search display #25123

Merged
merged 1 commit into from Dec 14, 2022

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Dec 6, 2022

Overview

You can't currently identify the search display when adding/removing tasks in the searchKitTasks hook. This means you can only provide actions per entity / user and not by search display.
Example:
In the AccountSync extension we have a display for errors which is showing AccountContact entities and provides a set of actions to handle those errors. But I want another display which shows all AccountContact entries that are NOT matched to CiviCRM contacts and offer actions to not sync / create / match. Each of these sets of actions make no sense on the other display.

Before

Can't identify search display

After

Can identify search display.

Technical Details

Pass extra params to the GetSearchTasks API call to include the name of the display.

I tried getting from ctrl.search and ctrl.display but ctrl.search seems to contain the display name and ctrl.display seems to be null?

Comments

@colemanw Does this seem like a sensible approach - do you know why ctrl.display/ctrl.search don't seem to contain what I expected?

@civibot
Copy link

civibot bot commented Dec 6, 2022

(Standard links)

@civibot civibot bot added the master label Dec 6, 2022
@eileenmcnaughton
Copy link
Contributor

The new apiBatch functionality really opens this whole topic up - because you can add custom actions to searches just by adding them via this hook. Not to suggest we shouldn't do this - but I think @colemanw has some paid work from @MegaphoneJon that would make the available actions configurable as part of the search & if that happens we wouldn't need to use code to make the available actions conditional.

@colemanw
Copy link
Member

colemanw commented Dec 7, 2022

@eileenmcnaughton we can do both, and I think this PR will help in that direction.

@mattwire mattwire changed the title Add name of search to params for searchKitTasks hook Add search/display details to searchKitTasks hook - allows for eg. filtering actions by search display Dec 9, 2022
@mattwire mattwire marked this pull request as ready for review December 9, 2022 14:22
@colemanw
Copy link
Member

colemanw commented Dec 9, 2022

@mattwire this looks good apart from moving the $display variable to the other class. Mergeable as soon as that's fixed.

@mattwire
Copy link
Contributor Author

I'm marking merge on pass per @colemanw comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants