Skip to content

Commit dc28e0e

Browse files
[APM] Trace timeline: Multi-fold function doesn't update when all accordions are collapsed or expanded (#76899)
* update outside state when expanding or collapsing the entry transaction * reverting icons
1 parent 2f1c012 commit dc28e0e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/accordion_waterfall.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ interface AccordionWaterfallProps {
2525
location: Location;
2626
errorsPerTransaction: IWaterfall['errorsPerTransaction'];
2727
childrenByParentId: Record<string, IWaterfallItem[]>;
28-
onToggleEntryTransaction?: (
29-
nextState: EuiAccordionProps['forceState']
30-
) => void;
28+
onToggleEntryTransaction?: () => void;
3129
timelineMargins: Margins;
3230
onClickWaterfallItem: (item: IWaterfallItem) => void;
3331
}
@@ -106,6 +104,7 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) {
106104
errorsPerTransaction,
107105
timelineMargins,
108106
onClickWaterfallItem,
107+
onToggleEntryTransaction,
109108
} = props;
110109

111110
const nextLevel = level + 1;
@@ -147,7 +146,12 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) {
147146
arrowDisplay={isEmpty(children) ? 'none' : 'left'}
148147
initialIsOpen={true}
149148
forceState={isOpen ? 'open' : 'closed'}
150-
onToggle={() => setIsOpen((isCurrentOpen) => !isCurrentOpen)}
149+
onToggle={() => {
150+
setIsOpen((isCurrentOpen) => !isCurrentOpen);
151+
if (onToggleEntryTransaction) {
152+
onToggleEntryTransaction();
153+
}
154+
}}
151155
>
152156
{children.map((child) => (
153157
<AccordionWaterfall

x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export function Waterfall({
109109
onClickWaterfallItem={(item: IWaterfallItem) =>
110110
toggleFlyout({ history, item, location })
111111
}
112+
onToggleEntryTransaction={() => setIsAccordionOpen((isOpen) => !isOpen)}
112113
/>
113114
);
114115
}

0 commit comments

Comments
 (0)