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 - Configurable action menu tasks per-search-display #25521

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Feb 7, 2023

Overview

Allows the admin to limit the available choices of bulk actions (tasks) in a Search Display.
See https://lab.civicrm.org/dev/core/-/issues/4118

Before

Actions menu can be influenced by hook but not in the UI.

After

Selecting only certain tasks:
image

Results in limited choices:
image

Technical Details

This utilizes the hook from @mattwire's 25123. The filtering happens before W_LATE but after W_MIDDLE so that the filtering happens after extensions add to the tasks list. If you want to alter the list of tasks after the filtering, implement your hook at W_LATE to have the final say about which tasks are available (e.g. to add disabled tasks back in on a per-user-role basis).

@civibot
Copy link

civibot bot commented Feb 7, 2023

(Standard links)

@civibot civibot bot added the master label Feb 7, 2023
@aydun
Copy link
Contributor

aydun commented Feb 8, 2023

All works well except for one thing:
If I add a searchTask via an extension, the task appears correctly in the configurable list and can be selected/deselected as with other actions. But deselecting it does not remove it from the list actually shown.

@colemanw
Copy link
Member Author

colemanw commented Feb 9, 2023

Thanks for testing @aydun. I've pushed up a fix for that (utilizing the hook). And updated the description.

@AHowiller
Copy link

  • General standards
    • [r-explain] PASS
    • [r-user] PASS: maximum intuitive as previous behavior is standard and provides possibility to disable actions
    • [r-doc] PASS
    • [r-run] PASS: Tested on PR test site and also applied patch to WP 6.1.1 running CiviCRM 5.58.0 to test actions added by Search Action Designer, too. All worked as expected (though I had to clean browser cache once after patching to make unchecked actions disappear).

@eileenmcnaughton
Copy link
Contributor

Thanks for reviewing this @AHowiller & @aydun

@eileenmcnaughton eileenmcnaughton merged commit 8ae17e6 into civicrm:master Feb 9, 2023
@eileenmcnaughton eileenmcnaughton deleted the actionsMenu branch February 9, 2023 23:59
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Feb 10, 2023
SearchKit - Configurable action menu tasks per-search-display
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.

4 participants