SearchKit: make inline edit for custom fields only available when applicable
Overview
It is possible to edit custom fields in non-applicable cases by editing inline with SearchKit.
Previously discussed here https://github.com/civicrm/civicrm-core/pull/21533#issuecomment-923030658
Reproduction steps
- Create a Custom Field only applicable for a certain Relationship Type
- Define a SearchKit of Relationships with a Table Display allowing inline edit for the previously created Custom Field.
- You will see how it is possible to edit the value of the Custom Field in relations with Relationship Type other than the one specified when defining the Custom Field.
Another case, for example, a Custom Field defined at Contact Subtype level.
Expected behaviour
Disable editing and adding a disabled-background for custom fields that do not belong to this type of data (contact, activity, relationship, etc.).