From dccebbc21bc587d429ce7a5e1661c52a19a97c51 Mon Sep 17 00:00:00 2001 From: "Kuchenik, Venessa J" Date: Thu, 6 Aug 2026 14:58:12 +0000 Subject: [PATCH] Update viewing format of ivans summary and pdf --- client/src/components/Widgets/IvansAlerts.jsx | 156 ++++++++---------- client/src/constants/widgetRegistry.jsx | 3 +- 2 files changed, 67 insertions(+), 92 deletions(-) diff --git a/client/src/components/Widgets/IvansAlerts.jsx b/client/src/components/Widgets/IvansAlerts.jsx index d669a72..1464711 100644 --- a/client/src/components/Widgets/IvansAlerts.jsx +++ b/client/src/components/Widgets/IvansAlerts.jsx @@ -1,11 +1,10 @@ -import VdapApi from '../../hooks/useVdapApi.js'; -import {Button, Dialog, Flex, Portal, Spinner, Text} from "@chakra-ui/react"; -import {useEffect, useMemo, useState } from 'react'; +import {Button, Flex, Spinner, Text, Box, Collapsible} from "@chakra-ui/react"; +import {useEffect, useMemo } from 'react'; import {useDashboardStore} from "@/store/useDashboardStore.jsx"; +import VdapApi from '../../hooks/useVdapApi.js'; export default function IvansAlerts({ settings, widgetID }) { console.log("IvansAlerts widget ID: ", widgetID); - const [activeSummaryItem, setActiveSummaryItem] = useState(false); const updateSettings = useDashboardStore(state => state.updateWidgetSettings); const isCopy = settings?.copyToClipboard === true; // acts as a fail-safe if no default setting is set const sorts = settings?.activeSorts; @@ -122,13 +121,13 @@ export default function IvansAlerts({ settings, widgetID }) { }, [isCopy, data, widgetID, updateSettings]); if (isLoading) return ( - + ); if (error) return ( - + {error} ); @@ -140,98 +139,75 @@ export default function IvansAlerts({ settings, widgetID }) { ); return ( - + {data.map((item, index) => { return ( - /* IVANS ENTRIES */ - setActiveSummaryItem(item)} w="100%" h="100%" key={index} borderRadius="lg" bg="gray.700" justify="space-between" align="center"> - - {item.volcano_name} - {item.send_time} - - - {item.report_num} - - + + + {(collapsible) => ( + <> + + + + {item.volcano_name} + {item.send_time} + + + {item.report_num} + + + + + + {item?.summary} +
+ {item?.files?.map((file, index) => { + return ( + <> + + + + Your browser cannot display this PDF directly. + + + Download PDF + + + +
+ + )})} +
+
+ + )} +
+
) })} - {/* SUMMARY/PDF VIEWER */} - setActiveSummaryItem(null)} - item={activeSummaryItem} - />
); } -function SummaryDialog({ open, onOpenChange, item }) { - return ( - - - - - - - - - {item?.volcano_name} - - - {item?.send_time} - - - - - prepared by: {item?.preparer} - - - - - - - - {item?.summary} -
- {item?.files?.map((file, index) => { - return ( - <> - - - - Your browser cannot display this PDF directly. - - - Download PDF - - - -
- - )})} -
- - - - -
-
-
- ) -} function ascTimeVolcanoSort(a, b) { if (a.volcano_name < b.volcano_name) return -1 diff --git a/client/src/constants/widgetRegistry.jsx b/client/src/constants/widgetRegistry.jsx index abb0d68..39b63f1 100644 --- a/client/src/constants/widgetRegistry.jsx +++ b/client/src/constants/widgetRegistry.jsx @@ -53,8 +53,7 @@ export const WIDGET_REGISTRY = { allowedSizes: { small: { w: 3, h: 6 }, medium: { w: 3, h: 9 }, - large: { w: 3, h: 12 }, - gargantuan: { w: 6, h: 12 }, + large: { w: 6, h: 9 }, } },