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 - enable search by case role #22121

Merged
merged 2 commits into from
Nov 29, 2021

Conversation

colemanw
Copy link
Member

Overview

Permits searching for contacts by case role in SearchKit.

image

Technical Details

Required heavy refactoring of the APIv4 EntityBridge code to permit asymmetric bridges and bridges to multiple entities.

Comments

In order to feel safe about this refactor I added a bunch of test coverage.

@civibot
Copy link

civibot bot commented Nov 24, 2021

(Standard links)

@civibot civibot bot added the master label Nov 24, 2021
@colemanw colemanw changed the title APIv4 - Enrich EntityBridge metadata to permit more than 2 bridge joins SearchKit - enable search by case role Nov 24, 2021
This allows the RelationshipCache entity to bridge not only Contact to Contact
but also Contact to Case.
@colemanw colemanw force-pushed the bridgeEntitiesGoneWild branch from 7d83e0a to 63f3df5 Compare November 24, 2021 02:03
@colemanw
Copy link
Member Author

Retest this please

@kurund
Copy link
Contributor

kurund commented Nov 26, 2021

@colemanw

Overall working fine and the use case mentioned is working fine. Noticed minor glitch.

screenshot-wp localhost_7979-2021 11 26-11_28_51

Duplicate contacts are listed. However, grouping by contact id does fix it. I think this might have been always this way.

Tested few other searches and refactoring didn't have regressions.

@colemanw
Copy link
Member Author

@kurund that's because without specific relationship types specified, it is returning both sides of each relationship - in the screenshot, Alida Adams is clearly the case client, so is getting returned as the "B" side of each relationship. Adding an ON clause could filter those out.

@Guydn
Copy link

Guydn commented Nov 27, 2021

I have CiviCRM 5.44 and Compucorp Case extension 2.4.0 (last one). I use a lot Civicase.
The PR was implemented.
I tried to build one search (from contact) and I was not able to see the new entities (contact case roles).

Then I realise that Searches with cases (dossier in French) were broken, see screenshots. Maybe I should have done some technical action (caches, database action, ...) .... See screenshots with searches with the PR.

PEC case search

PEC ist of activities

The PR was rolled back immediately.

Copy link
Contributor

@kurund kurund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw

Okie that makes sense. Good to merge IMO

@kurund
Copy link
Contributor

kurund commented Nov 28, 2021

@Guydn

Do you mean you are running the master branch? Can you check without the case extension to rule out potential issues with the extension?

@Guydn
Copy link

Guydn commented Nov 29, 2021

I have just tried another time. Caches were cleaned.
It works, as you can see I the screenshot. I do get the report with case and case coordinator :-).
PEC patch case roles
I saw this time the new entities case client case contact roles.
The previous searches are ok.
However I have lost all the forms, related my previous searches, whatever the search is.

@colemanw
Copy link
Member Author

Thanks for retesting this @Guydn. I think the issue you experienced with missing forms is unrelated to this PR, as this doesn't touch any form code.

@colemanw colemanw merged commit 0c3b93f into civicrm:master Nov 29, 2021
@colemanw colemanw deleted the bridgeEntitiesGoneWild branch November 29, 2021 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants