Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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

## [1.25.1] (Prowler v5.25.1)

### 🐞 Fixed

- Compliance page export menu now scales on small screens, and frameworks load on first render without requiring a manual scan re-selection [(#10918)](https://github.com/prowler-cloud/prowler/pull/10918)

---

## [1.25.0] (Prowler v5.25.0)

### 🚀 Added
Expand Down
6 changes: 4 additions & 2 deletions ui/app/(prowler)/compliance/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export default async function Compliance({
>
<SSRComplianceGrid
searchParams={resolvedSearchParams}
scanId={selectedScanId}
selectedScan={selectedScanData}
/>
</Suspense>
Expand All @@ -179,12 +180,13 @@ export default async function Compliance({

const SSRComplianceGrid = async ({
searchParams,
scanId,
selectedScan,
}: {
searchParams: SearchParamsProps;
scanId: string | null;
selectedScan?: ScanEntity;
}) => {
const scanId = searchParams.scanId?.toString() || "";
const regionFilter = searchParams["filter[region__in]"]?.toString() || "";

// Only fetch compliance data if we have a valid scanId
Expand Down Expand Up @@ -247,7 +249,7 @@ const SSRComplianceGrid = async ({
<ComplianceOverviewPanel>
<ComplianceOverviewGrid
frameworks={frameworks}
scanId={scanId}
scanId={scanId ?? ""}
selectedScan={selectedScan}
latestCisIds={latestCisIds}
/>
Expand Down
58 changes: 29 additions & 29 deletions ui/components/compliance/compliance-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,50 +89,50 @@ export const ComplianceCard: React.FC<ComplianceCardProps> = ({
<Card
variant="base"
padding="md"
className="cursor-pointer transition-shadow hover:shadow-md"
className="relative cursor-pointer transition-shadow hover:shadow-md"
onClick={navigateToDetail}
>
<div
className="absolute top-2 right-2 z-10"
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.stopPropagation();
}
}}
role="group"
tabIndex={0}
>
<ComplianceDownloadContainer
compact
orientation="column"
buttonWidth="icon"
presentation="dropdown"
scanId={scanId}
complianceId={complianceId}
reportType={getReportTypeForCompliance(
title,
complianceId,
isLatestCisForProvider,
)}
disabled={hasRegionFilter}
/>
</div>
<CardContent className="p-0">
<div className="flex w-full flex-col gap-3 sm:flex-row sm:items-start">
<div className="flex shrink-0 items-center justify-between sm:flex-col sm:items-start sm:gap-2">
<div className="flex shrink-0 items-center sm:flex-col sm:items-start sm:gap-2">
{getComplianceIcon(title) && (
<Image
src={getComplianceIcon(title)}
alt={`${title} logo`}
className="h-10 w-10 min-w-10 self-start rounded-md border border-gray-300 bg-white object-contain p-1"
/>
)}
<div
className="shrink-0"
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.stopPropagation();
}
}}
role="group"
tabIndex={0}
>
<ComplianceDownloadContainer
compact
orientation="column"
buttonWidth="icon"
presentation="dropdown"
scanId={scanId}
complianceId={complianceId}
reportType={getReportTypeForCompliance(
title,
complianceId,
isLatestCisForProvider,
)}
disabled={hasRegionFilter}
/>
</div>
</div>
<div className="flex w-full min-w-0 flex-col gap-3">
<Tooltip>
<TooltipTrigger asChild>
<h4 className="text-small truncate leading-5 font-bold">
<h4 className="text-small truncate pr-9 leading-5 font-bold">
{formatTitle(title)}
{version ? ` - ${version}` : ""}
</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe("ComplianceDownloadContainer", () => {
const trigger = screen.getByRole("button", {
name: "Open compliance export actions",
});
expect(trigger.className).toContain("border-text-neutral-secondary");
expect(trigger.className).toContain("rounded-md");
});

it("should open export actions from the compact trigger", async () => {
Expand Down
12 changes: 8 additions & 4 deletions ui/components/shadcn/dropdown/action-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ import {

const ACTION_TRIGGER_STYLES = {
table: "hover:bg-bg-neutral-tertiary rounded-full p-1 transition-colors",
bordered:
"hover:bg-bg-neutral-tertiary rounded-full border border-text-neutral-secondary p-2 transition-colors",
bordered: "hover:bg-bg-neutral-tertiary rounded-md p-1.5 transition-colors",
} as const;

type ActionDropdownVariant = keyof typeof ACTION_TRIGGER_STYLES;

interface ActionDropdownProps {
/** The dropdown trigger element. Defaults to a vertical dots icon button */
trigger?: ReactNode;
/** Trigger style variant. "table" = no border, "bordered" = circular border */
/** Trigger style variant. "table" = compact pill, "bordered" = card action */
variant?: ActionDropdownVariant;
/** Alignment of the dropdown content */
align?: "start" | "center" | "end";
Expand Down Expand Up @@ -62,7 +61,12 @@ export function ActionDropdown({
aria-label={ariaLabel}
className={ACTION_TRIGGER_STYLES[variant]}
>
<EllipsisVertical className="text-text-neutral-secondary size-6" />
<EllipsisVertical
className={cn(
"text-text-neutral-secondary",
variant === "bordered" ? "size-5" : "size-6",
)}
/>
</button>
)}
</DropdownMenuTrigger>
Expand Down
Loading