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

Meld Address custom field display template with main custom field template #11844

Merged
merged 2 commits into from
Mar 21, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 21, 2018

Overview

Currently there is a custom field tpl for addresses that suffers from copy & paste from the main one. It differs slightly on how it handles view only fields, post help text & file attachment ui. I believe the main one is the preferred behaviour.

Before

View only field
screenshot 2018-03-21 17 27 41

File attachment original UI on address edit (note help text is in full)

screenshot 2018-03-21 20 35 13

After

View only field shows

screenshot 2018-03-21 17 27 07

File attachment UI on address edit (note help text is in help popup)
screenshot 2018-03-21 20 36 38

Technical Details

My goal here is to reconcile to one template that is generic enough to use for both use cases plus some new entities now that we support custom fields on 'any' entity. I have retained the former tpl as a wrapper (not the Address one - that seems too obscure) so any external extensions do not experience change (it's not a supported use per se but seems moderately possible they might)

Hoping @mattwire or @jitendrapurohit might test

Comments

TBH I think the difference between the 2 views is neither here nor there - no-one seems to have noticed. I'm only trying for consistency at this stage

I tested a variety of field types in both inline edit & main contact edit, checking they saved & that the view only field was unchanged

screenshot 2018-03-21 21 11 47

This brings them into line with the behaviour of other custom fields in edit mode (shown, but
greyed out) and is a step towards sharing the tpl
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-drupal that referenced this pull request Mar 21, 2018
@eileenmcnaughton eileenmcnaughton changed the title Synchronise Address custom field display with other custom fields Meld Address custom field display template with main custom field template Mar 21, 2018
There is no reason for there being 2 files almost the same for custom data

I plan to use this file more broadly (ie. permit custom data on other entities such as email, phone)
and towards that have aligned the 2 files first.

There are minor differences in display
- read only fields show up as frozen for non-address & now for address too (instead of suppressed)
- post help text shows as full text for address currently but after this it shows as a help-icon
which can be clicked on
- display improvements for file custom fields.

Note that I think making address like the main file makes sense as that will be where deliberate
changes have happened.
Copy link
Contributor

@jitendrapurohit jitendrapurohit left a comment

Choose a reason for hiding this comment

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

Tested almost all custom fields for the Address entity and didn't find any issues with the Main Edit and Inline Edit form. The post help text gets correctly shifted to the help icon and all fields render and update their values correctly.

@eileenmcnaughton
Copy link
Contributor Author

Thanks @jitendrapurohit - merging based on @jitendrapurohit review

@eileenmcnaughton eileenmcnaughton merged commit 622cae0 into civicrm:master Mar 21, 2018
@eileenmcnaughton eileenmcnaughton deleted the cust_tpl branch March 21, 2018 20:06
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.

3 participants