Skip to content

Commit 5910a26

Browse files
authored
fix(ourlogs): Expand the menu automatically when you change the function (#93821)
Fixes LOGS-180
1 parent bb72dbb commit 5910a26

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

static/app/views/explore/logs/logsToolbar.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export function LogsToolbar({stringTags, numberTags}: LogsToolbarProps) {
7474
value: key,
7575
}));
7676
if (aggregateFunction === 'count') {
77+
aggregatableKeys.length = 0;
7778
aggregatableKeys.unshift({label: t('logs'), value: 'logs'});
7879
aggregateParam = 'logs';
7980
}
@@ -95,20 +96,21 @@ export function LogsToolbar({stringTags, numberTags}: LogsToolbarProps) {
9596
});
9697
} else {
9798
setLogsPageParams({aggregateFn: val.value as string | undefined});
99+
functionArgRef.current?.querySelector('button')?.click();
98100
}
99-
functionArgRef.current?.querySelector('button')?.click();
100101
}}
101102
value={aggregateFunction}
102103
/>
103104
<SelectRefWrapper ref={functionArgRef}>
104105
<Select
105106
options={aggregatableKeys}
106-
onChange={val =>
107-
setLogsPageParams({aggregateParam: val.value as string | undefined})
108-
}
107+
onChange={val => {
108+
if (aggregateFunction !== 'count') {
109+
setLogsPageParams({aggregateParam: val.value as string | undefined});
110+
}
111+
}}
109112
searchable
110113
value={aggregateParam}
111-
disabled={aggregateFunction === 'count'}
112114
/>
113115
</SelectRefWrapper>
114116
</ToolbarSelectRow>

0 commit comments

Comments
 (0)