routes.tsx 81 KB

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