routes.tsx 59 KB

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