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

Contact summary - adjust block width when editing #12708

Merged
merged 1 commit into from
Aug 23, 2018

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Aug 21, 2018

Overview

Fixes an annoyance when editing blocks on the contact summary screen where their content would be hidden with a scrollbar.

Before

Forms that were too wide would be cropped and need to be manually scrolled.

After

Forms will auto-adjust their width to fit content.

ezgif-2-8fe2692368

Notes

Compatible with Shoreditch and Contact Summary Layout Editor extensions.

@civibot
Copy link

civibot bot commented Aug 21, 2018

(Standard links)

@colemanw colemanw force-pushed the summary branch 3 times, most recently from d401f50 to 1f4e57d Compare August 22, 2018 01:56
@tschuettler
Copy link
Contributor

That looks and feels very nice. 💚

Fields with multiple values like phone look a bit different from your screencap. They have a visible empty cell on the right that is used for the delete button and are not centered.
grafik

Adding a second phone number will not increased the width enough to fully display the delete button:
grafik

There should probably a maximum width, just in case...
grafik
grafik

@colemanw
Copy link
Member Author

@tschuettler thanks for the review. I've tweaked the code to rely more on css and less on javascript, and the result is more flexible. It now wraps help text correctly, responds to width changes when the form needs to expand to show something like a delete button, and responds pretty well to the window being resized mid-edit. Give it another try :)

@tschuettler
Copy link
Contributor

Thanks for the additional tweaks. I gave it another try to break stuff and it is looking good to me.

There is now a scrollbar when the fieldset gets too wide and is on the left side 👍 :
grafik

For the right hand side custom field sets there does not appear a scroll bar once the field gets to large for the viewport. Anyway, it might be more sensible to use the options per line setting to adjust for that :)
grafik

@colemanw
Copy link
Member Author

Thanks again for the thorough testing @tschuettler! Glad you haven't been able to break it :)
IMO the "lots of radios on one line" is a preexisting condition. It looked awful before this PR, still looks pretty bad after (slightly better IMO) and would be a good thing to improve on once this PR gets merged.
@lcdservices care to weigh in?

@lcdservices
Copy link
Contributor

@colemanw I implemented and tested in shoreditch -- looks great. I think this is a big improvement.

@colemanw colemanw merged commit 271b007 into civicrm:master Aug 23, 2018
@colemanw colemanw deleted the summary branch August 23, 2018 14:47
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