-
Notifications
You must be signed in to change notification settings - Fork 64
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(TitleColumn): RHINENG-3112 - Allow passing in a link via href prop #2087
Conversation
4300403
to
54d0014
Compare
@@ -295,7 +295,6 @@ const ConventionalSystemsTab = ({ | |||
], | |||
}} | |||
bulkSelect={bulkSelectConfig} | |||
onRowClick={(_e, id, app) => navigate(`/${id}${app ? `/${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.
I'm not sure what this was meant to link to exactly. When the onRowClick
is called it will receive an event
, id
, but the third argument is not an "app" or anything, but isMetaKey
which determines if a certain keyboard key is pressed.
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.
Also, by default the inventory table will link/navigate to the systems details page in the inventory, like it did here in the passed in onRowClick
. So this became obsolete.
@@ -40,10 +38,6 @@ const ImmutableDevices = ({ | |||
return [...mergeAppColumns(filteredColumns), ...edgeColumns]; | |||
}; | |||
|
|||
const onRowClick = (_key, systemId) => { | |||
navigate(`/insights/inventory/${systemId}?appName=vulnerabilities`); |
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.
This became obsolete with using the Link
in the TitleColumn
and the react router oddnesses being resolved, not requiring to pass in a navigate ensuring it is referencing the correct router to navigate.
@@ -70,14 +67,6 @@ const EntityTable = ({ | |||
[loaded, columns, hasItems, rows, isExpandable] | |||
); | |||
|
|||
const defaultRowClick = (_event, key) => { |
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.
Same as above.
<div className="ins-composed-col sentry-mask data-hj-suppress"> | ||
<div key="os_release">{item?.os_release}</div> | ||
{item?.os_release && <div key="os_release">{item?.os_release}</div>} |
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.
I don't think that we are showing/using this anywhere, or?
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.
I'm not 100% sure what it even does. Would it provide another div in the title column with the os version along with the system name? If so, then I've never seen that.
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.
Yeah, it would do just that. I'll leave it in for now, but I think we can eventually remove it.
778c36d
to
3a578b3
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2087 +/- ##
=======================================
Coverage 59.20% 59.21%
=======================================
Files 188 188
Lines 5944 5938 -6
Branches 1669 1669
=======================================
- Hits 3519 3516 -3
+ Misses 2425 2422 -3 ☔ View full report in Codecov by Sentry. |
.find('.ins-composed-col > :nth-child(2) > a') | ||
.trigger('click'); | ||
.find('.ins-composed-col > div > a') | ||
.click(); |
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.
The click()
was what fixed the failing Cypress test, which is odd, because I would expect trigger('click')
to be the same and click
would just be a shorthand.
0c0babf
to
2f94129
Compare
/retest |
ee10d0a
to
60bb7eb
Compare
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.
LGTM! Have tested it locally for preview and stable routes and didn't find any issues while navigating. Also thanks for updating the tests
@@ -343,7 +341,6 @@ InventoryTable.propTypes = { | |||
tableProps: PropTypes.object, | |||
isRbacEnabled: PropTypes.bool, | |||
hasCheckbox: PropTypes.bool, | |||
onRowClick: PropTypes.func, |
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.
nit-pick: Since the prop is sent down to EntityTable eventually, I think it makes sense to leave it specified in propTypes here as an indication that InventoryTable generally supports this property.
60bb7eb
to
b224d5e
Compare
InsightsLink is not fully working in scenarios where the Link is in another applications.
b224d5e
to
0664aba
Compare
🎉 This PR is included in version 1.59.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This changes the
a
tag used to a proper react routerLink
component and allows entities to have ahref
prop that the Inventory should link thedisplay_name
(example in compliance[0]).[0] https://github.com/RedHatInsights/compliance-frontend/pull/2012/files#diff-09ae52efeffb58d25e728921c02f75f65b9f249855e9eea936ce9e913d6997e1R145