Skip to content

Commit 736ea7b

Browse files
ceorourkechloeho7
authored andcommitted
ref(projects): Redirect after project transfer (#53466)
Take 2 of #52925 When a user approves transferring a project to a new organization the project isn't added to a team which results in confusion because the project doesn't show up on the projects page. The user needs to add the project to a team for it to show up in most places in the UI, so we should redirect them to the appropriate page to do so.
1 parent 19ac662 commit 736ea7b

File tree

1 file changed

+10
-5
lines changed
  • static/app/views/acceptProjectTransfer

1 file changed

+10
-5
lines changed

static/app/views/acceptProjectTransfer/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {RouteComponentProps} from 'react-router';
22

3-
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
3+
import {addErrorMessage} from 'sentry/actionCreators/indicator';
44
import SelectField from 'sentry/components/forms/fields/selectField';
55
import Form from 'sentry/components/forms/form';
66
import NarrowLayout from 'sentry/components/narrowLayout';
77
import {t, tct} from 'sentry/locale';
8+
import ConfigStore from 'sentry/stores/configStore';
89
import {Organization, Project} from 'sentry/types';
9-
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
1010
import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView';
1111
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
1212

@@ -42,9 +42,14 @@ class AcceptProjectTransfer extends DeprecatedAsyncView<Props, State> {
4242
},
4343
success: () => {
4444
const orgSlug = formData.organization;
45-
46-
this.props.router.push(normalizeUrl(`/organizations/${orgSlug}/projects/`));
47-
addSuccessMessage(t('Project successfully transferred'));
45+
const projectSlug = this.state?.transferDetails?.project.slug;
46+
const sentryUrl = ConfigStore.get('links').sentryUrl;
47+
if (!projectSlug) {
48+
window.location.href = `${sentryUrl}/organizations/${orgSlug}/projects/`;
49+
} else {
50+
window.location.href = `${sentryUrl}/organizations/${orgSlug}/settings/projects/${projectSlug}/teams/`;
51+
// done this way since we need to change subdomains
52+
}
4853
},
4954
error: error => {
5055
const errorMsg =

0 commit comments

Comments
 (0)