@@ -13,6 +13,7 @@ import workflowHistoryEventFilteringTypeColorsConfig from '../config/workflow-hi
1313import generateHistoryGroupDetails from '../helpers/generate-history-group-details' ;
1414import WorkflowHistoryDetailsRow from '../workflow-history-details-row/workflow-history-details-row' ;
1515import getEventGroupFilteringType from '../workflow-history-event-group/helpers/get-event-group-filtering-type' ;
16+ import getSummaryTabContentEntry from '../workflow-history-event-group/helpers/get-summary-tab-content-entry' ;
1617import getFormattedEventsDuration from '../workflow-history-event-group-duration/helpers/get-formatted-events-duration' ;
1718import WorkflowHistoryGroupDetails from '../workflow-history-group-details/workflow-history-group-details' ;
1819
@@ -50,6 +51,33 @@ export default function WorkflowHistoryUngroupedEvent({
5051 ( [ eventId ] ) => eventId === eventInfo . id
5152 ) ?. [ 1 ] . eventDetails ;
5253
54+ const groupSummaryDetails = useMemo (
55+ ( ) =>
56+ summaryDetailsEntries . flatMap (
57+ ( [ _eventId , { eventDetails } ] ) => eventDetails
58+ ) ,
59+ [ summaryDetailsEntries ]
60+ ) ;
61+
62+ const groupDetailsEntriesWithSummary = useMemo (
63+ ( ) => [
64+ ...( groupSummaryDetails . length > 0 && groupDetailsEntries . length > 1
65+ ? [
66+ getSummaryTabContentEntry ( {
67+ groupId : eventInfo . eventGroup . firstEventId ?? 'unknown' ,
68+ summaryDetails : groupSummaryDetails ,
69+ } ) ,
70+ ]
71+ : [ ] ) ,
72+ ...groupDetailsEntries ,
73+ ] ,
74+ [
75+ eventInfo . eventGroup . firstEventId ,
76+ groupDetailsEntries ,
77+ groupSummaryDetails ,
78+ ]
79+ ) ;
80+
5381 return (
5482 < Panel
5583 title = {
@@ -119,19 +147,7 @@ export default function WorkflowHistoryUngroupedEvent({
119147 < styled . GroupDetailsNameSpacer />
120148 < styled . GroupDetailsContainer >
121149 < WorkflowHistoryGroupDetails
122- groupDetailsEntries = { [
123- [
124- `summary_${ eventInfo . eventGroup . firstEventId } ` ,
125- {
126- eventDetails : summaryDetailsEntries . flatMap (
127- ( [ _ , eventSummaryDetails ] ) =>
128- eventSummaryDetails . eventDetails
129- ) ,
130- eventLabel : 'Summary' ,
131- } ,
132- ] ,
133- ...groupDetailsEntries ,
134- ] }
150+ groupDetailsEntries = { groupDetailsEntriesWithSummary }
135151 initialEventId = { eventInfo . id }
136152 workflowPageParams = { decodedPageUrlParams }
137153 onClose = { ( ) => toggleIsExpanded ( ) }
0 commit comments