diff --git a/client/src/components/Jobs/JobsSessionModal/JobsSessionModal.jsx b/client/src/components/Jobs/JobsSessionModal/JobsSessionModal.jsx index bb0827877..9fbd2e06f 100644 --- a/client/src/components/Jobs/JobsSessionModal/JobsSessionModal.jsx +++ b/client/src/components/Jobs/JobsSessionModal/JobsSessionModal.jsx @@ -4,7 +4,12 @@ import { bool, func, string } from 'prop-types'; import './JobsSessionModal.global.scss'; import styles from './JobsSessionModal.module.scss'; -const JobsSessionModal = ({ isOpen, toggle, interactiveSessionLink }) => { +const JobsSessionModal = ({ + isOpen, + toggle, + interactiveSessionLink, + message, +}) => { return ( { Click the button below to connect to the interactive session. + {message && {message}} To end the job, quit the application within the session. Files may take some time to appear in the output location after the diff --git a/client/src/components/Jobs/JobsStatus/JobsStatus.jsx b/client/src/components/Jobs/JobsStatus/JobsStatus.jsx index e162a3a77..4f5ec2291 100644 --- a/client/src/components/Jobs/JobsStatus/JobsStatus.jsx +++ b/client/src/components/Jobs/JobsStatus/JobsStatus.jsx @@ -72,6 +72,7 @@ function JobsStatus({ status, fancy, jobUuid }) { const notifs = useSelector((state) => state.notifications.list.notifs); let interactiveSessionLink; + let message; const jobConcluded = isTerminalState(status) || status === 'ARCHIVING'; @@ -85,6 +86,7 @@ function JobsStatus({ status, fancy, jobUuid }) { ); const notif = interactiveNotifs.find((n) => n.extra.uuid === jobUuid); interactiveSessionLink = notif ? notif.action_link : null; + message = notif ? notif.message : null; } return ( @@ -109,6 +111,7 @@ function JobsStatus({ status, fancy, jobUuid }) { toggle={toggleModal} isOpen={modal} interactiveSessionLink={interactiveSessionLink} + message={message} /> )} diff --git a/server/portal/apps/projects/workspace_operations/shared_workspace_migration.py b/server/portal/apps/projects/workspace_operations/shared_workspace_migration.py index 6bf6d4ec8..58cd57e3f 100644 --- a/server/portal/apps/projects/workspace_operations/shared_workspace_migration.py +++ b/server/portal/apps/projects/workspace_operations/shared_workspace_migration.py @@ -62,7 +62,11 @@ def migrate_project(project_id): for co_pi in v2_project.co_pis.all(): v2_role = get_role(project_id, co_pi.username) - v3_role = ROLE_MAP[v2_role] + try: + v3_role = ROLE_MAP[v2_role] + except KeyError: + print(f'ERROR: No role found for: {v2_role}') + v3_role = "reader" try: add_user_to_workspace(client, project_id, co_pi.username, v3_role) except NotFoundError: @@ -71,7 +75,11 @@ def migrate_project(project_id): for team_member in v2_project.team_members.all(): v2_role = get_role(project_id, team_member.username) - v3_role = ROLE_MAP[v2_role] + try: + v3_role = ROLE_MAP[v2_role] + except KeyError: + print(f'ERROR: No role found for: {v2_role}') + v3_role = "reader" try: add_user_to_workspace(client, project_id, team_member.username, v3_role) except NotFoundError: diff --git a/server/portal/apps/webhooks/views.py b/server/portal/apps/webhooks/views.py index 54544b23d..f38430c1b 100644 --- a/server/portal/apps/webhooks/views.py +++ b/server/portal/apps/webhooks/views.py @@ -161,6 +161,7 @@ def post(self, request, *args, **kwargs): job_uuid = request.POST.get('job_uuid', None) job_owner = request.POST.get('owner', None) address = request.POST.get('address', None) + message = request.POST.get('message', None) if not address: msg = "Missing required interactive webhook parameter: address" @@ -174,6 +175,9 @@ def post(self, request, *args, **kwargs): Notification.ACTION_LINK: address } + if message: + event_data[Notification.MESSAGE] = message + # confirm that there is a corresponding running tapis job before sending notification try: valid_state = validate_tapis_job(job_uuid, job_owner, TERMINAL_JOB_STATES)