routes.tsx 81 KB

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