routes.tsx 65 KB

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