Skip to content

ref(projects): Redirect after project transfer #53466

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

Merged
merged 5 commits into from
Jul 25, 2023
Merged
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
15 changes: 10 additions & 5 deletions static/app/views/acceptProjectTransfer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {RouteComponentProps} from 'react-router';

import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
import {addErrorMessage} from 'sentry/actionCreators/indicator';
import SelectField from 'sentry/components/forms/fields/selectField';
import Form from 'sentry/components/forms/form';
import NarrowLayout from 'sentry/components/narrowLayout';
import {t, tct} from 'sentry/locale';
import ConfigStore from 'sentry/stores/configStore';
import {Organization, Project} from 'sentry/types';
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView';
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';

Expand Down Expand Up @@ -42,9 +42,14 @@ class AcceptProjectTransfer extends DeprecatedAsyncView<Props, State> {
},
success: () => {
const orgSlug = formData.organization;

this.props.router.push(normalizeUrl(`/organizations/${orgSlug}/projects/`));
addSuccessMessage(t('Project successfully transferred'));
const projectSlug = this.state?.transferDetails?.project.slug;
const sentryUrl = ConfigStore.get('links').sentryUrl;
if (!projectSlug) {
window.location.href = `${sentryUrl}/organizations/${orgSlug}/projects/`;
} else {
window.location.href = `${sentryUrl}/organizations/${orgSlug}/settings/projects/${projectSlug}/teams/`;
// done this way since we need to change subdomains
}
},
error: error => {
const errorMsg =
Expand Down