routes.tsx 67 KB

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