Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(settings): Change search org settings routes #73707

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember there being a route for /settings/organization/:orgId. Using this route in the UI results in a redirect to /settings/organization/projects/:orgId/ which triggers a bunch of 403 errors as requests are made to the slug organization.

I think instead you want a redirect target of /settings/organization/ or /settings/:orgId/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason /settings/organization/#anchor-tag is being normalized to just /settings/ however /settings/organization/:orgId/ does get normalized to the right place. This was also the fix @roggenkemper came up with in #73697 (review)

}

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