Add search/display details to searchKitTasks hook - allows for eg. filtering actions by search display #25123
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
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 andctrl.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?