routes.tsx 70 KB

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