@@ -160,7 +160,9 @@ function FrameworkViewContent({
|
|||||||
name: categoryName,
|
name: categoryName,
|
||||||
description: `Controls related to ${categoryName.toLowerCase()}`,
|
description: `Controls related to ${categoryName.toLowerCase()}`,
|
||||||
progress: progress,
|
progress: progress,
|
||||||
controls: categoryControls,
|
controls: categoryControls.sort((a, b) =>
|
||||||
|
(a.name || "").localeCompare(b.name || "")
|
||||||
|
),
|
||||||
doneCount: catDoneCount,
|
doneCount: catDoneCount,
|
||||||
totalCount: catTotalCount,
|
totalCount: catTotalCount,
|
||||||
};
|
};
|
||||||
@@ -188,7 +190,6 @@ function FrameworkViewContent({
|
|||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title={framework.name ?? ""}
|
title={framework.name ?? ""}
|
||||||
description={framework.description ?? ""}
|
|
||||||
actions={
|
actions={
|
||||||
<div className="flex gap-4">
|
<div className="flex gap-4">
|
||||||
<Button variant="outline" asChild>
|
<Button variant="outline" asChild>
|
||||||
@@ -327,36 +328,25 @@ function FrameworkViewContent({
|
|||||||
className="border rounded-lg overflow-hidden"
|
className="border rounded-lg overflow-hidden"
|
||||||
>
|
>
|
||||||
<Card className="border-0 shadow-none">
|
<Card className="border-0 shadow-none">
|
||||||
<CardHeader className="bg-muted/50 pb-4">
|
<CardHeader
|
||||||
|
className="bg-muted/50 cursor-pointer"
|
||||||
|
onClick={() => toggleCategory(category.id)}
|
||||||
|
>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<CardTitle>{category.name}</CardTitle>
|
<CardTitle>{category.name}</CardTitle>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center text-sm text-muted-foreground">
|
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||||
<span>
|
<span>
|
||||||
{category.doneCount} / {category.totalCount}
|
{category.doneCount} / {category.totalCount}
|
||||||
</span>
|
</span>
|
||||||
|
{isExpanded ? (
|
||||||
|
<ChevronDown className="h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ChevronRight className="h-4 w-4" />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
className="mt-4 w-full flex items-center justify-center gap-2"
|
|
||||||
onClick={() => toggleCategory(category.id)}
|
|
||||||
>
|
|
||||||
{isExpanded ? (
|
|
||||||
<>
|
|
||||||
<ChevronDown className="h-4 w-4" />
|
|
||||||
Hide Controls
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<ChevronRight className="h-4 w-4" />
|
|
||||||
View Controls ({category.controls.length})
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
{isExpanded && (
|
{isExpanded && (
|
||||||
@@ -404,9 +394,6 @@ function FrameworkViewContent({
|
|||||||
<div className="font-medium">
|
<div className="font-medium">
|
||||||
{control.name}
|
{control.name}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-sm text-muted-foreground">
|
|
||||||
{control.description}
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user