mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 11:51:12 -05:00
Refactor: Database and UI updates
This commit is contained in:
@@ -304,10 +304,15 @@ export const SystemActivityLog = forwardRef<SystemActivityLogRef, SystemActivity
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{isExpanded && details.details && (
|
||||
<pre className="text-xs bg-muted p-2 rounded overflow-auto">
|
||||
{JSON.stringify(details.details, null, 2)}
|
||||
</pre>
|
||||
{isExpanded && details.admin_audit_details && details.admin_audit_details.length > 0 && (
|
||||
<div className="space-y-1 text-xs bg-muted p-2 rounded">
|
||||
{details.admin_audit_details.map((detail: any) => (
|
||||
<div key={detail.id} className="flex gap-2">
|
||||
<strong className="text-muted-foreground min-w-[100px]">{detail.detail_key}:</strong>
|
||||
<span>{detail.detail_value}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -179,29 +179,30 @@ export const QueueItem = memo(({
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{item.content.photos && item.content.photos.length > 0 && (() => {
|
||||
const reviewPhotos: PhotoItem[] = normalizePhotoData({
|
||||
type: 'review',
|
||||
photos: item.content.photos
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mt-3">
|
||||
<div className="text-sm font-medium mb-2">Attached Photos:</div>
|
||||
<PhotoGrid
|
||||
photos={reviewPhotos}
|
||||
onPhotoClick={(photos, index) => onOpenPhotos(photos as any, index)}
|
||||
maxDisplay={isMobile ? 3 : 4}
|
||||
className="grid-cols-2 md:grid-cols-3"
|
||||
/>
|
||||
{item.content.photos[0]?.caption && (
|
||||
<p className="text-sm text-muted-foreground mt-2">
|
||||
{item.content.photos[0].caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
{/* Review photos are now in relational review_photos table, not JSONB */}
|
||||
{item.review_photos && item.review_photos.length > 0 && (
|
||||
<div className="mt-3">
|
||||
<div className="text-sm font-medium mb-2">Attached Photos:</div>
|
||||
<PhotoGrid
|
||||
photos={item.review_photos.map(photo => ({
|
||||
id: photo.id,
|
||||
url: photo.url,
|
||||
filename: photo.url.split('/').pop() || 'photo.jpg',
|
||||
caption: photo.caption || undefined,
|
||||
title: undefined,
|
||||
order: photo.order_index
|
||||
}))}
|
||||
onPhotoClick={(photos, index) => onOpenPhotos(photos as any, index)}
|
||||
maxDisplay={isMobile ? 3 : 4}
|
||||
className="grid-cols-2 md:grid-cols-3"
|
||||
/>
|
||||
{item.review_photos[0]?.caption && (
|
||||
<p className="text-sm text-muted-foreground mt-2">
|
||||
{item.review_photos[0].caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : item.submission_type === 'photo' ? (
|
||||
<PhotoSubmissionDisplay
|
||||
|
||||
@@ -2568,6 +2568,7 @@ export type Database = {
|
||||
display_name: string | null
|
||||
home_park_id: string | null
|
||||
id: string
|
||||
is_test_data: boolean
|
||||
location_id: string | null
|
||||
oauth_provider: string | null
|
||||
park_count: number | null
|
||||
@@ -2602,6 +2603,7 @@ export type Database = {
|
||||
display_name?: string | null
|
||||
home_park_id?: string | null
|
||||
id?: string
|
||||
is_test_data?: boolean
|
||||
location_id?: string | null
|
||||
oauth_provider?: string | null
|
||||
park_count?: number | null
|
||||
@@ -2636,6 +2638,7 @@ export type Database = {
|
||||
display_name?: string | null
|
||||
home_park_id?: string | null
|
||||
id?: string
|
||||
is_test_data?: boolean
|
||||
location_id?: string | null
|
||||
oauth_provider?: string | null
|
||||
park_count?: number | null
|
||||
|
||||
@@ -42,6 +42,12 @@ export interface AdminActionDetails {
|
||||
target_user_id?: string;
|
||||
target_username?: string;
|
||||
details?: Record<string, any>;
|
||||
/** Relational audit details from admin_audit_details table */
|
||||
admin_audit_details?: Array<{
|
||||
id: string;
|
||||
detail_key: string;
|
||||
detail_value: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface SubmissionReviewDetails {
|
||||
|
||||
@@ -261,6 +261,14 @@ export interface ModerationItem {
|
||||
|
||||
/** Pre-loaded submission items with entity data from view */
|
||||
submission_items?: SubmissionItem[];
|
||||
|
||||
/** Pre-loaded review photos from relational review_photos table */
|
||||
review_photos?: Array<{
|
||||
id: string;
|
||||
url: string;
|
||||
caption?: string | null;
|
||||
order_index: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user