-
-
Notifications
You must be signed in to change notification settings - Fork 824
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 - Fix in-place edit of relationships and dates #21533
Conversation
Date fields were not rendering correctly, and relationships could not be edited due to the read-only nature of the relationshipCache table.
(Standard links)
|
@colemanw I tested here http://core-21533-8p4gv.test-3.civicrm.org:8001/civicrm/admin/search#/edit/1 and all works as expected. Only one thing. I enabled one custom field for only one relationship type and in-place edit is "working" for all relationship types. Maybe in-place edit should be disabled if custom field not apply on a specific relationship type? |
Thanks @francescbassas for testing. I can try to do a separate fix for the custom data issue. |
@colemanw I was returning on this #21533 (comment) and testing a little more. I have been able to verify that the problem probably extends to other entities beyond relationships. For example it's possible to have an in place edit for all contacts for a set of custom fields defined only for a contact subtype. Are my observations correct? A possible solution that I imagine at the UI level is to disable editing for fields that do not belong to this type of data (contact, activity, relationship, etc.) with a tooltip that warns of the reason (eg "this field type is only defined for Volunteer contact subtype"). I imagine it’s nothing immediate to implement but I’m sure something good to register as an issue in order to keep it in mind, to be able to discuss it and make it extended to the rest of the community. |
@francescbassas it's currently not possible to do complex permission or data-integrity checks with client-side rendering, which is why I'm switching a lot of the rendering to server-side in #21820 which should make these sorts of checks possible. |
@colemanw is there any recent news in the Searchkit that allows to tackle the problem of editing non-pertinent custom fields? If not, perhaps it is better to open a separate issue? |
@francescbassas agreed. Please open a new issue on GitLab and tag searchKit. I do think we need to fix that problem. |
Thanks @colemanw, done https://lab.civicrm.org/dev/core/-/issues/3423 |
Overview
Makes relationship fields in-place editable on SearchKit, and fixes in-place editing of dates.
Before
Date fields were not rendering correctly, and relationships could not be edited due to the read-only nature of the relationshipCache table.
After
Relationship start date, end date, is_active, and custom fields can be edited in-place on search displays.
Technical Details
No fields in the RelationshipCache table are editable directly, so this tricks SearchKit into thinking they belong to the Relationship entity.
Comments
Also fixes a couple bugs related to in-place editing caused by the refactoring done in #21528