routes.tsx 71 KB

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