Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ const EventDetailsWorkflowDetails = ({
if (!workflowId) {
dispatch(fetchWorkflows(eventId)).unwrap()
.then(workflows => {
const currentWorkflow = workflows.entries[workflows.entries.length - 1];
dispatch(fetchWorkflowDetails({ eventId, workflowId: currentWorkflow.id }));
dispatch(setModalWorkflowId(currentWorkflow.id));
if (workflows.entries.length > 0) {
const currentWorkflow = workflows.entries[workflows.entries.length - 1];
dispatch(fetchWorkflowDetails({ eventId, workflowId: currentWorkflow.id }));
dispatch(setModalWorkflowId(currentWorkflow.id));
}
},
);
} else {
Expand Down
6 changes: 4 additions & 2 deletions src/components/events/partials/modals/EventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getModalPage,
getEventDetailsTobiraDataError,
getEventDetailsTobiraStatus,
getWorkflows,
} from "../../../../selectors/eventDetailsSelectors";
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
import EventDetailsStatisticsTab from "../ModalTabsAndPages/EventDetailsStatisticsTab";
Expand Down Expand Up @@ -134,6 +135,7 @@ const EventDetails = ({
const captureAgents = useAppSelector(state => getRecordings(state));
const tobiraStatus = useAppSelector(state => getEventDetailsTobiraStatus(state));
const tobiraError = useAppSelector(state => getEventDetailsTobiraDataError(state));
const workflows = useAppSelector(state => getWorkflows(state));

const tabs: {
tabNameTranslation: ParseKeys,
Expand Down Expand Up @@ -277,7 +279,7 @@ const EventDetails = ({
formikRef={formikRef}
/>
)}
{page === EventDetailsPage.Workflow && !hasSchedulingProperties &&
{page === EventDetailsPage.Workflow && !workflows.scheduling &&
((workflowTabHierarchy === "workflows" && (
<EventDetailsWorkflowTab
eventId={eventId}
Expand All @@ -301,7 +303,7 @@ const EventDetails = ({
eventId={eventId}
/>
)))}
{page === EventDetailsPage.Workflow && hasSchedulingProperties &&
{page === EventDetailsPage.Workflow && workflows.scheduling &&
<EventDetailsWorkflowSchedulingTab
eventId={eventId}
formikRef={formikRef}
Expand Down