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