navigationConfiguration.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import {t} from 'sentry/locale';
  2. import HookStore from 'sentry/stores/hookStore';
  3. import type {Organization} from 'sentry/types/organization';
  4. import {getUserOrgNavigationConfiguration} from 'sentry/views/settings/organization/userOrgNavigationConfiguration';
  5. import type {NavigationSection} from 'sentry/views/settings/types';
  6. const pathPrefix = '/settings/account';
  7. type ConfigParams = {
  8. organization?: Organization;
  9. };
  10. function getConfiguration({organization}: ConfigParams): NavigationSection[] {
  11. const hasNavigationV2 = organization?.features.includes('navigation-sidebar-v2');
  12. if (organization && hasNavigationV2) {
  13. return getUserOrgNavigationConfiguration({organization});
  14. }
  15. return [
  16. {
  17. name: t('Account'),
  18. items: [
  19. {
  20. path: `${pathPrefix}/details/`,
  21. title: t('Account Details'),
  22. description: t(
  23. 'Change your account details and preferences (e.g. timezone/clock, avatar, language)'
  24. ),
  25. },
  26. {
  27. path: `${pathPrefix}/security/`,
  28. title: t('Security'),
  29. description: t('Change your account password and/or two factor authentication'),
  30. },
  31. {
  32. path: `${pathPrefix}/notifications/`,
  33. title: t('Notifications'),
  34. description: t('Configure what email notifications to receive'),
  35. },
  36. {
  37. path: `${pathPrefix}/emails/`,
  38. title: t('Email Addresses'),
  39. description: t(
  40. 'Add or remove secondary emails, change your primary email, verify your emails'
  41. ),
  42. },
  43. {
  44. path: `${pathPrefix}/subscriptions/`,
  45. title: t('Subscriptions'),
  46. description: t(
  47. 'Change Sentry marketing subscriptions you are subscribed to (GDPR)'
  48. ),
  49. },
  50. {
  51. path: `${pathPrefix}/authorizations/`,
  52. title: t('Authorized Applications'),
  53. description: t(
  54. 'Manage third-party applications that have access to your Sentry account'
  55. ),
  56. },
  57. {
  58. path: `${pathPrefix}/identities/`,
  59. title: t('Identities'),
  60. description: t(
  61. 'Manage your third-party identities that are associated to Sentry'
  62. ),
  63. },
  64. {
  65. path: `${pathPrefix}/close-account/`,
  66. title: t('Close Account'),
  67. description: t('Permanently close your Sentry account'),
  68. },
  69. ],
  70. },
  71. {
  72. name: t('API'),
  73. items: [
  74. {
  75. path: `${pathPrefix}/api/applications/`,
  76. title: t('Applications'),
  77. description: t('Add and configure OAuth2 applications'),
  78. },
  79. {
  80. path: `${pathPrefix}/api/auth-tokens/`,
  81. title: t('User Auth Tokens'),
  82. description: t(
  83. "Authentication tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API."
  84. ),
  85. },
  86. ...HookStore.get('settings:api-navigation-config').flatMap(cb =>
  87. cb(organization)
  88. ),
  89. ],
  90. },
  91. ];
  92. }
  93. export default getConfiguration;