-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: [DHIS2-15783] Tooltip on long working list names #3474
feat: [DHIS2-15783] Tooltip on long working list names #3474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a decent solution 👍
Perhaps we can make a slight improvement by not showing the tooltip if a name has not been truncated? (I tried to see if ConditionalTooltip
could be applied here, but it dosen't quite seem to fit. So I'm thinking more along the lines of using a plain conditional expression for achieving this.)
...ules/capture-core/components/WorkingLists/WorkingListsBase/TemplateSelectorChip.component.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @eirikhaugstulen,
Can you add the same logic on the /search
page inside the TemplateSelector component?
Thanks!
...ules/capture-core/components/WorkingLists/WorkingListsBase/TemplateSelectorChip.component.js
Outdated
Show resolved
Hide resolved
Thanks for the review, @simonadomnisoru & @superskip! Regarding conditionally rendering tooltips; there seems to be a lot of work to make this generic while using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @eirikhaugstulen!
I think extracting the style- and ref-stuff into a separate component made the code look better 😄
I'm wondering if we should put the two conditional tooltip components in a common Tooltip
folder. I also suggest renaming the new tooltip component to TooltipForChip
(no need to make clear in the title that such tooltips can be disabled).
...ules/capture-core/components/WorkingLists/WorkingListsBase/TemplateSelectorChip.component.js
Outdated
Show resolved
Hide resolved
Thanks @superskip, I implemented your changes! |
Very good @eirikhaugstulen! I only have one final minor refactor suggestion, which is to add an index file to the Tooltips folder. Please say no if you think it's too pointless. EDIT: Regarding the enabled prop, we could maybe make that optional and true by default, if that solves your main concern with the shorter name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After our discussion I agree with you it's fine as it is now, never mind last comment 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding conditionally rendering tooltips; there seems to be a lot of work to make this generic while using
ConditionalTooltip
. (Chips we can wrap in a separate button, while if we use DHIS2/UI buttons, things work a bit differently.) If you check my latest commit, you can see how it could be implemented with a separateConditionalTooltipForChip
-component. Could you take a look and see if this is something you want?
The latest commits look great! Good job @eirikhaugstulen 👏
🚀 Deployed on https://deploy-preview-3474--dhis2-capture.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested successfully on 2.41,2.40.3,2.39.5,2.38.6 versions
# [100.48.0](v100.47.3...v100.48.0) (2023-12-15) ### Features * [DHIS2-15783] Tooltip on long working list names ([#3474](#3474)) ([6263aa8](6263aa8))
🎉 This PR is included in version 100.48.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary: