import {addErrorMessage} from 'sentry/actionCreators/indicator'; import {ApiForm, CheckboxField, TextField} from 'sentry/components/forms'; import NarrowLayout from 'sentry/components/narrowLayout'; import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; import {t, tct} from 'sentry/locale'; import ConfigStore from 'sentry/stores/configStore'; import {OrganizationSummary} from 'sentry/types'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; function OrganizationCreate() { const termsUrl = ConfigStore.get('termsUrl'); const privacyUrl = ConfigStore.get('privacyUrl'); return (

{t('Create a New Organization')}

{t( "Organizations represent the top level in your hierarchy. You'll be able to bundle a collection of teams within an organization as well as give organization-wide permissions to users." )}

{ const hasCustomerDomain = createdOrg?.features.includes('customer-domains'); let nextUrl = normalizeUrl( `/organizations/${createdOrg.slug}/projects/new/`, {forceCustomerDomain: hasCustomerDomain} ); if (hasCustomerDomain) { nextUrl = `${createdOrg.links.organizationUrl}${nextUrl}`; } // redirect to project creation *(BYPASS REACT ROUTER AND FORCE PAGE REFRESH TO GRAB CSRF TOKEN)* // browserHistory.pushState(null, `/organizations/${data.slug}/projects/new/`); window.location.assign(nextUrl); }} onSubmitError={error => { addErrorMessage( error.responseJSON?.detail ?? t('Unable to create organization.') ); }} requireChanges > {termsUrl && privacyUrl && ( , privacyLink: , } )} inline={false} stacked required /> )}
); } export default OrganizationCreate;