Skip to content

Commit 9ff8472

Browse files
ianballouekohl
authored andcommitted
Fixes #38289 - customize CardTemplate ouiaId
(cherry picked from commit 8b00ca2)
1 parent 3a5497f commit 9ff8472

File tree

1 file changed

+7
-1
lines changed
  • webpack/assets/javascripts/react_app/components/HostDetails/Templates/CardItem/CardTemplate

1 file changed

+7
-1
lines changed

webpack/assets/javascripts/react_app/components/HostDetails/Templates/CardItem/CardTemplate/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const CardTemplate = ({
2222
overrideGridProps,
2323
overrideDropdownProps,
2424
masonryLayout,
25+
ouiaId,
2526
}) => {
2627
const { cardExpandStates, dispatch, registerCard } = useContext(
2728
CardExpansionContext
@@ -60,7 +61,10 @@ const CardTemplate = ({
6061
{...overrideGridProps}
6162
className="masonry-item"
6263
>
63-
<Card isExpanded={isExpanded} ouiaId={`card-template-${cardId}`}>
64+
<Card
65+
isExpanded={isExpanded}
66+
ouiaId={`card-template-${ouiaId || cardId}`}
67+
>
6468
<CardHeader
6569
onExpand={expandable && onExpandCallback}
6670
isToggleRightAligned
@@ -101,6 +105,7 @@ CardTemplate.propTypes = {
101105
overrideDropdownProps: PropTypes.object,
102106
expandable: PropTypes.bool,
103107
masonryLayout: PropTypes.bool,
108+
ouiaId: PropTypes.string,
104109
};
105110

106111
CardTemplate.defaultProps = {
@@ -110,6 +115,7 @@ CardTemplate.defaultProps = {
110115
overrideDropdownProps: {},
111116
expandable: false,
112117
masonryLayout: false,
118+
ouiaId: undefined,
113119
};
114120

115121
export default CardTemplate;

0 commit comments

Comments
 (0)