routes.tsx 63 KB

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