routes.tsx 68 KB

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