Skip to content

Commit 652cb69

Browse files
authored
fix(ui): compliance card layout polish (#10939)
1 parent 921f49a commit 652cb69

3 files changed

Lines changed: 46 additions & 43 deletions

File tree

ui/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
All notable changes to the **Prowler UI** are documented in this file.
44

5-
## [1.26.0] (Prowler UNRELEASED)
5+
## [1.25.2] (Prowler UNRELEASED)
66

77
### 🔄 Changed
88

9+
- Compliance cards: progress bar now spans the full card width, the passing-requirements caption sits beside the framework logo under the title, and the ISO 27001 logo asset is recentered within its tile [(#10939)](https://github.com/prowler-cloud/prowler/pull/10939)
910
- Findings expanded resource rows now drop the redundant cube icons, render Service and Region with the same compact label style as Last seen and Failing for, and reorder columns to Status, Resource, Provider, Severity, then field labels [(#10949)](https://github.com/prowler-cloud/prowler/pull/10949)
1011

1112
---

ui/components/compliance/compliance-card.tsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -119,56 +119,58 @@ export const ComplianceCard: React.FC<ComplianceCardProps> = ({
119119
/>
120120
</div>
121121
<CardContent className="p-0">
122-
<div className="flex w-full flex-col gap-3 sm:flex-row sm:items-start">
123-
<div className="flex shrink-0 items-center sm:flex-col sm:items-start sm:gap-2">
122+
<div className="flex w-full flex-col gap-3">
123+
<div className="flex items-center gap-3 pr-9">
124124
{getComplianceIcon(title) && (
125-
<Image
126-
src={getComplianceIcon(title)}
127-
alt={`${title} logo`}
128-
className="h-10 w-10 min-w-10 self-start rounded-md border border-gray-300 bg-white object-contain p-1"
129-
/>
125+
<div className="flex h-10 w-10 min-w-10 shrink-0 items-center justify-center rounded-md border border-gray-300 bg-white">
126+
<Image
127+
src={getComplianceIcon(title)}
128+
alt={`${title} logo`}
129+
width={32}
130+
height={32}
131+
className="h-8 w-8 object-contain"
132+
/>
133+
</div>
130134
)}
131-
</div>
132-
<div className="flex w-full min-w-0 flex-col gap-3">
133-
<Tooltip>
134-
<TooltipTrigger asChild>
135-
<h4 className="text-small truncate pr-9 leading-5 font-bold">
135+
<div className="flex min-w-0 flex-1 flex-col">
136+
<Tooltip>
137+
<TooltipTrigger asChild>
138+
<h4 className="text-small truncate leading-5 font-bold">
139+
{formatTitle(title)}
140+
{version ? ` - ${version}` : ""}
141+
</h4>
142+
</TooltipTrigger>
143+
<TooltipContent>
136144
{formatTitle(title)}
137145
{version ? ` - ${version}` : ""}
138-
</h4>
139-
</TooltipTrigger>
140-
<TooltipContent>
141-
{formatTitle(title)}
142-
{version ? ` - ${version}` : ""}
143-
</TooltipContent>
144-
</Tooltip>
145-
<div className="flex flex-col gap-2">
146-
<div className="flex items-center justify-between gap-3 text-xs">
147-
<span className="text-text-neutral-secondary font-medium tracking-wider">
148-
Score:
149-
</span>
150-
<span className="text-text-neutral-secondary">
151-
{ratingPercentage}%
152-
</span>
153-
</div>
154-
<Progress
155-
aria-label="Compliance score"
156-
value={ratingPercentage}
157-
className="border-border-neutral-secondary h-2.5 border drop-shadow-sm"
158-
indicatorClassName={getScoreIndicatorClass(
159-
getRatingVariant(ratingPercentage),
160-
)}
161-
/>
162-
</div>
163-
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
164-
<small className="min-w-0">
146+
</TooltipContent>
147+
</Tooltip>
148+
<small className="truncate">
165149
<span className="mr-1 text-xs font-semibold">
166150
{passingRequirements} / {totalRequirements}
167151
</span>
168152
Passing Requirements
169153
</small>
170154
</div>
171155
</div>
156+
<div className="flex flex-col gap-2">
157+
<div className="flex items-center justify-between gap-3 text-xs">
158+
<span className="text-text-neutral-secondary font-medium tracking-wider">
159+
Score:
160+
</span>
161+
<span className="text-text-neutral-secondary">
162+
{ratingPercentage}%
163+
</span>
164+
</div>
165+
<Progress
166+
aria-label="Compliance score"
167+
value={ratingPercentage}
168+
className="border-border-neutral-secondary h-2.5 border drop-shadow-sm"
169+
indicatorClassName={getScoreIndicatorClass(
170+
getRatingVariant(ratingPercentage),
171+
)}
172+
/>
173+
</div>
172174
</div>
173175
</CardContent>
174176
</Card>

ui/components/icons/compliance/iso-27001.svg

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)