index.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import {Fragment} from 'react';
  2. import {RouteComponentProps} from 'react-router';
  3. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  4. import {t} from 'sentry/locale';
  5. import ConfigStore from 'sentry/stores/configStore';
  6. import {useLegacyStore} from 'sentry/stores/useLegacyStore';
  7. import {Organization, Project} from 'sentry/types';
  8. import withOrganization from 'sentry/utils/withOrganization';
  9. import withProjects from 'sentry/utils/withProjects';
  10. import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
  11. import EarlyFeaturesSettingsForm from 'sentry/views/settings/earlyFeatures/settingsForm';
  12. import PermissionAlert from 'sentry/views/settings/organization/permissionAlert';
  13. type Props = {
  14. organization: Organization;
  15. projects: Project[];
  16. } & RouteComponentProps<{}, {}>;
  17. function OrganizationGeneralSettings(props: Props) {
  18. const {isSelfHosted} = useLegacyStore(ConfigStore);
  19. const {organization} = props;
  20. const access = new Set(organization.access);
  21. if (!isSelfHosted) {
  22. return null;
  23. }
  24. return (
  25. <Fragment>
  26. <SentryDocumentTitle title={t('General Settings')} orgSlug={organization.slug} />
  27. <div>
  28. <SettingsPageHeader title={t('Early Features')} />
  29. <PermissionAlert />
  30. <EarlyFeaturesSettingsForm {...props} access={access} />
  31. </div>
  32. </Fragment>
  33. );
  34. }
  35. export default withProjects(withOrganization(OrganizationGeneralSettings));