settingsRoutes.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import {Fragment} from 'react';
  2. import {IndexRedirect, IndexRoute, Redirect, Route} from 'sentry/components/route';
  3. import {makeLazyloadComponent} from 'sentry/routes';
  4. import errorHandler from 'sentry/utils/errorHandler';
  5. import SubscriptionContext from 'getsentry/components/subscriptionContext';
  6. // Shorthand to avoid extra line wrapping
  7. const make = makeLazyloadComponent;
  8. const settingsRoutes = () =>
  9. (
  10. <Fragment key="gs-routes-settings">
  11. <Redirect from="billing/history/" to="/settings/:orgId/billing/usage/" />
  12. <Redirect from="subscription/cancel/" to="/settings/:orgId/billing/cancel/" />
  13. <Route name="Subscription" path="billing/">
  14. <IndexRedirect to="overview/" />
  15. <Route
  16. path="checkout/"
  17. name="Change"
  18. component={errorHandler(SubscriptionContext)}
  19. >
  20. <IndexRoute component={make(() => import('../views/decideCheckout'))} />
  21. </Route>
  22. <Route path="cancel/" name="Cancel" component={errorHandler(SubscriptionContext)}>
  23. <IndexRoute component={make(() => import('../views/cancelSubscription'))} />
  24. </Route>
  25. <Route
  26. path="overview/"
  27. name="Overview"
  28. component={make(() => import('../views/subscriptionPage/overview'))}
  29. />
  30. <Route
  31. path="usage/"
  32. name="Usage History"
  33. component={make(() => import('../views/subscriptionPage/usageHistory'))}
  34. />
  35. <Route
  36. path="receipts/"
  37. name="Receipts"
  38. component={make(() => import('../views/subscriptionPage/paymentHistory'))}
  39. />
  40. <Route
  41. path="notifications/"
  42. name="Notifications"
  43. component={make(() => import('../views/subscriptionPage/notifications'))}
  44. />
  45. <Route
  46. path="details/"
  47. name="Billing Details"
  48. component={make(() => import('../views/subscriptionPage/billingDetails'))}
  49. />
  50. <Route
  51. path="usage-log/"
  52. name="Usage Log"
  53. component={make(() => import('../views/subscriptionPage/usageLog'))}
  54. />
  55. <Route
  56. path="receipts/:invoiceGuid/"
  57. name="Invoice Details"
  58. component={errorHandler(SubscriptionContext)}
  59. >
  60. <IndexRoute component={make(() => import('../views/invoiceDetails'))} />
  61. </Route>
  62. </Route>
  63. <Route
  64. path="spike-protection/"
  65. name="Spike Protection"
  66. component={make(() => import('../views/spikeProtection'))}
  67. />
  68. <Route
  69. path="subscription/spend-allocations/"
  70. name="Spend Allocations"
  71. component={make(() => import('../views/spendAllocations'))}
  72. />
  73. <Route
  74. path="subscription/redeem-code/"
  75. name="Redeem Promotional Code"
  76. component={make(() => import('../views/redeemPromoCode'))}
  77. />
  78. <Route
  79. path="legal/"
  80. name="Legal & Compliance"
  81. component={make(() => import('../views/legalAndCompliance/legalAndCompliance'))}
  82. />
  83. <Route
  84. name="Support"
  85. path="support/"
  86. component={() => {
  87. window.location.replace('https://sentry.zendesk.com/hc/en-us');
  88. return null;
  89. }}
  90. />
  91. </Fragment>
  92. ) as any; // TODO(ts): This does not play nicely with sentry's RoutesHook type
  93. export default settingsRoutes;