routes.tsx 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822
  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/(searches/:searchId/)"
  1227. component={errorHandler(IssueListContainer)}
  1228. >
  1229. <Redirect from="/organizations/:orgId/" to="/organizations/:orgId/issues/" />
  1230. <IndexRoute component={errorHandler(IssueListOverview)} />
  1231. </Route>
  1232. );
  1233. // Once org issues is complete, these routes can be nested under
  1234. // /organizations/:orgId/issues
  1235. const issueDetailsRoutes = (
  1236. <Route
  1237. path="/organizations/:orgId/issues/:groupId/"
  1238. component={make(() => import('sentry/views/organizationGroupDetails'))}
  1239. >
  1240. <IndexRoute
  1241. component={make(
  1242. () => import('sentry/views/organizationGroupDetails/groupEventDetails')
  1243. )}
  1244. />
  1245. <Route
  1246. path={TabPaths[Tab.REPLAYS]}
  1247. component={make(
  1248. () => import('sentry/views/organizationGroupDetails/groupReplays')
  1249. )}
  1250. />
  1251. <Route
  1252. path={TabPaths[Tab.ACTIVITY]}
  1253. component={make(
  1254. () => import('sentry/views/organizationGroupDetails/groupActivity')
  1255. )}
  1256. />
  1257. <Route
  1258. path={TabPaths[Tab.EVENTS]}
  1259. component={make(
  1260. () => import('sentry/views/organizationGroupDetails/groupEvents')
  1261. )}
  1262. />
  1263. <Route
  1264. path={TabPaths[Tab.TAGS]}
  1265. component={make(() => import('sentry/views/organizationGroupDetails/groupTags'))}
  1266. />
  1267. <Route
  1268. path={`${TabPaths[Tab.TAGS]}:tagKey/`}
  1269. component={make(
  1270. () => import('sentry/views/organizationGroupDetails/groupTagValues')
  1271. )}
  1272. />
  1273. <Route
  1274. path={TabPaths[Tab.USER_FEEDBACK]}
  1275. component={make(
  1276. () => import('sentry/views/organizationGroupDetails/groupUserFeedback')
  1277. )}
  1278. />
  1279. <Route
  1280. path={TabPaths[Tab.ATTACHMENTS]}
  1281. component={make(
  1282. () => import('sentry/views/organizationGroupDetails/groupEventAttachments')
  1283. )}
  1284. />
  1285. <Route
  1286. path={TabPaths[Tab.SIMILAR_ISSUES]}
  1287. component={make(
  1288. () => import('sentry/views/organizationGroupDetails/groupSimilarIssues')
  1289. )}
  1290. />
  1291. <Route
  1292. path={TabPaths[Tab.MERGED]}
  1293. component={make(
  1294. () => import('sentry/views/organizationGroupDetails/groupMerged')
  1295. )}
  1296. />
  1297. <Route
  1298. path={TabPaths[Tab.GROUPING]}
  1299. component={make(() => import('sentry/views/organizationGroupDetails/grouping'))}
  1300. />
  1301. <Route path={`${TabPaths[Tab.EVENTS]}:eventId/`}>
  1302. <IndexRoute
  1303. component={make(
  1304. () => import('sentry/views/organizationGroupDetails/groupEventDetails')
  1305. )}
  1306. />
  1307. <Route
  1308. path={TabPaths[Tab.REPLAYS]}
  1309. component={make(
  1310. () => import('sentry/views/organizationGroupDetails/groupReplays')
  1311. )}
  1312. />
  1313. <Route
  1314. path={TabPaths[Tab.ACTIVITY]}
  1315. component={make(
  1316. () => import('sentry/views/organizationGroupDetails/groupActivity')
  1317. )}
  1318. />
  1319. <Route
  1320. path={TabPaths[Tab.EVENTS]}
  1321. component={make(
  1322. () => import('sentry/views/organizationGroupDetails/groupEvents')
  1323. )}
  1324. />
  1325. <Route
  1326. path={TabPaths[Tab.SIMILAR_ISSUES]}
  1327. component={make(
  1328. () => import('sentry/views/organizationGroupDetails/groupSimilarIssues')
  1329. )}
  1330. />
  1331. <Route
  1332. path={TabPaths[Tab.TAGS]}
  1333. component={make(
  1334. () => import('sentry/views/organizationGroupDetails/groupTags')
  1335. )}
  1336. />
  1337. <Route
  1338. path={`${TabPaths[Tab.TAGS]}:tagKey/`}
  1339. component={make(
  1340. () => import('sentry/views/organizationGroupDetails/groupTagValues')
  1341. )}
  1342. />
  1343. <Route
  1344. path={TabPaths[Tab.USER_FEEDBACK]}
  1345. component={make(
  1346. () => import('sentry/views/organizationGroupDetails/groupUserFeedback')
  1347. )}
  1348. />
  1349. <Route
  1350. path={TabPaths[Tab.ATTACHMENTS]}
  1351. component={make(
  1352. () => import('sentry/views/organizationGroupDetails/groupEventAttachments')
  1353. )}
  1354. />
  1355. <Route
  1356. path={TabPaths[Tab.MERGED]}
  1357. component={make(
  1358. () => import('sentry/views/organizationGroupDetails/groupMerged')
  1359. )}
  1360. />
  1361. <Route
  1362. path={TabPaths[Tab.GROUPING]}
  1363. component={make(() => import('sentry/views/organizationGroupDetails/grouping'))}
  1364. />
  1365. </Route>
  1366. </Route>
  1367. );
  1368. // These are the "manage" pages. For sentry.io, these are _different_ from
  1369. // the SaaS admin routes in getsentry.
  1370. const adminManageRoutes = (
  1371. <Route
  1372. path="/manage/"
  1373. component={make(() => import('sentry/views/admin/adminLayout'))}
  1374. >
  1375. <IndexRoute component={make(() => import('sentry/views/admin/adminOverview'))} />
  1376. <Route
  1377. path="buffer/"
  1378. component={make(() => import('sentry/views/admin/adminBuffer'))}
  1379. />
  1380. <Route
  1381. path="relays/"
  1382. component={make(() => import('sentry/views/admin/adminRelays'))}
  1383. />
  1384. <Route
  1385. path="organizations/"
  1386. component={make(() => import('sentry/views/admin/adminOrganizations'))}
  1387. />
  1388. <Route
  1389. path="projects/"
  1390. component={make(() => import('sentry/views/admin/adminProjects'))}
  1391. />
  1392. <Route
  1393. path="queue/"
  1394. component={make(() => import('sentry/views/admin/adminQueue'))}
  1395. />
  1396. <Route
  1397. path="quotas/"
  1398. component={make(() => import('sentry/views/admin/adminQuotas'))}
  1399. />
  1400. <Route
  1401. path="settings/"
  1402. component={make(() => import('sentry/views/admin/adminSettings'))}
  1403. />
  1404. <Route path="users/">
  1405. <IndexRoute component={make(() => import('sentry/views/admin/adminUsers'))} />
  1406. <Route
  1407. path=":id"
  1408. component={make(() => import('sentry/views/admin/adminUserEdit'))}
  1409. />
  1410. </Route>
  1411. <Route
  1412. path="status/mail/"
  1413. component={make(() => import('sentry/views/admin/adminMail'))}
  1414. />
  1415. <Route
  1416. path="status/environment/"
  1417. component={make(() => import('sentry/views/admin/adminEnvironment'))}
  1418. />
  1419. <Route
  1420. path="status/packages/"
  1421. component={make(() => import('sentry/views/admin/adminPackages'))}
  1422. />
  1423. <Route
  1424. path="status/warnings/"
  1425. component={make(() => import('sentry/views/admin/adminWarnings'))}
  1426. />
  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. const gettingStartedRoutes = (
  1484. <Route
  1485. path="/:orgId/:projectId/getting-started/"
  1486. component={make(() => import('sentry/views/projectInstall/gettingStarted'))}
  1487. >
  1488. <IndexRoute
  1489. component={make(() => import('sentry/views/projectInstall/overview'))}
  1490. />
  1491. <Route
  1492. path=":platform/"
  1493. component={make(
  1494. () => import('sentry/views/projectInstall/platformOrIntegration')
  1495. )}
  1496. />
  1497. </Route>
  1498. );
  1499. // Support for deprecated URLs (pre-Sentry 10). We just redirect users to new
  1500. // canonical URLs.
  1501. //
  1502. // XXX(epurkhiser): Can these be moved over to the legacyOrgRedirects routes,
  1503. // or do these need to be nested into the OrganizationDetails tree?
  1504. const legacyOrgRedirects = (
  1505. <Route path="/:orgId/:projectId/">
  1506. <IndexRoute
  1507. component={errorHandler(
  1508. redirectDeprecatedProjectRoute(
  1509. ({orgId, projectId}) => `/organizations/${orgId}/issues/?project=${projectId}`
  1510. )
  1511. )}
  1512. />
  1513. <Route
  1514. path="issues/"
  1515. component={errorHandler(
  1516. redirectDeprecatedProjectRoute(
  1517. ({orgId, projectId}) => `/organizations/${orgId}/issues/?project=${projectId}`
  1518. )
  1519. )}
  1520. />
  1521. <Route
  1522. path="dashboard/"
  1523. component={errorHandler(
  1524. redirectDeprecatedProjectRoute(
  1525. ({orgId, projectId}) =>
  1526. `/organizations/${orgId}/dashboards/?project=${projectId}`
  1527. )
  1528. )}
  1529. />
  1530. <Route
  1531. path="user-feedback/"
  1532. component={errorHandler(
  1533. redirectDeprecatedProjectRoute(
  1534. ({orgId, projectId}) =>
  1535. `/organizations/${orgId}/user-feedback/?project=${projectId}`
  1536. )
  1537. )}
  1538. />
  1539. <Route
  1540. path="releases/"
  1541. component={errorHandler(
  1542. redirectDeprecatedProjectRoute(
  1543. ({orgId, projectId}) =>
  1544. `/organizations/${orgId}/releases/?project=${projectId}`
  1545. )
  1546. )}
  1547. />
  1548. <Route
  1549. path="releases/:version/"
  1550. component={errorHandler(
  1551. redirectDeprecatedProjectRoute(
  1552. ({orgId, projectId, router}) =>
  1553. `/organizations/${orgId}/releases/${router.params.version}/?project=${projectId}`
  1554. )
  1555. )}
  1556. />
  1557. <Route
  1558. path="releases/:version/new-events/"
  1559. component={errorHandler(
  1560. redirectDeprecatedProjectRoute(
  1561. ({orgId, projectId, router}) =>
  1562. `/organizations/${orgId}/releases/${router.params.version}/new-events/?project=${projectId}`
  1563. )
  1564. )}
  1565. />
  1566. <Route
  1567. path="releases/:version/all-events/"
  1568. component={errorHandler(
  1569. redirectDeprecatedProjectRoute(
  1570. ({orgId, projectId, router}) =>
  1571. `/organizations/${orgId}/releases/${router.params.version}/all-events/?project=${projectId}`
  1572. )
  1573. )}
  1574. />
  1575. <Route
  1576. path="releases/:version/commits/"
  1577. component={errorHandler(
  1578. redirectDeprecatedProjectRoute(
  1579. ({orgId, projectId, router}) =>
  1580. `/organizations/${orgId}/releases/${router.params.version}/commits/?project=${projectId}`
  1581. )
  1582. )}
  1583. />
  1584. </Route>
  1585. );
  1586. const profilingRoutes = (
  1587. <Route
  1588. path="/organizations/:orgId/profiling/"
  1589. component={make(() => import('sentry/views/profiling'))}
  1590. >
  1591. <IndexRoute component={make(() => import('sentry/views/profiling/content'))} />
  1592. <Route
  1593. path="summary/:projectId/"
  1594. component={make(() => import('sentry/views/profiling/profileSummary'))}
  1595. />
  1596. <Route
  1597. path="profile/:projectId/:eventId"
  1598. component={make(() => import('sentry/views/profiling/profileGroupProvider'))}
  1599. >
  1600. <Route
  1601. path="details/"
  1602. component={make(() => import('sentry/views/profiling/profileDetails'))}
  1603. />
  1604. <Route
  1605. path="flamechart/"
  1606. component={make(() => import('sentry/views/profiling/profileFlamechart'))}
  1607. />
  1608. </Route>
  1609. </Route>
  1610. );
  1611. const organizationRoutes = (
  1612. <Route component={errorHandler(OrganizationDetails)}>
  1613. {settingsRoutes}
  1614. {projectsRoutes}
  1615. {dashboardRoutes}
  1616. {userFeedbackRoutes}
  1617. {issueListRoutes}
  1618. {issueDetailsRoutes}
  1619. {alertRoutes}
  1620. {monitorsRoutes}
  1621. {replayRoutes}
  1622. {releasesRoutes}
  1623. {activityRoutes}
  1624. {statsRoutes}
  1625. {discoverRoutes}
  1626. {performanceRoutes}
  1627. {profilingRoutes}
  1628. {adminManageRoutes}
  1629. {gettingStartedRoutes}
  1630. {legacyOrganizationRootRoutes}
  1631. {legacyOrgRedirects}
  1632. </Route>
  1633. );
  1634. const legacyRedirectRoutes = (
  1635. <Route path="/:orgId/">
  1636. <IndexRedirect to="/organizations/:orgId/" />
  1637. <Route path=":projectId/settings/">
  1638. <Redirect from="teams/" to="/settings/:orgId/projects/:projectId/teams/" />
  1639. <Redirect from="alerts/" to="/settings/:orgId/projects/:projectId/alerts/" />
  1640. <Redirect
  1641. from="alerts/rules/"
  1642. to="/settings/:orgId/projects/:projectId/alerts/rules/"
  1643. />
  1644. <Redirect
  1645. from="alerts/rules/new/"
  1646. to="/settings/:orgId/projects/:projectId/alerts/rules/new/"
  1647. />
  1648. <Redirect
  1649. from="alerts/rules/:ruleId/"
  1650. to="/settings/:orgId/projects/:projectId/alerts/rules/:ruleId/"
  1651. />
  1652. <Redirect
  1653. from="environments/"
  1654. to="/settings/:orgId/projects/:projectId/environments/"
  1655. />
  1656. <Redirect
  1657. from="environments/hidden/"
  1658. to="/settings/:orgId/projects/:projectId/environments/hidden/"
  1659. />
  1660. <Redirect from="tags/" to="/settings/projects/:orgId/projects/:projectId/tags/" />
  1661. <Redirect
  1662. from="issue-tracking/"
  1663. to="/settings/:orgId/projects/:projectId/issue-tracking/"
  1664. />
  1665. <Redirect
  1666. from="release-tracking/"
  1667. to="/settings/:orgId/projects/:projectId/release-tracking/"
  1668. />
  1669. <Redirect
  1670. from="ownership/"
  1671. to="/settings/:orgId/projects/:projectId/ownership/"
  1672. />
  1673. <Redirect
  1674. from="data-forwarding/"
  1675. to="/settings/:orgId/projects/:projectId/data-forwarding/"
  1676. />
  1677. <Redirect
  1678. from="debug-symbols/"
  1679. to="/settings/:orgId/projects/:projectId/debug-symbols/"
  1680. />
  1681. <Redirect
  1682. from="processing-issues/"
  1683. to="/settings/:orgId/projects/:projectId/processing-issues/"
  1684. />
  1685. <Redirect from="filters/" to="/settings/:orgId/projects/:projectId/filters/" />
  1686. <Redirect from="hooks/" to="/settings/:orgId/projects/:projectId/hooks/" />
  1687. <Redirect from="keys/" to="/settings/:orgId/projects/:projectId/keys/" />
  1688. <Redirect
  1689. from="keys/:keyId/"
  1690. to="/settings/:orgId/projects/:projectId/keys/:keyId/"
  1691. />
  1692. <Redirect
  1693. from="user-feedback/"
  1694. to="/settings/:orgId/projects/:projectId/user-feedback/"
  1695. />
  1696. <Redirect
  1697. from="security-headers/"
  1698. to="/settings/:orgId/projects/:projectId/security-headers/"
  1699. />
  1700. <Redirect
  1701. from="security-headers/csp/"
  1702. to="/settings/:orgId/projects/:projectId/security-headers/csp/"
  1703. />
  1704. <Redirect
  1705. from="security-headers/expect-ct/"
  1706. to="/settings/:orgId/projects/:projectId/security-headers/expect-ct/"
  1707. />
  1708. <Redirect
  1709. from="security-headers/hpkp/"
  1710. to="/settings/:orgId/projects/:projectId/security-headers/hpkp/"
  1711. />
  1712. <Redirect from="plugins/" to="/settings/:orgId/projects/:projectId/plugins/" />
  1713. <Redirect
  1714. from="plugins/:pluginId/"
  1715. to="/settings/:orgId/projects/:projectId/plugins/:pluginId/"
  1716. />
  1717. <Redirect
  1718. from="integrations/:providerKey/"
  1719. to="/settings/:orgId/projects/:projectId/integrations/:providerKey/"
  1720. />
  1721. <Redirect from="install/" to="/settings/:orgId/projects/:projectId/install/" />
  1722. <Redirect
  1723. from="install/:platform'"
  1724. to="/settings/:orgId/projects/:projectId/install/:platform/"
  1725. />
  1726. </Route>
  1727. <Redirect from=":projectId/group/:groupId/" to="issues/:groupId/" />
  1728. <Redirect
  1729. from=":projectId/issues/:groupId/"
  1730. to="/organizations/:orgId/issues/:groupId/"
  1731. />
  1732. <Redirect
  1733. from=":projectId/issues/:groupId/events/"
  1734. to="/organizations/:orgId/issues/:groupId/events/"
  1735. />
  1736. <Redirect
  1737. from=":projectId/issues/:groupId/events/:eventId/"
  1738. to="/organizations/:orgId/issues/:groupId/events/:eventId/"
  1739. />
  1740. <Redirect
  1741. from=":projectId/issues/:groupId/tags/"
  1742. to="/organizations/:orgId/issues/:groupId/tags/"
  1743. />
  1744. <Redirect
  1745. from=":projectId/issues/:groupId/tags/:tagKey/"
  1746. to="/organizations/:orgId/issues/:groupId/tags/:tagKey/"
  1747. />
  1748. <Redirect
  1749. from=":projectId/issues/:groupId/feedback/"
  1750. to="/organizations/:orgId/issues/:groupId/feedback/"
  1751. />
  1752. <Redirect
  1753. from=":projectId/issues/:groupId/similar/"
  1754. to="/organizations/:orgId/issues/:groupId/similar/"
  1755. />
  1756. <Redirect
  1757. from=":projectId/issues/:groupId/merged/"
  1758. to="/organizations/:orgId/issues/:groupId/merged/"
  1759. />
  1760. <Route
  1761. path=":projectId/events/:eventId/"
  1762. component={errorHandler(ProjectEventRedirect)}
  1763. />
  1764. </Route>
  1765. );
  1766. const appRoutes = (
  1767. <Route>
  1768. {experimentalSpaRoutes}
  1769. <Route path="/" component={errorHandler(App)}>
  1770. {rootRoutes}
  1771. {organizationRoutes}
  1772. {legacyRedirectRoutes}
  1773. <Route path="*" component={errorHandler(RouteNotFound)} />
  1774. </Route>
  1775. </Route>
  1776. );
  1777. return appRoutes;
  1778. }
  1779. // We load routes both when initlaizing the SDK (for routing integrations) and
  1780. // when the app renders Main. Memoize to avoid rebuilding the route tree.
  1781. export const routes = memoize(buildRoutes);