routes.tsx 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272
  1. import {Fragment, lazy} from 'react';
  2. import {IndexRedirect, Redirect} from 'react-router';
  3. import memoize from 'lodash/memoize';
  4. import LazyLoad from 'sentry/components/lazyLoad';
  5. import {EXPERIMENTAL_SPA, USING_CUSTOMER_DOMAIN} from 'sentry/constants';
  6. import {t} from 'sentry/locale';
  7. import HookStore from 'sentry/stores/hookStore';
  8. import type {HookName} from 'sentry/types/hooks';
  9. import errorHandler from 'sentry/utils/errorHandler';
  10. import retryableImport from 'sentry/utils/retryableImport';
  11. import withDomainRedirect from 'sentry/utils/withDomainRedirect';
  12. import withDomainRequired from 'sentry/utils/withDomainRequired';
  13. import App from 'sentry/views/app';
  14. import AuthLayout from 'sentry/views/auth/layout';
  15. import {MODULE_BASE_URLS} from 'sentry/views/insights/common/utils/useModuleURL';
  16. import {INSIGHTS_BASE_URL} from 'sentry/views/insights/settings';
  17. import {ModuleName} from 'sentry/views/insights/types';
  18. import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
  19. import IssueListContainer from 'sentry/views/issueList';
  20. import IssueListOverview from 'sentry/views/issueList/overview';
  21. import OrganizationContainer from 'sentry/views/organizationContainer';
  22. import OrganizationLayout from 'sentry/views/organizationLayout';
  23. import OrganizationRoot from 'sentry/views/organizationRoot';
  24. import ProjectEventRedirect from 'sentry/views/projectEventRedirect';
  25. import redirectDeprecatedProjectRoute from 'sentry/views/projects/redirectDeprecatedProjectRoute';
  26. import RouteNotFound from 'sentry/views/routeNotFound';
  27. import SettingsWrapper from 'sentry/views/settings/components/settingsWrapper';
  28. import {IndexRoute, Route} from './components/route';
  29. const hook = (name: HookName) => HookStore.get(name).map(cb => cb());
  30. // LazyExoticComponent Props get crazy when wrapped in an additional layer
  31. const SafeLazyLoad = errorHandler(LazyLoad) as unknown as React.ComponentType<
  32. typeof LazyLoad
  33. >;
  34. // NOTE: makeLazyloadComponent is exported for use in the sentry.io (getsentry)
  35. // pirvate routing tree.
  36. /**
  37. * Factory function to produce a component that will render the SafeLazyLoad
  38. * _with_ the required props.
  39. */
  40. export function makeLazyloadComponent<C extends React.ComponentType<any>>(
  41. resolve: () => Promise<{default: C}>
  42. ) {
  43. const LazyComponent = lazy<C>(() => retryableImport(resolve));
  44. // XXX: Assign the component to a variable so it has a displayname
  45. function RouteLazyLoad(props: React.ComponentProps<C>) {
  46. // we can use this hook to set the organization as it's
  47. // a child of the organization context
  48. return <SafeLazyLoad {...props} LazyComponent={LazyComponent} />;
  49. }
  50. return RouteLazyLoad;
  51. }
  52. // Shorthand to avoid extra line wrapping
  53. const make = makeLazyloadComponent;
  54. function buildRoutes() {
  55. // Read this to understand where to add new routes, how / why the routing
  56. // tree is structured the way it is, and how the lazy-loading /
  57. // code-splitting works for pages.
  58. //
  59. // ## Formatting
  60. //
  61. // NOTE that there are intentionally NO blank lines within route tree blocks.
  62. // This helps make it easier to navigate within the file by using your
  63. // editors shortcuts to jump between 'paragraphs' of code.
  64. //
  65. // [!!] Do NOT add blank lines within route blocks to preserve this behavior!
  66. //
  67. //
  68. // ## Lazy loading
  69. //
  70. // * The `SafeLazyLoad` component
  71. //
  72. // Most routes are rendered as LazyLoad components (SafeLazyLoad is the
  73. // errorHandler wrapped version). This means the rendered component for the
  74. // route will only be loaded when the route is loaded. This helps us
  75. // "code-split" the app.
  76. //
  77. // ## Hooks
  78. //
  79. // There are a number of `hook()` routes placed within the routing tree to
  80. // allow for additional routes to be augmented into the application via the
  81. // hookStore mechanism.
  82. //
  83. //
  84. // ## The structure
  85. //
  86. // * `experimentalSpaRoutes`
  87. //
  88. // These routes are specifically for the experimental single-page-app mode,
  89. // where Sentry is run separate from Django. These are NOT part of the root
  90. // <App /> component.
  91. //
  92. // Right now these are mainly used for authentication pages. In the future
  93. // they would be used for other pages like registration.
  94. //
  95. // * `rootRoutes`
  96. //
  97. // These routes live directly under the <App /> container, and generally
  98. // are not specific to an organization.
  99. //
  100. // * `settingsRoutes`
  101. //
  102. // This is the route tree for all of `/settings/`. This route tree is
  103. // composed of a few different sub-trees.
  104. //
  105. // - `accountSettingsRoutes` User specific settings
  106. // - `orgSettingsRoutes` Specific to a organization
  107. // - `projectSettingsRoutes` Specific to a project
  108. // - `legacySettingsRedirects` Routes that used to exist in settings
  109. //
  110. // * `organizationRoutes`
  111. //
  112. // This is where a majority of the app routes live. This is wrapped with
  113. // the <OrganizationLayout /> component, which renders the sidebar and
  114. // loads the organiztion into context (though in some cases, there may be
  115. // no organiztion)
  116. //
  117. // When adding new top-level organization routes, be sure the top level
  118. // route includes withOrgPath to support installs that are not using
  119. // customer domains.
  120. //
  121. // Within these routes are a variety of subroutes. They are not all
  122. // listed here as the subroutes will be added and removed, and most are
  123. // self explanatory.
  124. //
  125. // * `legacyRedirectRoutes`
  126. //
  127. // This route tree contains <Redirect /> routes for many old legacy paths.
  128. //
  129. // You may also find <Redirect />'s collocated next to the feature routes
  130. // they have redirects for. A good rule here is to place 'helper' redirects
  131. // next to the routes they redirect to, and place 'legacy route' redirects
  132. // for routes that have completely changed in this tree.
  133. const experimentalSpaRoutes = EXPERIMENTAL_SPA ? (
  134. <Route path="/auth/login/" component={errorHandler(AuthLayout)}>
  135. <IndexRoute component={make(() => import('sentry/views/auth/login'))} />
  136. <Route path=":orgId/" component={make(() => import('sentry/views/auth/login'))} />
  137. </Route>
  138. ) : null;
  139. const rootRoutes = (
  140. <Fragment>
  141. <IndexRoute component={make(() => import('sentry/views/app/root'))} />
  142. {hook('routes:root')}
  143. <Route
  144. path="/accept/:orgId/:memberId/:token/"
  145. component={make(() => import('sentry/views/acceptOrganizationInvite'))}
  146. />
  147. <Route
  148. path="/accept/:memberId/:token/"
  149. component={make(() => import('sentry/views/acceptOrganizationInvite'))}
  150. />
  151. <Route
  152. path="/accept-transfer/"
  153. component={make(() => import('sentry/views/acceptProjectTransfer'))}
  154. />
  155. <Route component={errorHandler(OrganizationContainer)}>
  156. <Route
  157. path="/extensions/external-install/:integrationSlug/:installationId"
  158. component={make(() => import('sentry/views/integrationOrganizationLink'))}
  159. />
  160. <Route
  161. path="/extensions/:integrationSlug/link/"
  162. component={make(() => import('sentry/views/integrationOrganizationLink'))}
  163. />
  164. </Route>
  165. <Route
  166. path="/sentry-apps/:sentryAppSlug/external-install/"
  167. component={make(() => import('sentry/views/sentryAppExternalInstallation'))}
  168. />
  169. <Redirect from="/account/" to="/settings/account/details/" />
  170. <Redirect from="/share/group/:shareId/" to="/share/issue/:shareId/" />
  171. {/* TODO: remove share/issue orgless url */}
  172. <Route
  173. path="/share/issue/:shareId/"
  174. component={make(() => import('sentry/views/sharedGroupDetails'))}
  175. />
  176. <Route
  177. path="/organizations/:orgId/share/issue/:shareId/"
  178. component={make(() => import('sentry/views/sharedGroupDetails'))}
  179. />
  180. {USING_CUSTOMER_DOMAIN && (
  181. <Route
  182. path="/unsubscribe/project/:id/"
  183. component={make(() => import('sentry/views/unsubscribe/project'))}
  184. />
  185. )}
  186. <Route
  187. path="/unsubscribe/:orgId/project/:id/"
  188. component={make(() => import('sentry/views/unsubscribe/project'))}
  189. />
  190. {USING_CUSTOMER_DOMAIN && (
  191. <Route
  192. path="/unsubscribe/issue/:id/"
  193. component={make(() => import('sentry/views/unsubscribe/issue'))}
  194. />
  195. )}
  196. <Route
  197. path="/unsubscribe/:orgId/issue/:id/"
  198. component={make(() => import('sentry/views/unsubscribe/issue'))}
  199. />
  200. <Route
  201. path="/organizations/new/"
  202. component={make(() => import('sentry/views/organizationCreate'))}
  203. />
  204. <Route
  205. path="/data-export/:dataExportId"
  206. component={make(() => import('sentry/views/dataExport/dataDownload'))}
  207. withOrgPath
  208. />
  209. <Route component={errorHandler(OrganizationContainer)}>
  210. <Route
  211. path="/disabled-member/"
  212. component={make(() => import('sentry/views/disabledMember'))}
  213. withOrgPath
  214. />
  215. </Route>
  216. {USING_CUSTOMER_DOMAIN && (
  217. <Route
  218. path="/restore/"
  219. component={make(() => import('sentry/views/organizationRestore'))}
  220. />
  221. )}
  222. <Route
  223. path="/organizations/:orgId/restore/"
  224. component={make(() => import('sentry/views/organizationRestore'))}
  225. />
  226. {USING_CUSTOMER_DOMAIN && (
  227. <Route
  228. path="/join-request/"
  229. component={withDomainRequired(
  230. make(() => import('sentry/views/organizationJoinRequest'))
  231. )}
  232. key="orgless-join-request"
  233. />
  234. )}
  235. <Route
  236. path="/join-request/:orgId/"
  237. component={withDomainRedirect(
  238. make(() => import('sentry/views/organizationJoinRequest'))
  239. )}
  240. key="org-join-request"
  241. />
  242. <Route
  243. path="/relocation/"
  244. component={make(() => import('sentry/views/relocation'))}
  245. key="orgless-relocation"
  246. >
  247. <IndexRedirect to="get-started/" />
  248. <Route path=":step/" component={make(() => import('sentry/views/relocation'))} />
  249. </Route>
  250. {USING_CUSTOMER_DOMAIN && (
  251. <Route
  252. path="/onboarding/"
  253. component={errorHandler(withDomainRequired(OrganizationContainer))}
  254. key="orgless-onboarding"
  255. >
  256. <IndexRedirect to="welcome/" />
  257. <Route
  258. path=":step/"
  259. component={make(() => import('sentry/views/onboarding'))}
  260. />
  261. </Route>
  262. )}
  263. <Route
  264. path="/onboarding/:orgId/"
  265. component={withDomainRedirect(errorHandler(OrganizationContainer))}
  266. key="org-onboarding"
  267. >
  268. <IndexRedirect to="welcome/" />
  269. <Route path=":step/" component={make(() => import('sentry/views/onboarding'))} />
  270. </Route>
  271. <Route
  272. path="/stories/"
  273. component={make(() => import('sentry/views/stories/index'))}
  274. withOrgPath
  275. />
  276. </Fragment>
  277. );
  278. const accountSettingsRoutes = (
  279. <Route
  280. path="account/"
  281. name={t('Account')}
  282. component={make(
  283. () => import('sentry/views/settings/account/accountSettingsLayout')
  284. )}
  285. >
  286. <IndexRedirect to="details/" />
  287. <Route
  288. path="details/"
  289. name={t('Details')}
  290. component={make(() => import('sentry/views/settings/account/accountDetails'))}
  291. />
  292. <Route path="notifications/" name={t('Notifications')}>
  293. <IndexRoute
  294. component={make(
  295. () =>
  296. import(
  297. 'sentry/views/settings/account/notifications/notificationSettingsController'
  298. )
  299. )}
  300. />
  301. <Route
  302. path=":fineTuneType/"
  303. name={t('Fine Tune Alerts')}
  304. component={make(
  305. () =>
  306. import(
  307. 'sentry/views/settings/account/accountNotificationFineTuningController'
  308. )
  309. )}
  310. />
  311. </Route>
  312. <Route
  313. path="emails/"
  314. name={t('Emails')}
  315. component={make(() => import('sentry/views/settings/account/accountEmails'))}
  316. />
  317. <Route
  318. path="authorizations/"
  319. component={make(
  320. () => import('sentry/views/settings/account/accountAuthorizations')
  321. )}
  322. />
  323. <Route path="security/" name={t('Security')}>
  324. <Route
  325. component={make(
  326. () =>
  327. import(
  328. 'sentry/views/settings/account/accountSecurity/accountSecurityWrapper'
  329. )
  330. )}
  331. >
  332. <IndexRoute
  333. component={make(
  334. () => import('sentry/views/settings/account/accountSecurity')
  335. )}
  336. />
  337. <Route
  338. path="session-history/"
  339. name={t('Session History')}
  340. component={make(
  341. () => import('sentry/views/settings/account/accountSecurity/sessionHistory')
  342. )}
  343. />
  344. <Route
  345. path="mfa/:authId/"
  346. name={t('Details')}
  347. component={make(
  348. () =>
  349. import(
  350. 'sentry/views/settings/account/accountSecurity/accountSecurityDetails'
  351. )
  352. )}
  353. />
  354. </Route>
  355. <Route
  356. path="mfa/:authId/enroll/"
  357. name={t('Enroll')}
  358. component={make(
  359. () =>
  360. import(
  361. 'sentry/views/settings/account/accountSecurity/accountSecurityEnroll'
  362. )
  363. )}
  364. />
  365. </Route>
  366. <Route
  367. path="subscriptions/"
  368. name={t('Subscriptions')}
  369. component={make(
  370. () => import('sentry/views/settings/account/accountSubscriptions')
  371. )}
  372. />
  373. <Route
  374. path="identities/"
  375. name={t('Identities')}
  376. component={make(() => import('sentry/views/settings/account/accountIdentities'))}
  377. />
  378. <Route path="api/" name={t('API')}>
  379. <IndexRedirect to="auth-tokens/" />
  380. <Route path="auth-tokens/" name={t('User Auth Tokens')}>
  381. <IndexRoute
  382. component={make(() => import('sentry/views/settings/account/apiTokens'))}
  383. />
  384. <Route
  385. path="new-token/"
  386. name={t('Create New Token')}
  387. component={make(() => import('sentry/views/settings/account/apiNewToken'))}
  388. />
  389. <Route
  390. path=":tokenId/"
  391. name={t('Edit User Auth Token')}
  392. component={make(
  393. () => import('sentry/views/settings/account/apiTokenDetails')
  394. )}
  395. />
  396. </Route>
  397. <Route path="applications/" name={t('Applications')}>
  398. <IndexRoute
  399. component={make(
  400. () => import('sentry/views/settings/account/apiApplications')
  401. )}
  402. />
  403. <Route
  404. path=":appId/"
  405. name={t('Details')}
  406. component={make(
  407. () => import('sentry/views/settings/account/apiApplications/details')
  408. )}
  409. />
  410. </Route>
  411. {hook('routes:api')}
  412. </Route>
  413. <Route
  414. path="close-account/"
  415. name={t('Close Account')}
  416. component={make(() => import('sentry/views/settings/account/accountClose'))}
  417. />
  418. </Route>
  419. );
  420. const projectSettingsRoutes = (
  421. <Route
  422. path="projects/:projectId/"
  423. name={t('Project')}
  424. component={make(
  425. () => import('sentry/views/settings/project/projectSettingsLayout')
  426. )}
  427. >
  428. <IndexRoute
  429. name={t('General')}
  430. component={make(() => import('sentry/views/settings/projectGeneralSettings'))}
  431. />
  432. <Redirect from="install/" to="/projects/:projectId/getting-started/" />
  433. <Route
  434. path="teams/"
  435. name={t('Teams')}
  436. component={make(() => import('sentry/views/settings/project/projectTeams'))}
  437. />
  438. <Route
  439. path="alerts/"
  440. name={t('Alerts')}
  441. component={make(() => import('sentry/views/settings/projectAlerts'))}
  442. >
  443. <IndexRoute
  444. component={make(() => import('sentry/views/settings/projectAlerts/settings'))}
  445. />
  446. <Redirect from="new/" to="/organizations/:orgId/alerts/:projectId/new/" />
  447. <Redirect from="rules/" to="/organizations/:orgId/alerts/rules/" />
  448. <Redirect from="rules/new/" to="/organizations/:orgId/alerts/:projectId/new/" />
  449. <Redirect
  450. from="metric-rules/new/"
  451. to="/organizations/:orgId/alerts/:projectId/new/"
  452. />
  453. <Redirect
  454. from="rules/:ruleId/"
  455. to="/organizations/:orgId/alerts/rules/:projectId/:ruleId/"
  456. />
  457. <Redirect
  458. from="metric-rules/:ruleId/"
  459. to="/organizations/:orgId/alerts/metric-rules/:projectId/:ruleId/"
  460. />
  461. </Route>
  462. <Route
  463. path="environments/"
  464. name={t('Environments')}
  465. component={make(
  466. () => import('sentry/views/settings/project/projectEnvironments')
  467. )}
  468. >
  469. <IndexRoute />
  470. <Route path="hidden/" />
  471. </Route>
  472. <Route
  473. path="tags/"
  474. name={t('Tags & Context')}
  475. component={make(() => import('sentry/views/settings/projectTags'))}
  476. />
  477. <Redirect from="issue-tracking/" to="/settings/:orgId/:projectId/plugins/" />
  478. <Route
  479. path="release-tracking/"
  480. name={t('Release Tracking')}
  481. component={make(
  482. () => import('sentry/views/settings/project/projectReleaseTracking')
  483. )}
  484. />
  485. <Route
  486. path="ownership/"
  487. name={t('Ownership Rules')}
  488. component={make(() => import('sentry/views/settings/project/projectOwnership'))}
  489. />
  490. <Route
  491. path="data-forwarding/"
  492. name={t('Data Forwarding')}
  493. component={make(() => import('sentry/views/settings/projectDataForwarding'))}
  494. />
  495. <Route
  496. path="user-feedback/"
  497. name={t('User Feedback')}
  498. component={make(() => import('sentry/views/settings/projectUserFeedback'))}
  499. />
  500. <Route path="security-and-privacy/" name={t('Security & Privacy')}>
  501. <IndexRoute
  502. component={make(
  503. () => import('sentry/views/settings/projectSecurityAndPrivacy')
  504. )}
  505. />
  506. <Route
  507. path="advanced-data-scrubbing/:scrubbingId/"
  508. component={make(
  509. () => import('sentry/views/settings/projectSecurityAndPrivacy')
  510. )}
  511. />
  512. </Route>
  513. <Route
  514. path="debug-symbols/"
  515. name={t('Debug Information Files')}
  516. component={make(() => import('sentry/views/settings/projectDebugFiles'))}
  517. />
  518. <Route
  519. path="proguard/"
  520. name={t('ProGuard Mappings')}
  521. component={make(() => import('sentry/views/settings/projectProguard'))}
  522. />
  523. <Route
  524. path="performance/"
  525. name={t('Performance')}
  526. component={make(() => import('sentry/views/settings/projectPerformance'))}
  527. />
  528. <Route path="metrics/" name={t('Metrics')}>
  529. <IndexRoute
  530. component={make(() => import('sentry/views/settings/projectMetrics'))}
  531. />
  532. <Route
  533. name={t('Metrics Details')}
  534. path=":mri/"
  535. component={make(
  536. () => import('sentry/views/settings/projectMetrics/projectMetricsDetails')
  537. )}
  538. />
  539. </Route>
  540. <Route
  541. path="replays/"
  542. name={t('Replays')}
  543. component={make(() => import('sentry/views/settings/project/projectReplays'))}
  544. />
  545. <Route
  546. path="remote-config/"
  547. name={t('Remote Config')}
  548. component={make(
  549. () => import('sentry/views/settings/project/projectRemoteConfig')
  550. )}
  551. />
  552. <Route path="source-maps/" name={t('Source Maps')}>
  553. <IndexRoute
  554. component={make(() => import('sentry/views/settings/projectSourceMaps'))}
  555. />
  556. <Route
  557. path="artifact-bundles/"
  558. name={t('Artifact Bundles')}
  559. component={make(() => import('sentry/views/settings/projectSourceMaps'))}
  560. >
  561. <Route
  562. name={t('Artifact Bundle')}
  563. path=":bundleId/"
  564. component={make(() => import('sentry/views/settings/projectSourceMaps'))}
  565. />
  566. </Route>
  567. <Route
  568. path="release-bundles/"
  569. name={t('Release Bundles')}
  570. component={make(() => import('sentry/views/settings/projectSourceMaps'))}
  571. >
  572. <Route
  573. name={t('Release Bundle')}
  574. path=":bundleId/"
  575. component={make(() => import('sentry/views/settings/projectSourceMaps'))}
  576. />
  577. </Route>
  578. <Redirect from=":name/" to="release-bundles/:name/" />
  579. </Route>
  580. <Route
  581. path="filters/"
  582. name={t('Inbound Filters')}
  583. component={make(() => import('sentry/views/settings/project/projectFilters'))}
  584. >
  585. <IndexRedirect to="data-filters/" />
  586. <Route path=":filterType/" />
  587. </Route>
  588. <Redirect from="dynamic-sampling/" to="performance/" />
  589. <Route
  590. path="issue-grouping/"
  591. name={t('Issue Grouping')}
  592. component={make(() => import('sentry/views/settings/projectIssueGrouping'))}
  593. />
  594. <Route
  595. path="hooks/"
  596. name={t('Service Hooks')}
  597. component={make(
  598. () => import('sentry/views/settings/project/projectServiceHooks')
  599. )}
  600. />
  601. <Route
  602. path="hooks/new/"
  603. name={t('Create Service Hook')}
  604. component={make(
  605. () => import('sentry/views/settings/project/projectCreateServiceHook')
  606. )}
  607. />
  608. <Route
  609. path="hooks/:hookId/"
  610. name={t('Service Hook Details')}
  611. component={make(
  612. () => import('sentry/views/settings/project/projectServiceHookDetails')
  613. )}
  614. />
  615. <Route path="keys/" name={t('Client Keys')}>
  616. <IndexRoute
  617. component={make(() => import('sentry/views/settings/project/projectKeys/list'))}
  618. />
  619. <Route
  620. path=":keyId/"
  621. name={t('Details')}
  622. component={make(
  623. () => import('sentry/views/settings/project/projectKeys/details')
  624. )}
  625. />
  626. </Route>
  627. <Route
  628. path="loader-script/"
  629. name={t('Loader Script')}
  630. component={make(() => import('sentry/views/settings/project/loaderScript'))}
  631. />
  632. <Redirect from="csp/" to="security-headers/" />
  633. <Route path="security-headers/" name={t('Security Headers')}>
  634. <IndexRoute
  635. component={make(() => import('sentry/views/settings/projectSecurityHeaders'))}
  636. />
  637. <Route
  638. path="csp/"
  639. name={t('Content Security Policy')}
  640. component={make(
  641. () => import('sentry/views/settings/projectSecurityHeaders/csp')
  642. )}
  643. />
  644. <Route
  645. path="expect-ct/"
  646. name={t('Certificate Transparency')}
  647. component={make(
  648. () => import('sentry/views/settings/projectSecurityHeaders/expectCt')
  649. )}
  650. />
  651. <Route
  652. path="hpkp/"
  653. name={t('HPKP')}
  654. component={make(
  655. () => import('sentry/views/settings/projectSecurityHeaders/hpkp')
  656. )}
  657. />
  658. </Route>
  659. <Route path="plugins/" name={t('Legacy Integrations')}>
  660. <IndexRoute
  661. component={make(() => import('sentry/views/settings/projectPlugins'))}
  662. />
  663. <Route
  664. path=":pluginId/"
  665. name={t('Integration Details')}
  666. component={make(() => import('sentry/views/settings/projectPlugins/details'))}
  667. />
  668. </Route>
  669. </Route>
  670. );
  671. const orgSettingsRoutes = (
  672. <Route
  673. component={make(
  674. () => import('sentry/views/settings/organization/organizationSettingsLayout')
  675. )}
  676. >
  677. {hook('routes:organization')}
  678. {!USING_CUSTOMER_DOMAIN && (
  679. <IndexRoute
  680. name={t('General')}
  681. component={make(
  682. () => import('sentry/views/settings/organizationGeneralSettings')
  683. )}
  684. />
  685. )}
  686. {USING_CUSTOMER_DOMAIN && (
  687. <Route
  688. path="/settings/organization/"
  689. name={t('General')}
  690. component={make(
  691. () => import('sentry/views/settings/organizationGeneralSettings')
  692. )}
  693. />
  694. )}
  695. <Route
  696. path="projects/"
  697. name={t('Projects')}
  698. component={make(() => import('sentry/views/settings/organizationProjects'))}
  699. />
  700. <Route path="api-keys/" name={t('API Key')}>
  701. <IndexRoute
  702. component={make(() => import('sentry/views/settings/organizationApiKeys'))}
  703. />
  704. <Route
  705. path=":apiKey/"
  706. name={t('Details')}
  707. component={make(
  708. () =>
  709. import(
  710. 'sentry/views/settings/organizationApiKeys/organizationApiKeyDetails'
  711. )
  712. )}
  713. />
  714. </Route>
  715. <Route
  716. path="audit-log/"
  717. name={t('Audit Log')}
  718. component={make(() => import('sentry/views/settings/organizationAuditLog'))}
  719. />
  720. <Route
  721. path="auth/"
  722. name={t('Auth Providers')}
  723. component={make(() => import('sentry/views/settings/organizationAuth'))}
  724. />
  725. <Redirect from="members/requests" to="members/" />
  726. <Route path="members/" name={t('Members')}>
  727. <Route
  728. component={make(
  729. () =>
  730. import(
  731. 'sentry/views/settings/organizationMembers/organizationMembersWrapper'
  732. )
  733. )}
  734. >
  735. <IndexRoute
  736. component={make(
  737. () =>
  738. import(
  739. 'sentry/views/settings/organizationMembers/organizationMembersList'
  740. )
  741. )}
  742. />
  743. </Route>
  744. <Route
  745. path=":memberId/"
  746. name={t('Details')}
  747. component={make(
  748. () =>
  749. import('sentry/views/settings/organizationMembers/organizationMemberDetail')
  750. )}
  751. />
  752. </Route>
  753. <Route
  754. path="rate-limits/"
  755. name={t('Rate Limits')}
  756. component={make(() => import('sentry/views/settings/organizationRateLimits'))}
  757. />
  758. <Route
  759. path="relay/"
  760. name={t('Relay')}
  761. component={make(() => import('sentry/views/settings/organizationRelay'))}
  762. />
  763. <Route
  764. path="repos/"
  765. name={t('Repositories')}
  766. component={make(() => import('sentry/views/settings/organizationRepositories'))}
  767. />
  768. <Route
  769. path="settings/"
  770. component={make(
  771. () => import('sentry/views/settings/organizationGeneralSettings')
  772. )}
  773. />
  774. <Route path="security-and-privacy/" name={t('Security & Privacy')}>
  775. <IndexRoute
  776. component={make(
  777. () => import('sentry/views/settings/organizationSecurityAndPrivacy')
  778. )}
  779. />
  780. <Route
  781. path="advanced-data-scrubbing/:scrubbingId/"
  782. component={make(
  783. () => import('sentry/views/settings/organizationSecurityAndPrivacy')
  784. )}
  785. />
  786. </Route>
  787. <Route path="teams/" name={t('Teams')}>
  788. <IndexRoute
  789. component={make(() => import('sentry/views/settings/organizationTeams'))}
  790. />
  791. <Route
  792. path=":teamId/"
  793. name={t('Team')}
  794. component={make(
  795. () => import('sentry/views/settings/organizationTeams/teamDetails')
  796. )}
  797. >
  798. <IndexRedirect to="members/" />
  799. <Route
  800. path="members/"
  801. name={t('Members')}
  802. component={make(
  803. () => import('sentry/views/settings/organizationTeams/teamMembers')
  804. )}
  805. />
  806. <Route
  807. path="notifications/"
  808. name={t('Notifications')}
  809. component={make(
  810. () => import('sentry/views/settings/organizationTeams/teamNotifications')
  811. )}
  812. />
  813. <Route
  814. path="projects/"
  815. name={t('Projects')}
  816. component={make(
  817. () => import('sentry/views/settings/organizationTeams/teamProjects')
  818. )}
  819. />
  820. <Route
  821. path="settings/"
  822. name={t('Settings')}
  823. component={make(
  824. () => import('sentry/views/settings/organizationTeams/teamSettings')
  825. )}
  826. />
  827. </Route>
  828. </Route>
  829. <Redirect from="plugins/" to="integrations/" />
  830. <Route path="plugins/" name={t('Integrations')}>
  831. <Route
  832. path=":integrationSlug/"
  833. name={t('Integration Details')}
  834. component={make(
  835. () =>
  836. import('sentry/views/settings/organizationIntegrations/pluginDetailedView')
  837. )}
  838. />
  839. </Route>
  840. <Redirect from="sentry-apps/" to="integrations/" />
  841. <Route path="sentry-apps/" name={t('Integrations')}>
  842. <Route
  843. path=":integrationSlug"
  844. name={t('Details')}
  845. component={make(
  846. () =>
  847. import(
  848. 'sentry/views/settings/organizationIntegrations/sentryAppDetailedView'
  849. )
  850. )}
  851. />
  852. </Route>
  853. <Redirect from="document-integrations/" to="integrations/" />
  854. <Route path="document-integrations/" name={t('Integrations')}>
  855. <Route
  856. path=":integrationSlug"
  857. name={t('Details')}
  858. component={make(
  859. () =>
  860. import(
  861. 'sentry/views/settings/organizationIntegrations/docIntegrationDetailedView'
  862. )
  863. )}
  864. />
  865. </Route>
  866. <Route path="integrations/" name={t('Integrations')}>
  867. <IndexRoute
  868. component={make(
  869. () =>
  870. import(
  871. 'sentry/views/settings/organizationIntegrations/integrationListDirectory'
  872. )
  873. )}
  874. />
  875. <Route
  876. path=":integrationSlug"
  877. name={t('Integration Details')}
  878. component={make(
  879. () =>
  880. import(
  881. 'sentry/views/settings/organizationIntegrations/integrationDetailedView'
  882. )
  883. )}
  884. />
  885. <Route
  886. path=":providerKey/:integrationId/"
  887. name={t('Configure Integration')}
  888. component={make(
  889. () =>
  890. import(
  891. 'sentry/views/settings/organizationIntegrations/configureIntegration'
  892. )
  893. )}
  894. />
  895. </Route>
  896. <Route path="developer-settings/" name={t('Custom Integrations')}>
  897. <IndexRoute
  898. component={make(
  899. () => import('sentry/views/settings/organizationDeveloperSettings')
  900. )}
  901. />
  902. <Route
  903. path="new-public/"
  904. name={t('Create Integration')}
  905. component={make(
  906. () =>
  907. import(
  908. 'sentry/views/settings/organizationDeveloperSettings/sentryApplicationDetails'
  909. )
  910. )}
  911. />
  912. <Route
  913. path="new-internal/"
  914. name={t('Create Integration')}
  915. component={make(
  916. () =>
  917. import(
  918. 'sentry/views/settings/organizationDeveloperSettings/sentryApplicationDetails'
  919. )
  920. )}
  921. />
  922. <Route
  923. path=":appSlug/"
  924. name={t('Edit Integration')}
  925. component={make(
  926. () =>
  927. import(
  928. 'sentry/views/settings/organizationDeveloperSettings/sentryApplicationDetails'
  929. )
  930. )}
  931. />
  932. <Route
  933. path=":appSlug/dashboard/"
  934. name={t('Integration Dashboard')}
  935. component={make(
  936. () =>
  937. import(
  938. 'sentry/views/settings/organizationDeveloperSettings/sentryApplicationDashboard'
  939. )
  940. )}
  941. />
  942. </Route>
  943. <Route path="auth-tokens/" name={t('Auth Tokens')}>
  944. <IndexRoute
  945. component={make(() => import('sentry/views/settings/organizationAuthTokens'))}
  946. />
  947. <Route
  948. path="new-token/"
  949. name={t('Create New Auth Token')}
  950. component={make(
  951. () => import('sentry/views/settings/organizationAuthTokens/newAuthToken')
  952. )}
  953. />
  954. <Route
  955. path=":tokenId/"
  956. name={t('Edit Auth Token')}
  957. component={make(
  958. () => import('sentry/views/settings/organizationAuthTokens/authTokenDetails')
  959. )}
  960. />
  961. </Route>
  962. <Route
  963. path="early-features/"
  964. name={t('Early Features')}
  965. component={make(() => import('sentry/views/settings/earlyFeatures'))}
  966. />
  967. </Route>
  968. );
  969. const legacySettingsRedirects = (
  970. <Fragment>
  971. <Redirect from=":projectId/" to="projects/:projectId/" />
  972. <Redirect from=":projectId/alerts/" to="projects/:projectId/alerts/" />
  973. <Redirect from=":projectId/alerts/rules/" to="projects/:projectId/alerts/rules/" />
  974. <Redirect
  975. from=":projectId/alerts/rules/:ruleId/"
  976. to="projects/:projectId/alerts/rules/:ruleId/"
  977. />
  978. </Fragment>
  979. );
  980. const settingsRoutes = (
  981. <Route path="/settings/" name={t('Settings')} component={SettingsWrapper}>
  982. <IndexRoute component={make(() => import('sentry/views/settings/settingsIndex'))} />
  983. {accountSettingsRoutes}
  984. <Fragment>
  985. {USING_CUSTOMER_DOMAIN && (
  986. <Route
  987. name={t('Organization')}
  988. component={withDomainRequired(NoOp)}
  989. key="orgless-settings-route"
  990. >
  991. {orgSettingsRoutes}
  992. {projectSettingsRoutes}
  993. </Route>
  994. )}
  995. <Route
  996. path=":orgId/"
  997. name={t('Organization')}
  998. component={withDomainRedirect(NoOp)}
  999. key="org-settings"
  1000. >
  1001. {orgSettingsRoutes}
  1002. {projectSettingsRoutes}
  1003. {legacySettingsRedirects}
  1004. </Route>
  1005. </Fragment>
  1006. </Route>
  1007. );
  1008. const projectsRoutes = (
  1009. <Route
  1010. path="/projects/"
  1011. component={make(() => import('sentry/views/projects/'))}
  1012. withOrgPath
  1013. >
  1014. <IndexRoute component={make(() => import('sentry/views/projectsDashboard'))} />
  1015. <Route
  1016. path="new/"
  1017. component={make(() => import('sentry/views/projectInstall/newProject'))}
  1018. />
  1019. <Route
  1020. path=":projectId/"
  1021. component={make(() => import('sentry/views/projectDetail'))}
  1022. />
  1023. <Route
  1024. path=":projectId/events/:eventId/"
  1025. component={errorHandler(ProjectEventRedirect)}
  1026. />
  1027. <Route
  1028. path=":projectId/getting-started/"
  1029. component={make(
  1030. () => import('sentry/views/projectInstall/platformOrIntegration')
  1031. )}
  1032. />
  1033. </Route>
  1034. );
  1035. const dashboardRoutes = (
  1036. <Fragment>
  1037. <Fragment>
  1038. {USING_CUSTOMER_DOMAIN && (
  1039. <Route
  1040. path="/dashboards/"
  1041. component={withDomainRequired(make(() => import('sentry/views/dashboards')))}
  1042. key="orgless-dashboards-route"
  1043. >
  1044. <IndexRoute
  1045. component={make(() => import('sentry/views/dashboards/manage'))}
  1046. />
  1047. </Route>
  1048. )}
  1049. <Route
  1050. path="/organizations/:orgId/dashboards/"
  1051. component={withDomainRedirect(make(() => import('sentry/views/dashboards')))}
  1052. key="org-dashboards"
  1053. >
  1054. <IndexRoute component={make(() => import('sentry/views/dashboards/manage'))} />
  1055. </Route>
  1056. </Fragment>
  1057. <Fragment>
  1058. {USING_CUSTOMER_DOMAIN && (
  1059. <Route
  1060. path="/dashboards/new/"
  1061. component={withDomainRequired(
  1062. make(() => import('sentry/views/dashboards/create'))
  1063. )}
  1064. key="orgless-dashboards-new-route"
  1065. >
  1066. <Route
  1067. path="widget/:widgetIndex/edit/"
  1068. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1069. />
  1070. <Route
  1071. path="widget/new/"
  1072. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1073. />
  1074. </Route>
  1075. )}
  1076. <Route
  1077. path="/organizations/:orgId/dashboards/new/"
  1078. component={withDomainRedirect(
  1079. make(() => import('sentry/views/dashboards/create'))
  1080. )}
  1081. key="org-dashboards-new"
  1082. >
  1083. <Route
  1084. path="widget/:widgetIndex/edit/"
  1085. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1086. />
  1087. <Route
  1088. path="widget/new/"
  1089. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1090. />
  1091. </Route>
  1092. </Fragment>
  1093. <Fragment>
  1094. {USING_CUSTOMER_DOMAIN && (
  1095. <Route
  1096. path="/dashboards/new/:templateId"
  1097. component={withDomainRequired(
  1098. make(() => import('sentry/views/dashboards/create'))
  1099. )}
  1100. key="orgless-dashboards-new-template-route"
  1101. >
  1102. <Route
  1103. path="widget/:widgetId/"
  1104. component={make(() => import('sentry/views/dashboards/create'))}
  1105. />
  1106. </Route>
  1107. )}
  1108. <Route
  1109. path="/organizations/:orgId/dashboards/new/:templateId"
  1110. component={withDomainRedirect(
  1111. make(() => import('sentry/views/dashboards/create'))
  1112. )}
  1113. key="org-dashboards-new-template"
  1114. >
  1115. <Route
  1116. path="widget/:widgetId/"
  1117. component={make(() => import('sentry/views/dashboards/create'))}
  1118. />
  1119. </Route>
  1120. </Fragment>
  1121. <Redirect
  1122. from="/organizations/:orgId/dashboards/:dashboardId/"
  1123. to="/organizations/:orgId/dashboard/:dashboardId/"
  1124. />
  1125. {USING_CUSTOMER_DOMAIN && (
  1126. <Redirect from="/dashboards/:dashboardId/" to="/dashboard/:dashboardId/" />
  1127. )}
  1128. <Route
  1129. path="/dashboard/:dashboardId/"
  1130. component={make(() => import('sentry/views/dashboards/view'))}
  1131. withOrgPath
  1132. >
  1133. <Route
  1134. path="widget/:widgetIndex/edit/"
  1135. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1136. />
  1137. <Route
  1138. path="widget/new/"
  1139. component={make(() => import('sentry/views/dashboards/widgetBuilder'))}
  1140. />
  1141. <Route
  1142. path="widget/:widgetId/"
  1143. component={make(() => import('sentry/views/dashboards/view'))}
  1144. />
  1145. </Route>
  1146. </Fragment>
  1147. );
  1148. const alertChildRoutes = ({forCustomerDomain}: {forCustomerDomain: boolean}) => {
  1149. // ALERT CHILD ROUTES
  1150. return (
  1151. <Fragment>
  1152. <IndexRoute
  1153. component={make(() => import('sentry/views/alerts/list/incidents'))}
  1154. />
  1155. <Route path="rules/">
  1156. <IndexRoute
  1157. component={make(
  1158. () => import('sentry/views/alerts/list/rules/alertRulesList')
  1159. )}
  1160. />
  1161. <Route
  1162. path="details/:ruleId/"
  1163. component={make(() => import('sentry/views/alerts/rules/metric/details'))}
  1164. />
  1165. <Route
  1166. path=":projectId/"
  1167. component={make(() => import('sentry/views/alerts/builder/projectProvider'))}
  1168. >
  1169. <IndexRedirect
  1170. to={
  1171. forCustomerDomain
  1172. ? '/alerts/rules/'
  1173. : '/organizations/:orgId/alerts/rules/'
  1174. }
  1175. />
  1176. <Route
  1177. path=":ruleId/"
  1178. component={make(() => import('sentry/views/alerts/edit'))}
  1179. />
  1180. </Route>
  1181. <Route path=":projectId/:ruleId/details/">
  1182. <IndexRoute
  1183. component={make(
  1184. () => import('sentry/views/alerts/rules/issue/details/ruleDetails')
  1185. )}
  1186. />
  1187. </Route>
  1188. </Route>
  1189. <Route path="metric-rules/">
  1190. <IndexRedirect
  1191. to={
  1192. forCustomerDomain ? '/alerts/rules/' : '/organizations/:orgId/alerts/rules/'
  1193. }
  1194. />
  1195. <Route
  1196. path=":projectId/"
  1197. component={make(() => import('sentry/views/alerts/builder/projectProvider'))}
  1198. >
  1199. <IndexRedirect
  1200. to={
  1201. forCustomerDomain
  1202. ? '/alerts/rules/'
  1203. : '/organizations/:orgId/alerts/rules/'
  1204. }
  1205. />
  1206. <Route
  1207. path=":ruleId/"
  1208. component={make(() => import('sentry/views/alerts/edit'))}
  1209. />
  1210. </Route>
  1211. </Route>
  1212. <Route
  1213. path="wizard/"
  1214. component={make(() => import('sentry/views/alerts/builder/projectProvider'))}
  1215. >
  1216. <IndexRoute component={make(() => import('sentry/views/alerts/wizard'))} />
  1217. </Route>
  1218. <Route
  1219. path="new/"
  1220. component={make(() => import('sentry/views/alerts/builder/projectProvider'))}
  1221. >
  1222. <IndexRedirect
  1223. to={
  1224. forCustomerDomain
  1225. ? '/alerts/wizard/'
  1226. : '/organizations/:orgId/alerts/wizard/'
  1227. }
  1228. />
  1229. <Route
  1230. path=":alertType/"
  1231. component={make(() => import('sentry/views/alerts/create'))}
  1232. />
  1233. </Route>
  1234. <Route
  1235. path=":alertId/"
  1236. component={make(() => import('sentry/views/alerts/incidentRedirect'))}
  1237. />
  1238. <Route
  1239. path=":projectId/"
  1240. component={make(() => import('sentry/views/alerts/builder/projectProvider'))}
  1241. >
  1242. <Route
  1243. path="new/"
  1244. component={make(() => import('sentry/views/alerts/create'))}
  1245. />
  1246. <Route
  1247. path="wizard/"
  1248. component={make(() => import('sentry/views/alerts/wizard'))}
  1249. />
  1250. </Route>
  1251. </Fragment>
  1252. );
  1253. };
  1254. // ALERT ROUTES
  1255. const alertRoutes = (
  1256. <Fragment>
  1257. {USING_CUSTOMER_DOMAIN && (
  1258. <Route
  1259. path="/alerts/"
  1260. component={withDomainRequired(make(() => import('sentry/views/alerts')))}
  1261. key="orgless-alerts-route"
  1262. >
  1263. {alertChildRoutes({forCustomerDomain: true})}
  1264. </Route>
  1265. )}
  1266. <Route
  1267. path="/organizations/:orgId/alerts/"
  1268. component={withDomainRedirect(make(() => import('sentry/views/alerts')))}
  1269. key="org-alerts"
  1270. >
  1271. {alertChildRoutes({forCustomerDomain: false})}
  1272. </Route>
  1273. </Fragment>
  1274. );
  1275. const cronsRoutes = (
  1276. <Route
  1277. path="/crons/"
  1278. component={make(() => import('sentry/views/monitors'))}
  1279. withOrgPath
  1280. >
  1281. <IndexRoute component={make(() => import('sentry/views/monitors/overview'))} />
  1282. <Route
  1283. path="create/"
  1284. component={make(() => import('sentry/views/monitors/create'))}
  1285. />
  1286. <Redirect from=":monitorSlug/" to="/crons/" />
  1287. <Redirect from=":monitorSlug/edit/" to="/crons/" />
  1288. <Route
  1289. path=":projectId/:monitorSlug/"
  1290. component={make(() => import('sentry/views/monitors/details'))}
  1291. />
  1292. <Route
  1293. path=":projectId/:monitorSlug/edit/"
  1294. component={make(() => import('sentry/views/monitors/edit'))}
  1295. />
  1296. </Route>
  1297. );
  1298. const replayRoutes = (
  1299. <Route
  1300. path="/replays/"
  1301. component={make(() => import('sentry/views/replays/index'))}
  1302. withOrgPath
  1303. >
  1304. <IndexRoute component={make(() => import('sentry/views/replays/list'))} />
  1305. <Route
  1306. path="selectors/"
  1307. component={make(
  1308. () => import('sentry/views/replays/deadRageClick/deadRageClickList')
  1309. )}
  1310. />
  1311. <Route
  1312. path=":replaySlug/"
  1313. component={make(() => import('sentry/views/replays/details'))}
  1314. />
  1315. </Route>
  1316. );
  1317. const releasesRoutes = (
  1318. <Fragment>
  1319. <Route path="/releases/" withOrgPath>
  1320. <IndexRoute component={make(() => import('sentry/views/releases/list'))} />
  1321. <Route
  1322. path=":release/"
  1323. component={make(() => import('sentry/views/releases/detail'))}
  1324. >
  1325. <IndexRoute
  1326. component={make(() => import('sentry/views/releases/detail/overview'))}
  1327. />
  1328. <Route
  1329. path="commits/"
  1330. component={make(
  1331. () => import('sentry/views/releases/detail/commitsAndFiles/commits')
  1332. )}
  1333. />
  1334. <Route
  1335. path="files-changed/"
  1336. component={make(
  1337. () => import('sentry/views/releases/detail/commitsAndFiles/filesChanged')
  1338. )}
  1339. />
  1340. </Route>
  1341. </Route>
  1342. <Redirect
  1343. from="/releases/new-events/"
  1344. to="/organizations/:orgId/releases/:release/"
  1345. />
  1346. <Redirect
  1347. from="/releases/all-events/"
  1348. to="/organizations/:orgId/releases/:release/"
  1349. />
  1350. </Fragment>
  1351. );
  1352. const activityRoutes = (
  1353. <Route
  1354. path="/activity/"
  1355. component={make(() => import('sentry/views/organizationActivity'))}
  1356. withOrgPath
  1357. />
  1358. );
  1359. const statsRoutes = (
  1360. <Fragment>
  1361. <Route path="/stats/" withOrgPath>
  1362. <IndexRoute component={make(() => import('sentry/views/organizationStats'))} />
  1363. <Route
  1364. component={make(() => import('sentry/views/organizationStats/teamInsights'))}
  1365. >
  1366. <Route
  1367. path="issues/"
  1368. component={make(
  1369. () => import('sentry/views/organizationStats/teamInsights/issues')
  1370. )}
  1371. />
  1372. <Route
  1373. path="health/"
  1374. component={make(
  1375. () => import('sentry/views/organizationStats/teamInsights/health')
  1376. )}
  1377. />
  1378. </Route>
  1379. </Route>
  1380. <Redirect
  1381. from="/organizations/:orgId/stats/team/"
  1382. to="/organizations/:orgId/stats/issues/"
  1383. />
  1384. </Fragment>
  1385. );
  1386. // TODO(mark) Long term this /queries route should go away and /discover
  1387. // should be the canonical route for discover2. We have a redirect right now
  1388. // as /discover was for discover 1 and most of the application is linking to
  1389. // /discover/queries and not /discover
  1390. const discoverRoutes = (
  1391. <Route
  1392. path="/discover/"
  1393. component={make(() => import('sentry/views/discover'))}
  1394. withOrgPath
  1395. >
  1396. <IndexRedirect to="queries/" />
  1397. <Route
  1398. path="homepage/"
  1399. component={make(() => import('sentry/views/discover/homepage'))}
  1400. />
  1401. <Route
  1402. path="queries/"
  1403. component={make(() => import('sentry/views/discover/landing'))}
  1404. />
  1405. <Route
  1406. path="results/"
  1407. component={make(() => import('sentry/views/discover/results'))}
  1408. />
  1409. <Route
  1410. path=":eventSlug/"
  1411. component={make(() => import('sentry/views/discover/eventDetails'))}
  1412. />
  1413. </Route>
  1414. );
  1415. const llmMonitoringRedirects = USING_CUSTOMER_DOMAIN ? (
  1416. <Redirect
  1417. from="/llm-monitoring/"
  1418. to={`/${INSIGHTS_BASE_URL}/${MODULE_BASE_URLS[ModuleName.AI]}/`}
  1419. />
  1420. ) : (
  1421. <Redirect
  1422. from="/organizations/:orgId/llm-monitoring/"
  1423. to={`/organizations/:orgId/${INSIGHTS_BASE_URL}/${MODULE_BASE_URLS[ModuleName.AI]}/`}
  1424. />
  1425. );
  1426. const insightsRedirects = Object.values(MODULE_BASE_URLS)
  1427. .map(
  1428. moduleBaseURL =>
  1429. moduleBaseURL && (
  1430. <Redirect
  1431. key={moduleBaseURL}
  1432. from={`${moduleBaseURL}/*`}
  1433. to={`/${INSIGHTS_BASE_URL}/${moduleBaseURL}/:splat`}
  1434. />
  1435. )
  1436. )
  1437. .filter(Boolean);
  1438. const insightsRoutes = (
  1439. <Route path={`/${INSIGHTS_BASE_URL}/`} withOrgPath>
  1440. <Route path={`${MODULE_BASE_URLS[ModuleName.DB]}/`}>
  1441. <IndexRoute
  1442. component={make(
  1443. () => import('sentry/views/insights/database/views/databaseLandingPage')
  1444. )}
  1445. />
  1446. <Route
  1447. path="spans/span/:groupId/"
  1448. component={make(
  1449. () => import('sentry/views/insights/database/views/databaseSpanSummaryPage')
  1450. )}
  1451. />
  1452. </Route>
  1453. <Route path={`${MODULE_BASE_URLS[ModuleName.HTTP]}/`}>
  1454. <IndexRoute
  1455. component={make(
  1456. () => import('sentry/views/insights/http/views/httpLandingPage')
  1457. )}
  1458. />
  1459. <Route
  1460. path="domains/"
  1461. component={make(
  1462. () => import('sentry/views/insights/http/views/httpDomainSummaryPage')
  1463. )}
  1464. />
  1465. </Route>
  1466. <Route path={`${MODULE_BASE_URLS[ModuleName.CACHE]}/`}>
  1467. <IndexRoute
  1468. component={make(
  1469. () => import('sentry/views/insights/cache/views/cacheLandingPage')
  1470. )}
  1471. />
  1472. </Route>
  1473. <Route path={`${MODULE_BASE_URLS[ModuleName.VITAL]}/`}>
  1474. <IndexRoute
  1475. component={make(
  1476. () =>
  1477. import('sentry/views/insights/browser/webVitals/views/webVitalsLandingPage')
  1478. )}
  1479. />
  1480. <Route
  1481. path="overview/"
  1482. component={make(
  1483. () => import('sentry/views/insights/browser/webVitals/views/pageOverview')
  1484. )}
  1485. />
  1486. </Route>
  1487. <Redirect
  1488. from="browser/resources/"
  1489. to={`${MODULE_BASE_URLS[ModuleName.RESOURCE]}/`}
  1490. />
  1491. <Route path={`${MODULE_BASE_URLS[ModuleName.RESOURCE]}/`}>
  1492. <IndexRoute
  1493. component={make(
  1494. () =>
  1495. import('sentry/views/insights/browser/resources/views/resourcesLandingPage')
  1496. )}
  1497. />
  1498. <Route
  1499. path="spans/span/:groupId/"
  1500. component={make(
  1501. () =>
  1502. import('sentry/views/insights/browser/resources/views/resourceSummaryPage')
  1503. )}
  1504. />
  1505. </Route>
  1506. <Route path={`${MODULE_BASE_URLS[ModuleName.QUEUE]}/`}>
  1507. <IndexRoute
  1508. component={make(
  1509. () => import('sentry/views/insights/queues/views/queuesLandingPage')
  1510. )}
  1511. />
  1512. <Route
  1513. path="destination/"
  1514. component={make(
  1515. () => import('sentry/views/insights/queues/views/destinationSummaryPage')
  1516. )}
  1517. />
  1518. </Route>
  1519. <Route path={`${MODULE_BASE_URLS[ModuleName.SCREEN_LOAD]}/`}>
  1520. <IndexRoute
  1521. component={make(
  1522. () =>
  1523. import(
  1524. 'sentry/views/insights/mobile/screenload/views/screenloadLandingPage'
  1525. )
  1526. )}
  1527. />
  1528. <Route
  1529. path="spans/"
  1530. component={make(
  1531. () =>
  1532. import('sentry/views/insights/mobile/screenload/views/screenLoadSpansPage')
  1533. )}
  1534. />
  1535. </Route>
  1536. <Route path={`${MODULE_BASE_URLS[ModuleName.APP_START]}/`}>
  1537. <IndexRoute
  1538. component={make(
  1539. () =>
  1540. import('sentry/views/insights/mobile/appStarts/views/appStartsLandingPage')
  1541. )}
  1542. />
  1543. <Route
  1544. path="spans/"
  1545. component={make(
  1546. () => import('sentry/views/insights/mobile/appStarts/views/screenSummaryPage')
  1547. )}
  1548. />
  1549. </Route>
  1550. <Route path={`${MODULE_BASE_URLS[ModuleName.MOBILE_UI]}/`}>
  1551. <IndexRoute
  1552. component={make(
  1553. () => import('sentry/views/insights/mobile/ui/views/uiLandingPage')
  1554. )}
  1555. />
  1556. <Route
  1557. path="spans/"
  1558. component={make(
  1559. () => import('sentry/views/insights/mobile/ui/views/screenSummaryPage')
  1560. )}
  1561. />
  1562. </Route>
  1563. <Route path={`${MODULE_BASE_URLS[ModuleName.AI]}/`}>
  1564. <IndexRoute
  1565. component={make(
  1566. () =>
  1567. import('sentry/views/insights/llmMonitoring/views/llmMonitoringLandingPage')
  1568. )}
  1569. />
  1570. <Route
  1571. path="pipeline-type/:groupId/"
  1572. component={make(
  1573. () =>
  1574. import('sentry/views/insights/llmMonitoring/views/llmMonitoringDetailsPage')
  1575. )}
  1576. />
  1577. </Route>
  1578. </Route>
  1579. );
  1580. const performanceRoutes = (
  1581. <Route
  1582. path="/performance/"
  1583. component={make(() => import('sentry/views/performance'))}
  1584. withOrgPath
  1585. >
  1586. <IndexRoute component={make(() => import('sentry/views/performance/content'))} />
  1587. <Route
  1588. path="trends/"
  1589. component={make(() => import('sentry/views/performance/trends'))}
  1590. />
  1591. <Route path="summary/">
  1592. <IndexRoute
  1593. component={make(
  1594. () =>
  1595. import('sentry/views/performance/transactionSummary/transactionOverview')
  1596. )}
  1597. />
  1598. <Route
  1599. path="replays/"
  1600. component={make(
  1601. () => import('sentry/views/performance/transactionSummary/transactionReplays')
  1602. )}
  1603. />
  1604. <Route
  1605. path="vitals/"
  1606. component={make(
  1607. () => import('sentry/views/performance/transactionSummary/transactionVitals')
  1608. )}
  1609. />
  1610. <Route
  1611. path="tags/"
  1612. component={make(
  1613. () => import('sentry/views/performance/transactionSummary/transactionTags')
  1614. )}
  1615. />
  1616. <Route
  1617. path="events/"
  1618. component={make(
  1619. () => import('sentry/views/performance/transactionSummary/transactionEvents')
  1620. )}
  1621. />
  1622. <Route
  1623. path="anomalies/"
  1624. component={make(
  1625. () =>
  1626. import('sentry/views/performance/transactionSummary/transactionAnomalies')
  1627. )}
  1628. />
  1629. <Route
  1630. path="profiles/"
  1631. component={make(
  1632. () =>
  1633. import('sentry/views/performance/transactionSummary/transactionProfiles')
  1634. )}
  1635. />
  1636. <Route
  1637. path="aggregateWaterfall/"
  1638. component={make(
  1639. () =>
  1640. import('sentry/views/performance/transactionSummary/aggregateSpanWaterfall')
  1641. )}
  1642. />
  1643. <Route path="spans/">
  1644. <IndexRoute
  1645. component={make(
  1646. () => import('sentry/views/performance/transactionSummary/transactionSpans')
  1647. )}
  1648. />
  1649. <Route
  1650. path=":spanSlug/"
  1651. component={make(
  1652. () =>
  1653. import(
  1654. 'sentry/views/performance/transactionSummary/transactionSpans/spanDetails'
  1655. )
  1656. )}
  1657. />
  1658. </Route>
  1659. </Route>
  1660. <Route
  1661. path="vitaldetail/"
  1662. component={make(() => import('sentry/views/performance/vitalDetail'))}
  1663. />
  1664. <Route
  1665. path="trace/:traceSlug/"
  1666. component={make(() => import('sentry/views/performance/traceDetails'))}
  1667. />
  1668. {insightsRedirects}
  1669. <Redirect
  1670. from="browser/resources"
  1671. to={`/${INSIGHTS_BASE_URL}/${MODULE_BASE_URLS[ModuleName.RESOURCE]}/`}
  1672. />
  1673. <Route
  1674. path=":eventSlug/"
  1675. component={make(() => import('sentry/views/performance/transactionDetails'))}
  1676. />
  1677. </Route>
  1678. );
  1679. const tracesRoutes = (
  1680. <Route
  1681. path="/traces/"
  1682. component={make(() => import('sentry/views/traces'))}
  1683. withOrgPath
  1684. />
  1685. );
  1686. const userFeedbackRoutes = (
  1687. <Route
  1688. path="/user-feedback/"
  1689. component={make(() => import('sentry/views/userFeedback'))}
  1690. withOrgPath
  1691. />
  1692. );
  1693. const feedbackv2Routes = (
  1694. <Route
  1695. path="/feedback/"
  1696. component={make(() => import('sentry/views/feedback/index'))}
  1697. withOrgPath
  1698. >
  1699. <IndexRoute
  1700. component={make(() => import('sentry/views/feedback/feedbackListPage'))}
  1701. />
  1702. </Route>
  1703. );
  1704. const issueListRoutes = (
  1705. <Route path="/issues" component={errorHandler(IssueListContainer)} withOrgPath>
  1706. <IndexRoute component={errorHandler(IssueListOverview)} />
  1707. <Route path="searches/:searchId/" component={errorHandler(IssueListOverview)} />
  1708. </Route>
  1709. );
  1710. // Once org issues is complete, these routes can be nested under
  1711. // /organizations/:orgId/issues
  1712. const issueTabs = ({forCustomerDomain}: {forCustomerDomain: boolean}) => {
  1713. const hoc = forCustomerDomain ? withDomainRequired : x => x;
  1714. return (
  1715. <Fragment>
  1716. <IndexRoute
  1717. component={hoc(
  1718. make(() => import('sentry/views/issueDetails/groupEventDetails'))
  1719. )}
  1720. />
  1721. <Route
  1722. path={TabPaths[Tab.REPLAYS]}
  1723. component={hoc(make(() => import('sentry/views/issueDetails/groupReplays')))}
  1724. />
  1725. <Route
  1726. path={TabPaths[Tab.ACTIVITY]}
  1727. component={hoc(make(() => import('sentry/views/issueDetails/groupActivity')))}
  1728. />
  1729. <Route
  1730. path={TabPaths[Tab.EVENTS]}
  1731. component={hoc(make(() => import('sentry/views/issueDetails/groupEvents')))}
  1732. />
  1733. <Route
  1734. path={TabPaths[Tab.TAGS]}
  1735. component={hoc(make(() => import('sentry/views/issueDetails/groupTags')))}
  1736. />
  1737. <Route
  1738. path={`${TabPaths[Tab.TAGS]}:tagKey/`}
  1739. component={make(() => import('sentry/views/issueDetails/groupTagValues'))}
  1740. />
  1741. <Route
  1742. path={TabPaths[Tab.USER_FEEDBACK]}
  1743. component={hoc(
  1744. make(() => import('sentry/views/issueDetails/groupUserFeedback'))
  1745. )}
  1746. />
  1747. <Route
  1748. path={TabPaths[Tab.ATTACHMENTS]}
  1749. component={hoc(
  1750. make(() => import('sentry/views/issueDetails/groupEventAttachments'))
  1751. )}
  1752. />
  1753. <Route
  1754. path={TabPaths[Tab.SIMILAR_ISSUES]}
  1755. component={hoc(
  1756. make(() => import('sentry/views/issueDetails/groupSimilarIssues'))
  1757. )}
  1758. />
  1759. <Route
  1760. path={TabPaths[Tab.MERGED]}
  1761. component={hoc(make(() => import('sentry/views/issueDetails/groupMerged')))}
  1762. />
  1763. </Fragment>
  1764. );
  1765. };
  1766. const issueDetailsChildRoutes = ({forCustomerDomain}: {forCustomerDomain: boolean}) => (
  1767. <Fragment>
  1768. {issueTabs({forCustomerDomain})}
  1769. <Route path={`${TabPaths[Tab.EVENTS]}:eventId/`}>
  1770. {issueTabs({forCustomerDomain})}
  1771. </Route>
  1772. </Fragment>
  1773. );
  1774. const issueDetailsRoutes = (
  1775. <Fragment>
  1776. <Route
  1777. path="/organizations/:orgId/issues/:groupId/"
  1778. component={withDomainRedirect(
  1779. make(() => import('sentry/views/issueDetails/groupDetails'))
  1780. )}
  1781. key="org-issues-group-id"
  1782. >
  1783. {issueDetailsChildRoutes({forCustomerDomain: false})}
  1784. </Route>
  1785. {USING_CUSTOMER_DOMAIN && (
  1786. <Route
  1787. path="/issues/:groupId/"
  1788. component={withDomainRequired(
  1789. make(() => import('sentry/views/issueDetails/groupDetails'))
  1790. )}
  1791. key="orgless-issues-group-id-route"
  1792. >
  1793. {issueDetailsChildRoutes({forCustomerDomain: true})}
  1794. </Route>
  1795. )}
  1796. </Fragment>
  1797. );
  1798. // These are the "manage" pages. For sentry.io, these are _different_ from
  1799. // the SaaS admin routes in getsentry.
  1800. const adminManageRoutes = (
  1801. <Route
  1802. path="/manage/"
  1803. component={make(() => import('sentry/views/admin/adminLayout'))}
  1804. >
  1805. <IndexRoute component={make(() => import('sentry/views/admin/adminOverview'))} />
  1806. <Route
  1807. path="buffer/"
  1808. component={make(() => import('sentry/views/admin/adminBuffer'))}
  1809. />
  1810. <Route
  1811. path="relays/"
  1812. component={make(() => import('sentry/views/admin/adminRelays'))}
  1813. />
  1814. <Route
  1815. path="organizations/"
  1816. component={make(() => import('sentry/views/admin/adminOrganizations'))}
  1817. />
  1818. <Route
  1819. path="projects/"
  1820. component={make(() => import('sentry/views/admin/adminProjects'))}
  1821. />
  1822. <Route
  1823. path="queue/"
  1824. component={make(() => import('sentry/views/admin/adminQueue'))}
  1825. />
  1826. <Route
  1827. path="quotas/"
  1828. component={make(() => import('sentry/views/admin/adminQuotas'))}
  1829. />
  1830. <Route
  1831. path="settings/"
  1832. component={make(() => import('sentry/views/admin/adminSettings'))}
  1833. />
  1834. <Route path="users/">
  1835. <IndexRoute component={make(() => import('sentry/views/admin/adminUsers'))} />
  1836. <Route
  1837. path=":id"
  1838. component={make(() => import('sentry/views/admin/adminUserEdit'))}
  1839. />
  1840. </Route>
  1841. <Route
  1842. path="status/mail/"
  1843. component={make(() => import('sentry/views/admin/adminMail'))}
  1844. />
  1845. <Route
  1846. path="status/environment/"
  1847. component={make(() => import('sentry/views/admin/adminEnvironment'))}
  1848. />
  1849. <Route
  1850. path="status/packages/"
  1851. component={make(() => import('sentry/views/admin/adminPackages'))}
  1852. />
  1853. <Route
  1854. path="status/warnings/"
  1855. component={make(() => import('sentry/views/admin/adminWarnings'))}
  1856. />
  1857. </Route>
  1858. );
  1859. // XXX(epurkhiser): This should probably go away. It's not totally clear to
  1860. // me why we need the OrganizationRoot root container.
  1861. const legacyOrganizationRootRoutes = (
  1862. <Route component={errorHandler(OrganizationRoot)}>
  1863. <Redirect from="/organizations/:orgId/teams/new/" to="/settings/:orgId/teams/" />
  1864. <Route path="/organizations/:orgId/">
  1865. {hook('routes:organization')}
  1866. <IndexRedirect to="issues/" />
  1867. <Redirect from="teams/" to="/settings/:orgId/teams/" />
  1868. <Redirect from="teams/your-teams/" to="/settings/:orgId/teams/" />
  1869. <Redirect from="teams/all-teams/" to="/settings/:orgId/teams/" />
  1870. <Redirect from="teams/:teamId/" to="/settings/:orgId/teams/:teamId/" />
  1871. <Redirect
  1872. from="teams/:teamId/members/"
  1873. to="/settings/:orgId/teams/:teamId/members/"
  1874. />
  1875. <Redirect
  1876. from="teams/:teamId/projects/"
  1877. to="/settings/:orgId/teams/:teamId/projects/"
  1878. />
  1879. <Redirect
  1880. from="teams/:teamId/settings/"
  1881. to="/settings/:orgId/teams/:teamId/settings/"
  1882. />
  1883. <Redirect from="settings/" to="/settings/:orgId/" />
  1884. <Redirect from="api-keys/" to="/settings/:orgId/api-keys/" />
  1885. <Redirect from="api-keys/:apiKey/" to="/settings/:orgId/api-keys/:apiKey/" />
  1886. <Redirect from="members/" to="/settings/:orgId/members/" />
  1887. <Redirect from="members/:memberId/" to="/settings/:orgId/members/:memberId/" />
  1888. <Redirect from="rate-limits/" to="/settings/:orgId/rate-limits/" />
  1889. <Redirect from="repos/" to="/settings/:orgId/repos/" />
  1890. </Route>
  1891. </Route>
  1892. );
  1893. const gettingStartedRoutes = (
  1894. <Fragment>
  1895. {USING_CUSTOMER_DOMAIN && (
  1896. <Fragment>
  1897. <Redirect
  1898. from="/getting-started/:projectId/"
  1899. to="/projects/:projectId/getting-started/"
  1900. />
  1901. <Redirect
  1902. from="/getting-started/:projectId/:platform/"
  1903. to="/projects/:projectId/getting-started/"
  1904. />
  1905. </Fragment>
  1906. )}
  1907. <Redirect
  1908. from="/:orgId/:projectId/getting-started/"
  1909. to="/organizations/:orgId/projects/:projectId/getting-started/"
  1910. />
  1911. <Redirect
  1912. from="/:orgId/:projectId/getting-started/:platform/"
  1913. to="/organizations/:orgId/projects/:projectId/getting-started/"
  1914. />
  1915. </Fragment>
  1916. );
  1917. const profilingRoutes = (
  1918. <Route
  1919. path="/profiling/"
  1920. component={make(() => import('sentry/views/profiling'))}
  1921. withOrgPath
  1922. >
  1923. <IndexRoute component={make(() => import('sentry/views/profiling/content'))} />
  1924. <Route
  1925. path="summary/:projectId/"
  1926. component={make(() => import('sentry/views/profiling/profileSummary'))}
  1927. />
  1928. <Route
  1929. path="profile/:projectId/differential-flamegraph/"
  1930. component={make(() => import('sentry/views/profiling/differentialFlamegraph'))}
  1931. />
  1932. <Route
  1933. path="profile/:projectId/"
  1934. component={make(() => import('sentry/views/profiling/continuousProfileProvider'))}
  1935. >
  1936. <Route
  1937. path="flamegraph/"
  1938. component={make(
  1939. () => import('sentry/views/profiling/continuousProfileFlamegraph')
  1940. )}
  1941. />
  1942. </Route>
  1943. <Route
  1944. path="profile/:projectId/:eventId/"
  1945. component={make(() => import('sentry/views/profiling/profilesProvider'))}
  1946. >
  1947. <Route
  1948. path="flamegraph/"
  1949. component={make(() => import('sentry/views/profiling/profileFlamechart'))}
  1950. />
  1951. </Route>
  1952. </Route>
  1953. );
  1954. const metricsRoutes = (
  1955. <Fragment>
  1956. <Route
  1957. path="/metrics/"
  1958. component={make(() => import('sentry/views/metrics'))}
  1959. withOrgPath
  1960. >
  1961. <IndexRoute component={make(() => import('sentry/views/metrics/metrics'))} />
  1962. </Route>
  1963. {/* TODO(ddm): fade this out */}
  1964. <Redirect from="/ddm/" to="/metrics/" />
  1965. </Fragment>
  1966. );
  1967. // Support for deprecated URLs (pre-Sentry 10). We just redirect users to new
  1968. // canonical URLs.
  1969. //
  1970. // XXX(epurkhiser): Can these be moved over to the legacyOrgRedirects routes,
  1971. // or do these need to be nested into the OrganizationLayout tree?
  1972. const legacyOrgRedirects = (
  1973. <Route path="/:orgId/:projectId/">
  1974. <IndexRoute
  1975. component={errorHandler(
  1976. redirectDeprecatedProjectRoute(
  1977. ({orgId, projectId}) => `/organizations/${orgId}/issues/?project=${projectId}`
  1978. )
  1979. )}
  1980. />
  1981. <Route
  1982. path="issues/"
  1983. component={errorHandler(
  1984. redirectDeprecatedProjectRoute(
  1985. ({orgId, projectId}) => `/organizations/${orgId}/issues/?project=${projectId}`
  1986. )
  1987. )}
  1988. />
  1989. <Route
  1990. path="dashboard/"
  1991. component={errorHandler(
  1992. redirectDeprecatedProjectRoute(
  1993. ({orgId, projectId}) =>
  1994. `/organizations/${orgId}/dashboards/?project=${projectId}`
  1995. )
  1996. )}
  1997. />
  1998. <Route
  1999. path="user-feedback/"
  2000. component={errorHandler(
  2001. redirectDeprecatedProjectRoute(
  2002. ({orgId, projectId}) =>
  2003. `/organizations/${orgId}/user-feedback/?project=${projectId}`
  2004. )
  2005. )}
  2006. />
  2007. <Route
  2008. path="releases/"
  2009. component={errorHandler(
  2010. redirectDeprecatedProjectRoute(
  2011. ({orgId, projectId}) =>
  2012. `/organizations/${orgId}/releases/?project=${projectId}`
  2013. )
  2014. )}
  2015. />
  2016. <Route
  2017. path="releases/:version/"
  2018. component={errorHandler(
  2019. redirectDeprecatedProjectRoute(
  2020. ({orgId, projectId, router}) =>
  2021. `/organizations/${orgId}/releases/${router.params.version}/?project=${projectId}`
  2022. )
  2023. )}
  2024. />
  2025. <Route
  2026. path="releases/:version/new-events/"
  2027. component={errorHandler(
  2028. redirectDeprecatedProjectRoute(
  2029. ({orgId, projectId, router}) =>
  2030. `/organizations/${orgId}/releases/${router.params.version}/new-events/?project=${projectId}`
  2031. )
  2032. )}
  2033. />
  2034. <Route
  2035. path="releases/:version/all-events/"
  2036. component={errorHandler(
  2037. redirectDeprecatedProjectRoute(
  2038. ({orgId, projectId, router}) =>
  2039. `/organizations/${orgId}/releases/${router.params.version}/all-events/?project=${projectId}`
  2040. )
  2041. )}
  2042. />
  2043. <Route
  2044. path="releases/:version/commits/"
  2045. component={errorHandler(
  2046. redirectDeprecatedProjectRoute(
  2047. ({orgId, projectId, router}) =>
  2048. `/organizations/${orgId}/releases/${router.params.version}/commits/?project=${projectId}`
  2049. )
  2050. )}
  2051. />
  2052. </Route>
  2053. );
  2054. const organizationRoutes = (
  2055. <Route component={errorHandler(OrganizationLayout)}>
  2056. {settingsRoutes}
  2057. {projectsRoutes}
  2058. {dashboardRoutes}
  2059. {userFeedbackRoutes}
  2060. {feedbackv2Routes}
  2061. {issueListRoutes}
  2062. {issueDetailsRoutes}
  2063. {alertRoutes}
  2064. {cronsRoutes}
  2065. {replayRoutes}
  2066. {releasesRoutes}
  2067. {activityRoutes}
  2068. {statsRoutes}
  2069. {discoverRoutes}
  2070. {performanceRoutes}
  2071. {tracesRoutes}
  2072. {insightsRoutes}
  2073. {llmMonitoringRedirects}
  2074. {profilingRoutes}
  2075. {metricsRoutes}
  2076. {gettingStartedRoutes}
  2077. {adminManageRoutes}
  2078. {legacyOrganizationRootRoutes}
  2079. {legacyOrgRedirects}
  2080. </Route>
  2081. );
  2082. const legacyRedirectRoutes = (
  2083. <Route path="/:orgId/">
  2084. <IndexRedirect to="/organizations/:orgId/" />
  2085. <Route path=":projectId/settings/">
  2086. <Redirect from="teams/" to="/settings/:orgId/projects/:projectId/teams/" />
  2087. <Redirect from="alerts/" to="/settings/:orgId/projects/:projectId/alerts/" />
  2088. <Redirect
  2089. from="alerts/rules/"
  2090. to="/settings/:orgId/projects/:projectId/alerts/rules/"
  2091. />
  2092. <Redirect
  2093. from="alerts/rules/new/"
  2094. to="/settings/:orgId/projects/:projectId/alerts/rules/new/"
  2095. />
  2096. <Redirect
  2097. from="alerts/rules/:ruleId/"
  2098. to="/settings/:orgId/projects/:projectId/alerts/rules/:ruleId/"
  2099. />
  2100. <Redirect
  2101. from="environments/"
  2102. to="/settings/:orgId/projects/:projectId/environments/"
  2103. />
  2104. <Redirect
  2105. from="environments/hidden/"
  2106. to="/settings/:orgId/projects/:projectId/environments/hidden/"
  2107. />
  2108. <Redirect from="tags/" to="/settings/projects/:orgId/projects/:projectId/tags/" />
  2109. <Redirect
  2110. from="issue-tracking/"
  2111. to="/settings/:orgId/projects/:projectId/issue-tracking/"
  2112. />
  2113. <Redirect
  2114. from="release-tracking/"
  2115. to="/settings/:orgId/projects/:projectId/release-tracking/"
  2116. />
  2117. <Redirect
  2118. from="ownership/"
  2119. to="/settings/:orgId/projects/:projectId/ownership/"
  2120. />
  2121. <Redirect
  2122. from="data-forwarding/"
  2123. to="/settings/:orgId/projects/:projectId/data-forwarding/"
  2124. />
  2125. <Redirect
  2126. from="debug-symbols/"
  2127. to="/settings/:orgId/projects/:projectId/debug-symbols/"
  2128. />
  2129. <Redirect from="filters/" to="/settings/:orgId/projects/:projectId/filters/" />
  2130. <Redirect from="hooks/" to="/settings/:orgId/projects/:projectId/hooks/" />
  2131. <Redirect from="keys/" to="/settings/:orgId/projects/:projectId/keys/" />
  2132. <Redirect
  2133. from="keys/:keyId/"
  2134. to="/settings/:orgId/projects/:projectId/keys/:keyId/"
  2135. />
  2136. <Redirect
  2137. from="user-feedback/"
  2138. to="/settings/:orgId/projects/:projectId/user-feedback/"
  2139. />
  2140. <Redirect
  2141. from="security-headers/"
  2142. to="/settings/:orgId/projects/:projectId/security-headers/"
  2143. />
  2144. <Redirect
  2145. from="security-headers/csp/"
  2146. to="/settings/:orgId/projects/:projectId/security-headers/csp/"
  2147. />
  2148. <Redirect
  2149. from="security-headers/expect-ct/"
  2150. to="/settings/:orgId/projects/:projectId/security-headers/expect-ct/"
  2151. />
  2152. <Redirect
  2153. from="security-headers/hpkp/"
  2154. to="/settings/:orgId/projects/:projectId/security-headers/hpkp/"
  2155. />
  2156. <Redirect from="plugins/" to="/settings/:orgId/projects/:projectId/plugins/" />
  2157. <Redirect
  2158. from="plugins/:pluginId/"
  2159. to="/settings/:orgId/projects/:projectId/plugins/:pluginId/"
  2160. />
  2161. <Redirect
  2162. from="integrations/:providerKey/"
  2163. to="/settings/:orgId/projects/:projectId/integrations/:providerKey/"
  2164. />
  2165. </Route>
  2166. <Redirect from=":projectId/group/:groupId/" to="issues/:groupId/" />
  2167. <Redirect
  2168. from=":projectId/issues/:groupId/"
  2169. to="/organizations/:orgId/issues/:groupId/"
  2170. />
  2171. <Redirect
  2172. from=":projectId/issues/:groupId/events/"
  2173. to="/organizations/:orgId/issues/:groupId/events/"
  2174. />
  2175. <Redirect
  2176. from=":projectId/issues/:groupId/events/:eventId/"
  2177. to="/organizations/:orgId/issues/:groupId/events/:eventId/"
  2178. />
  2179. <Redirect
  2180. from=":projectId/issues/:groupId/tags/"
  2181. to="/organizations/:orgId/issues/:groupId/tags/"
  2182. />
  2183. <Redirect
  2184. from=":projectId/issues/:groupId/tags/:tagKey/"
  2185. to="/organizations/:orgId/issues/:groupId/tags/:tagKey/"
  2186. />
  2187. <Redirect
  2188. from=":projectId/issues/:groupId/feedback/"
  2189. to="/organizations/:orgId/issues/:groupId/feedback/"
  2190. />
  2191. <Redirect
  2192. from=":projectId/issues/:groupId/similar/"
  2193. to="/organizations/:orgId/issues/:groupId/similar/"
  2194. />
  2195. <Redirect
  2196. from=":projectId/issues/:groupId/merged/"
  2197. to="/organizations/:orgId/issues/:groupId/merged/"
  2198. />
  2199. <Route
  2200. path=":projectId/events/:eventId/"
  2201. component={errorHandler(ProjectEventRedirect)}
  2202. />
  2203. </Route>
  2204. );
  2205. const appRoutes = (
  2206. <Route>
  2207. {experimentalSpaRoutes}
  2208. <Route path="/" component={errorHandler(App)}>
  2209. {rootRoutes}
  2210. {organizationRoutes}
  2211. {legacyRedirectRoutes}
  2212. <Route path="*" component={errorHandler(RouteNotFound)} />
  2213. </Route>
  2214. </Route>
  2215. );
  2216. return appRoutes;
  2217. }
  2218. // We load routes both when initializing the SDK (for routing integrations) and
  2219. // when the app renders Main. Memoize to avoid rebuilding the route tree.
  2220. export const routes = memoize(buildRoutes);
  2221. // Exported for use in tests.
  2222. export {buildRoutes};
  2223. function NoOp({children}: {children: JSX.Element}) {
  2224. return children;
  2225. }