From a3aa0b7bf3be9edcee0da226800a719fdb9f60b9 Mon Sep 17 00:00:00 2001 From: hailey Date: Fri, 29 May 2026 10:23:11 -0700 Subject: [PATCH] [osprey-ui] fix Safari "See details" popup auto-close (#289) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- osprey_ui/package-lock.json | 14 -------------- osprey_ui/package.json | 1 - .../event_stream/EventStreamCard.tsx | 18 +++--------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/osprey_ui/package-lock.json b/osprey_ui/package-lock.json index 430fabb..f8bcde5 100644 --- a/osprey_ui/package-lock.json +++ b/osprey_ui/package-lock.json @@ -32,7 +32,6 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-infinite-scroller": "1.2.4", - "react-new-window": "0.1.2", "react-router": "5.2.0", "react-router-dom": "5.2.0", "react-scripts": "5.0.1", @@ -18221,19 +18220,6 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", "license": "MIT" }, - "node_modules/react-new-window": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/react-new-window/-/react-new-window-0.1.2.tgz", - "integrity": "sha512-KfjR6QupGf4UZCK7ittUE7r53eOax9mw0ODQIhDSxu4dzxWgeE9y95MRs8Dr9m/F7Plm3LUvccO5yGbg3619yA==", - "license": "MIT", - "dependencies": { - "prop-types": "^15.7.2" - }, - "peerDependencies": { - "react": "^16.0.0", - "react-dom": "^16.0.0" - } - }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", diff --git a/osprey_ui/package.json b/osprey_ui/package.json index e9e479e..21c3af0 100644 --- a/osprey_ui/package.json +++ b/osprey_ui/package.json @@ -27,7 +27,6 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-infinite-scroller": "1.2.4", - "react-new-window": "0.1.2", "react-router": "5.2.0", "react-router-dom": "5.2.0", "react-scripts": "5.0.1", diff --git a/osprey_ui/src/components/event_stream/EventStreamCard.tsx b/osprey_ui/src/components/event_stream/EventStreamCard.tsx index 25b3ba5..3fc1853 100644 --- a/osprey_ui/src/components/event_stream/EventStreamCard.tsx +++ b/osprey_ui/src/components/event_stream/EventStreamCard.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { Empty } from 'antd'; -import NewWindow from 'react-new-window'; import { useParams } from 'react-router-dom'; import useApplicationConfigStore from '../../stores/ApplicationConfigStore'; @@ -26,18 +25,14 @@ interface EventStreamCardProps { } const EventStreamCard = ({ eventDetails, selectedFeatures, featureLocations, isListView }: EventStreamCardProps) => { - const [showWindow, setShowWindow] = React.useState(false); const { entityId, entityType } = useParams(); const decodedEntityId = entityId != null ? decodeURIComponent(entityId) : null; const decodedEntityType = entityType != null ? decodeURIComponent(entityType) : null; const featureNameToEntityTypeMapping = useApplicationConfigStore((state) => state.featureNameToEntityTypeMapping); + const eventUrl = `${document.location.origin}/events/${encodeURIComponent(eventDetails.id)}`; const handleShowWindow = () => { - setShowWindow(true); - }; - - const handleWindowClose = () => { - setShowWindow(false); + window.open(eventUrl, '_blank', 'width=800,height=800'); }; const renderDescriptionBlock = (features: readonly string[]) => { @@ -85,8 +80,6 @@ const EventStreamCard = ({ eventDetails, selectedFeatures, featureLocations, isL ); }; - const eventUrl = `${document.location.origin}/events/${eventDetails.id}`; - const cardTitle = (
{cardTitle} - - See Details - {showWindow && ( - - )} - + See Details
{renderContent()}
-- 2.51.2