Skip to content

Commit

Permalink
fix(SystemPolicyCards): RHICOMPL-1213 same height on all cards
Browse files Browse the repository at this point in the history
sets the height to 100% to fill the cell in a grid through newly
accessible prop.
  • Loading branch information
vkrizan committed Jan 8, 2021
1 parent 14ee8a0 commit c304d72
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
7 changes: 4 additions & 3 deletions packages/inventory-compliance/src/SystemPolicyCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class SystemPolicyCard extends React.Component {
const {
policy, rulesFailed, compliant, lastScanned, score, ssgVersion, supported
} = this.state.policy;
const { cardTitle, cardSubTitle } = this.state;
const { cardTitle, cardSubTitle, style } = this.state;
const passedPercentage = this.fixedPercentage(score);
const FormattedRelativeCmp = FormattedRelativeTime || FormattedRelative || Fragment;

return <Card>
return <Card style={ style }>
<CardBody>
<TextContent className='margin-bottom-md'>
<Text className='margin-bottom-top-none'
Expand Down Expand Up @@ -133,7 +133,8 @@ SystemPolicyCard.propTypes = {
policyType: PropTypes.string,
compliant: PropTypes.bool,
ssgVersion: PropTypes.string,
supported: PropTypes.bool
supported: PropTypes.bool,
style: PropTypes.object
})
};

Expand Down
2 changes: 1 addition & 1 deletion packages/inventory-compliance/src/SystemPolicyCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SystemPolicyCards extends React.Component {
return policies.filter((policy) => (policy.rulesFailed + policy.rulesPassed) > 0).map(
(policy, i) =>
<GridItem sm={ 12 } md={ 12 } lg={ 6 } xl={ 4 } key={ i }>
<SystemPolicyCard policy={ policy } />
<SystemPolicyCard policy={ policy } style={{ height: '100%' }} />
</GridItem>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,30 @@ exports[`SystemPolicyCards component should render loading state 1`] = `
"supported": true,
}
}
style={
Object {
"height": "100%",
}
}
>
<Card>
<Card
style={
Object {
"height": "100%",
}
}
>
<article
className="pf-c-card"
data-ouia-component-id="OUIA-Generated-Card-1"
data-ouia-component-type="PF4/Card"
data-ouia-safe={true}
id=""
style={
Object {
"height": "100%",
}
}
>
<CardBody>
<div
Expand Down Expand Up @@ -554,14 +570,30 @@ exports[`SystemPolicyCards component should render real table 1`] = `
"supported": true,
}
}
style={
Object {
"height": "100%",
}
}
>
<Card>
<Card
style={
Object {
"height": "100%",
}
}
>
<article
className="pf-c-card"
data-ouia-component-id="OUIA-Generated-Card-5"
data-ouia-component-type="PF4/Card"
data-ouia-safe={true}
id=""
style={
Object {
"height": "100%",
}
}
>
<CardBody>
<div
Expand Down

0 comments on commit c304d72

Please sign in to comment.