routes.tsx 82 KB

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