diff --git a/client/modules/_hooks/src/workspace/useInteractiveModalContext.ts b/client/modules/_hooks/src/workspace/useInteractiveModalContext.ts index c28b542548..f896c28bf4 100644 --- a/client/modules/_hooks/src/workspace/useInteractiveModalContext.ts +++ b/client/modules/_hooks/src/workspace/useInteractiveModalContext.ts @@ -5,6 +5,7 @@ type TInteractiveModalDetails = { interactiveSessionLink?: string; message?: string; openedBySubmit?: boolean; + uuid?: string; }; export type TInteractiveModalContext = [ diff --git a/client/modules/workspace/src/AppsSubmissionForm/AppsSubmissionForm.tsx b/client/modules/workspace/src/AppsSubmissionForm/AppsSubmissionForm.tsx index 737ff9479e..92eda37da7 100644 --- a/client/modules/workspace/src/AppsSubmissionForm/AppsSubmissionForm.tsx +++ b/client/modules/workspace/src/AppsSubmissionForm/AppsSubmissionForm.tsx @@ -379,7 +379,11 @@ export const AppsSubmissionForm: React.FC = () => { } else if (isSuccess) { reset(initialValues); if (definition.notes.isInteractive) { - setInteractiveModalDetails({ show: true, openedBySubmit: true }); + setInteractiveModalDetails({ + show: true, + openedBySubmit: true, + uuid: submitResult.uuid, + }); } } }, [submitResult]); diff --git a/client/modules/workspace/src/JobsDetailModal/JobsDetailModal.tsx b/client/modules/workspace/src/JobsDetailModal/JobsDetailModal.tsx index dc29a3d517..9fa9ff0cd0 100644 --- a/client/modules/workspace/src/JobsDetailModal/JobsDetailModal.tsx +++ b/client/modules/workspace/src/JobsDetailModal/JobsDetailModal.tsx @@ -80,6 +80,7 @@ export const JobsDetailModalBody: React.FC<{ > ), ...(jobData.remoteOutcome && { 'Remote Outcome': jobData.remoteOutcome }), + ...(jobData.remoteJobId && { 'Remote Job ID': jobData.remoteJobId }), }; if (jobData.remoteOutcome) { diff --git a/client/modules/workspace/src/JobsListing/JobsListing.tsx b/client/modules/workspace/src/JobsListing/JobsListing.tsx index 36b4d637db..398d69cf4a 100644 --- a/client/modules/workspace/src/JobsListing/JobsListing.tsx +++ b/client/modules/workspace/src/JobsListing/JobsListing.tsx @@ -75,6 +75,7 @@ const InteractiveSessionButtons: React.FC<{ show: true, interactiveSessionLink, message, + uuid: uuid, }) } > diff --git a/client/modules/workspace/src/Toast/Toast.tsx b/client/modules/workspace/src/Toast/Toast.tsx index f45292c9ac..b8941eb95c 100644 --- a/client/modules/workspace/src/Toast/Toast.tsx +++ b/client/modules/workspace/src/Toast/Toast.tsx @@ -11,7 +11,7 @@ import { useInteractiveModalContext, TInteractiveModalContext, } from '@client/hooks'; -import { getToastMessage } from '../utils'; +import { getToastMessage, isTerminalState } from '../utils'; import styles from './Notifications.module.css'; const Notifications = () => { @@ -63,6 +63,17 @@ const Notifications = () => { navigate('/history'); }, }); + + // close interactive session modal if job is ended + if ( + isTerminalState(notification.extra.status) && + notification.extra.uuid === interactiveModalDetails.uuid + ) { + setInteractiveModalDetails({ + show: false, + }); + } + break; case 'markAllNotificationsAsRead': // update unread count state