Skip to content

Commit

Permalink
fix(settings): Change search org settings routes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scttcper committed Jul 2, 2024
1 parent f2d307a commit d63cdb0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions static/app/components/search/sources/formSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -65,9 +66,15 @@ class FormSource extends Component<Props, State> {
const {searchMap, query, params, children} = this.props;
const {fuzzy} = this.state;

const isCustomerDomain = !!ConfigStore.get('customerDomain');

const results =
fuzzy?.search(query).map<Result>(value => {
const {item, ...rest} = value;
if (isCustomerDomain && item.route === '/settings/:orgId/') {
item.route = '/settings/organization/:orgId/';
}

return {
item: {
...item,
Expand Down

0 comments on commit d63cdb0

Please sign in to comment.