Skip to content

Commit 3c6cb24

Browse files
committed
Fix workflow tab for recordings
During processing and after the publication of a recording, the event details tab does not show any information about running or completed workflows. With this PR the workflow tab shows again all workflow information for recordings, just as it does for manually uploaded videos.
1 parent 0fc7293 commit 3c6cb24

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ const EventDetailsWorkflowDetails = ({
4949
if (!workflowId) {
5050
dispatch(fetchWorkflows(eventId)).unwrap()
5151
.then(workflows => {
52-
const currentWorkflow = workflows.entries[workflows.entries.length - 1];
53-
dispatch(fetchWorkflowDetails({ eventId, workflowId: currentWorkflow.id }));
54-
dispatch(setModalWorkflowId(currentWorkflow.id));
52+
if (workflows.entries.length > 0) {
53+
const currentWorkflow = workflows.entries[workflows.entries.length - 1];
54+
dispatch(fetchWorkflowDetails({ eventId, workflowId: currentWorkflow.id }));
55+
dispatch(setModalWorkflowId(currentWorkflow.id));
56+
}
5557
},
5658
);
5759
} else {

src/components/events/partials/modals/EventDetails.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
getModalPage,
2727
getEventDetailsTobiraDataError,
2828
getEventDetailsTobiraStatus,
29+
getWorkflows,
2930
} from "../../../../selectors/eventDetailsSelectors";
3031
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
3132
import EventDetailsStatisticsTab from "../ModalTabsAndPages/EventDetailsStatisticsTab";
@@ -134,6 +135,7 @@ const EventDetails = ({
134135
const captureAgents = useAppSelector(state => getRecordings(state));
135136
const tobiraStatus = useAppSelector(state => getEventDetailsTobiraStatus(state));
136137
const tobiraError = useAppSelector(state => getEventDetailsTobiraDataError(state));
138+
const workflows = useAppSelector(state => getWorkflows(state));
137139

138140
const tabs: {
139141
tabNameTranslation: ParseKeys,
@@ -277,7 +279,7 @@ const EventDetails = ({
277279
formikRef={formikRef}
278280
/>
279281
)}
280-
{page === EventDetailsPage.Workflow && !hasSchedulingProperties &&
282+
{page === EventDetailsPage.Workflow && !workflows.scheduling &&
281283
((workflowTabHierarchy === "workflows" && (
282284
<EventDetailsWorkflowTab
283285
eventId={eventId}
@@ -301,7 +303,7 @@ const EventDetails = ({
301303
eventId={eventId}
302304
/>
303305
)))}
304-
{page === EventDetailsPage.Workflow && hasSchedulingProperties &&
306+
{page === EventDetailsPage.Workflow && workflows.scheduling &&
305307
<EventDetailsWorkflowSchedulingTab
306308
eventId={eventId}
307309
formikRef={formikRef}

0 commit comments

Comments
 (0)