Skip to content

Commit 3c78ad0

Browse files
committed
Merge branch 'r/19.x' into develop
2 parents aac3259 + 75d30f3 commit 3c78ad0

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

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

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

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
getModalPage,
2626
getEventDetailsTobiraDataError,
2727
getEventDetailsTobiraStatus,
28+
getWorkflows,
2829
} from "../../../../selectors/eventDetailsSelectors";
2930
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
3031
import EventDetailsStatisticsTab from "../ModalTabsAndPages/EventDetailsStatisticsTab";
@@ -135,6 +136,7 @@ const EventDetails = ({
135136
const captureAgents = useAppSelector(state => getRecordings(state));
136137
const tobiraStatus = useAppSelector(state => getEventDetailsTobiraStatus(state));
137138
const tobiraError = useAppSelector(state => getEventDetailsTobiraDataError(state));
139+
const workflows = useAppSelector(state => getWorkflows(state));
138140

139141
const tabs: {
140142
tabNameTranslation: ParseKeys,
@@ -314,7 +316,7 @@ const EventDetails = ({
314316
formikRef={formikRef}
315317
/>
316318
)}
317-
{page === EventDetailsPage.Workflow && !hasSchedulingProperties &&
319+
{page === EventDetailsPage.Workflow && !workflows.scheduling &&
318320
((workflowTabHierarchy === "workflows" && (
319321
<EventDetailsWorkflowTab
320322
eventId={eventId}
@@ -338,7 +340,7 @@ const EventDetails = ({
338340
eventId={eventId}
339341
/>
340342
)))}
341-
{page === EventDetailsPage.Workflow && hasSchedulingProperties &&
343+
{page === EventDetailsPage.Workflow && workflows.scheduling &&
342344
<EventDetailsWorkflowSchedulingTab
343345
eventId={eventId}
344346
formikRef={formikRef}

src/components/shared/Stats.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
removeTextFilter,
1111
} from "../../slices/tableFilterSlice";
1212
import { loadEventsIntoTable } from "../../thunks/tableThunks";
13+
import { setOffset, setPageActive } from "../../slices/tableSlice";
1314
import { useAppDispatch, useAppSelector } from "../../store";
1415
import { fetchEvents } from "../../slices/eventSlice";
1516
import { ParseKeys } from "i18next";
@@ -39,6 +40,9 @@ const Stats = () => {
3940
const filter = filterMap.find(({ name }) => name === f.name);
4041
filterValue = f.value;
4142
if (filter) {
43+
// go to first page without reloading all events
44+
dispatch(setOffset(0));
45+
dispatch(setPageActive(0));
4246
dispatch(editFilterValue({ filterName: filter.name, value: filterValue, resource: "events" }));
4347
}
4448
});

src/components/shared/wizard/RenderField.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ const EditableSingleSelect = (props: EditableSingleSelectProps) => {
228228
metadataField={metadataField}
229229
text={text}
230230
form={form}
231+
options={
232+
metadataField.collection
233+
? metadataField.collection.map(item => ({
234+
label: item.label ?? item.name,
235+
value: item.value,
236+
order: item.order,
237+
}))
238+
: []
239+
}
231240
isFirstField={isFirstField}
232241
focused={focused}
233242
setFocused={setFocused}

0 commit comments

Comments
 (0)