routes.tsx 82 KB

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