Browse Source

ref(mep): Enable transaction-name-search on indexed (#40775)

### Summary
This will rollout transaction-name-search separately from the MEP
rollout so we can derisk this ahead of time.
Kev 2 years ago
parent
commit
9662b33844
1 changed files with 12 additions and 5 deletions
  1. 12 5
      static/app/views/performance/landing/index.tsx

+ 12 - 5
static/app/views/performance/landing/index.tsx

@@ -148,6 +148,9 @@ export function PerformanceLanding(props: Props) {
     : SearchContainerWithFilter;
 
   const shouldShowTransactionNameOnlySearch = canUseMetricsData(organization);
+  const shouldForceTransactionNameOnlySearch = organization.features.includes(
+    'performance-transaction-name-only-search-indexed'
+  );
 
   return (
     <StyledPageContent data-test-id="performance-landing-v3">
@@ -231,17 +234,21 @@ export function PerformanceLanding(props: Props) {
                                           ? getFreeTextFromQuery(derivedQuery)
                                           : derivedQuery;
 
-                                      return metricSettingState ===
+                                      return (metricSettingState ===
                                         MEPState.metricsOnly &&
-                                        shouldShowTransactionNameOnlySearch ? (
+                                        shouldShowTransactionNameOnlySearch) ||
+                                        shouldForceTransactionNameOnlySearch ? (
                                         // TODO replace `handleSearch prop` with transaction name search once
                                         // transaction name search becomes the default search bar
                                         <TransactionNameSearchBar
                                           organization={organization}
                                           eventView={eventView}
-                                          onSearch={(query: string) =>
-                                            handleSearch(query, metricSettingState)
-                                          }
+                                          onSearch={(query: string) => {
+                                            handleSearch(
+                                              query,
+                                              metricSettingState ?? undefined
+                                            );
+                                          }}
                                           query={searchQuery}
                                         />
                                       ) : (