-
Notifications
You must be signed in to change notification settings - Fork 19
Edit TagGroup component to support onClick and displaying titles #129
Edit TagGroup component to support onClick and displaying titles #129
Conversation
58ca058
to
417f655
Compare
417f655
to
df06f8d
Compare
c6578af
to
2cc535a
Compare
@miq-bot add_reviewer @Hyperkid123 |
src/textual_summary/tag_group.jsx
Outdated
<IconOrImage icon={subitem.icon} image={subitem.image} text={subitem.text} /> | ||
{this.renderSubiteList(subitem)} | ||
{Array.isArray(subitem.value) ? this.renderSubiteList(subitem) : this.renderSubitem(subitem)} |
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.
Can you fix this typo renderSubiteList
? I know it was here before 😉
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.
Code looks good.
2cc535a
to
1949ade
Compare
*/ | ||
renderSubiteList = subitem => ( | ||
renderSubitemList = subitem => ( |
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.
👍
src/textual_summary/tag_group.jsx
Outdated
<IconOrImage icon={item.icon} image={item.image} title={item.title} /> | ||
{item.value} | ||
<td title={item.title} onClick={e => this.checkLinkItem(item, e)}> | ||
<IconOrImage icon={item.icon} image={item.image} title={item.title} /> {item.value} |
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.
keep the 2 lines as 2 lines please :)
(otherwise, {item.value}
is completely hidden in the code)
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.
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.
Ah, sorry, react jsx is not html...
I think the canonical way to do this (if I understand facebook/jsx#19 (comment) right) is..
<td title={item.title} onClick={e => this.checkLinkItem(item, e)}>
<IconOrImage icon={item.icon} image={item.image} title={item.title} />
{' '}
{item.value}
</td>
up to you :)
Overall, matches the other components which already do the same thing 👍 (I don't agree that onClick is ever the right way to go to a different screen, we should be using proper links, but that's a separate issue.) |
1949ade
to
64486c6
Compare
@himdel : all feedback properly adressed? |
64486c6
to
740737b
Compare
@martinpovolny No real issues from me, only #129 (comment) but it's not really that important. |
740737b
to
9a34979
Compare
Checked commits hstastna/react-ui-components@0837a10~...9a34979 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
🎉 This PR is included in version 0.11.28 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
Edit
TagGroup
component to supportonClick
and displaying titles (if they are specified).Add some data for the appropriate storybook.
Why:
Needed for ManageIQ/manageiq-ui-classic#5675
Related RFE:
https://bugzilla.redhat.com/show_bug.cgi?id=1678124
Some screenshots at:
ManageIQ/manageiq-ui-classic#5675