Skip to content

Commit 023124e

Browse files
authored
Merge pull request #1475 from snoesberger/1474-fix-recordings-wf-info
Fix workflow tab for recordings
2 parents a2b63b8 + f87121b commit 023124e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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)