Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #37247 - refactor HostsIndex to map results directly
- Loading branch information
1 parent
46fcd9a
commit 59d5022
Showing
6 changed files
with
247 additions
and
102 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
webpack/assets/javascripts/react_app/components/HostsIndex/RowSelectTd.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Td } from '@patternfly/react-table'; | ||
|
||
export const RowSelectTd = ({ rowData, selectOne, isSelected }) => ( | ||
<Td | ||
select={{ | ||
rowIndex: rowData.id, | ||
onSelect: (_event, isSelecting) => { | ||
selectOne(isSelecting, rowData.id, rowData); | ||
}, | ||
isSelected: isSelected(rowData.id), | ||
disable: false, | ||
}} | ||
/> | ||
); | ||
|
||
RowSelectTd.propTypes = { | ||
rowData: PropTypes.object.isRequired, | ||
selectOne: PropTypes.func.isRequired, | ||
isSelected: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.