routes.tsx 64 KB

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