routes.tsx 80 KB

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