routes.tsx 77 KB

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