routes.tsx 71 KB

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