From d63cdb085b11adc865ef3719a82132e6ca244582 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Tue, 2 Jul 2024 16:45:15 -0700 Subject: [PATCH] fix(settings): Change search org settings routes routes for some settings are defined aas `/settings/:orgId/` and for some reason normalizeUrl is sending users to the root settings page. Adjust the route to send them to the right page. fixes #73692 --- static/app/components/search/sources/formSource.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/app/components/search/sources/formSource.tsx b/static/app/components/search/sources/formSource.tsx index 61cf1795709de7..45ab3da2ce06f2 100644 --- a/static/app/components/search/sources/formSource.tsx +++ b/static/app/components/search/sources/formSource.tsx @@ -2,6 +2,7 @@ import {Component} from 'react'; import type {WithRouterProps} from 'react-router'; import {loadSearchMap} from 'sentry/actionCreators/formSearch'; +import ConfigStore from 'sentry/stores/configStore'; import type {FormSearchField} from 'sentry/stores/formSearchStore'; import FormSearchStore from 'sentry/stores/formSearchStore'; import type {Fuse} from 'sentry/utils/fuzzySearch'; @@ -65,9 +66,15 @@ class FormSource extends Component { const {searchMap, query, params, children} = this.props; const {fuzzy} = this.state; + const isCustomerDomain = !!ConfigStore.get('customerDomain'); + const results = fuzzy?.search(query).map(value => { const {item, ...rest} = value; + if (isCustomerDomain && item.route === '/settings/:orgId/') { + item.route = '/settings/organization/:orgId/'; + } + return { item: { ...item,