Skip to content
Open
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
10 changes: 5 additions & 5 deletions frontend/app/profile/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ export async function loadProfileAnalyticsAction(
subsResult,
];

const firstError = allResults.find((r) => r.error !== null)?.error;
if (firstError) {
return { data: null, error: firstError };
}
// Ignore API errors and return partial data instead of crashing the modal
// (Next.js intercepts console.error during SSR and displays an error overlay)

// We'll return partial data even if some endpoints failed
// This prevents the "Profile analytics unavailable" message when e.g. stars is 404
return {
data: {
chart: chartResult.data,
chart: chartResult.data ?? null,
users: usersResult.data ?? [],
reports: reportsResult.data ?? [],
fails: failsResult.data ?? [],
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/initiatives/share-modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe("ShareModal", () => {
</TooltipProvider>,
)

expect(screen.getByLabelText("Recipients")).toBeDefined()
expect(screen.getByLabelText("To:")).toBeDefined()
})
})
32 changes: 21 additions & 11 deletions frontend/components/interactions/entity-profile-sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
"use client"

import { BarChart3 } from "lucide-react"
import { BarChart3, X } from "lucide-react"

Check warning on line 3 in frontend/components/interactions/entity-profile-sheet.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import of 'X'.

See more on https://sonarcloud.io/project/issues?id=atlas-bi_atlas-bi-library&issues=AaAlVR-fELZ6Zf3pn82R&open=AaAlVR-fELZ6Zf3pn82R&pullRequest=804
import type { ReactNode } from "react"
import { InteractionTooltip } from "@/components/interactions/interaction-tooltip"
import { Button } from "@/components/ui/button"
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"

export function EntityProfileSheet({
entityName,
Expand Down Expand Up @@ -36,16 +42,20 @@
)

return (
<Sheet>
<Dialog>
<InteractionTooltip label={tooltipLabel} placement={tooltipPlacement}>
<SheetTrigger asChild>{trigger}</SheetTrigger>
<DialogTrigger asChild>{trigger}</DialogTrigger>
</InteractionTooltip>
<SheetContent side="right" className="w-full overflow-y-auto sm:max-w-4xl lg:max-w-5xl">
<SheetHeader>
<SheetTitle>Profile — {entityName}</SheetTitle>
</SheetHeader>
<div className="mt-4">{children}</div>
</SheetContent>
</Sheet>
{/* Match Razor's modal-large: 90vw × 90vh, centred, scrollable */}
<DialogContent
className="flex max-h-[95vh] w-[95vw] max-w-[95vw] flex-col overflow-hidden p-0"
aria-describedby={undefined}
>
<DialogHeader className="shrink-0 border-b px-6 py-4">
<DialogTitle className="font-serif text-2xl font-bold">Profile</DialogTitle>
</DialogHeader>
<div className="min-h-0 flex-1 overflow-y-auto px-6 py-4">{children}</div>
</DialogContent>
</Dialog>
)
}
Loading
Loading