Skip to content

Commit 746f0b2

Browse files
fix(insights): DB domain & action dropdown empty options (#78681)
- The `(No Command)` option has been removed specifically for MongoDB, since MongoDB queries cannot have no command - We were adding `(empty)` as an extra option in the domain selector (also in the Assets module) because the backend returns this, but we also manually append it in the component. Now we filter out this option so there is no redundancy --------- Co-authored-by: Dominik Buszowiecki <[email protected]>
1 parent 36e7490 commit 746f0b2

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

static/app/views/insights/common/views/spans/selectors/actionSelector.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {useSpansQuery} from 'sentry/views/insights/common/queries/useSpansQuery'
1515
import {buildEventViewQuery} from 'sentry/views/insights/common/utils/buildEventViewQuery';
1616
import {QueryParameterNames} from 'sentry/views/insights/common/views/queryParameters';
1717
import {EmptyContainer} from 'sentry/views/insights/common/views/spans/selectors/emptyOption';
18+
import {SupportedDatabaseSystem} from 'sentry/views/insights/database/utils/constants';
1819
import {ModuleName, SpanMetricsField} from 'sentry/views/insights/types';
1920

2021
const {SPAN_ACTION} = SpanMetricsField;
@@ -70,6 +71,11 @@ export function ActionSelector({value = '', moduleName, spanCategory, filters}:
7071
},
7172
];
7273

74+
// The empty option is not necessary for MongoDB, since all queries will have a command
75+
if (filters?.['span.system'] === SupportedDatabaseSystem.MONGODB) {
76+
options.pop();
77+
}
78+
7379
return (
7480
<CompactSelect
7581
style={{maxWidth: '200px'}}

static/app/views/insights/common/views/spans/selectors/domainSelector.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,15 @@ export function DomainSelector({
9494

9595
const {options: domainOptions, clear: clearDomainOptionsCache} =
9696
useCompactSelectOptionsCache(
97-
incomingDomains.filter(Boolean).map(datum => {
98-
return {
99-
value: datum,
100-
label: datum,
101-
};
102-
})
97+
incomingDomains
98+
.filter(Boolean)
99+
.filter(domain => domain !== EMPTY_OPTION_VALUE)
100+
.map(datum => {
101+
return {
102+
value: datum,
103+
label: datum,
104+
};
105+
})
103106
);
104107

105108
useEffect(() => {

0 commit comments

Comments
 (0)