routes.tsx 59 KB

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