navigationConfiguration.tsx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. import {t} from 'sentry/locale';
  2. import ConfigStore from 'sentry/stores/configStore';
  3. import type {Organization} from 'sentry/types/organization';
  4. import type {Project} from 'sentry/types/project';
  5. import {hasCustomMetrics} from 'sentry/utils/metrics/features';
  6. import type {NavigationSection} from 'sentry/views/settings/types';
  7. type ConfigParams = {
  8. debugFilesNeedsReview?: boolean;
  9. organization?: Organization;
  10. project?: Project;
  11. };
  12. const pathPrefix = '/settings/:orgId/projects/:projectId';
  13. export default function getConfiguration({
  14. project,
  15. organization,
  16. debugFilesNeedsReview,
  17. }: ConfigParams): NavigationSection[] {
  18. const plugins = (project?.plugins || []).filter(plugin => plugin.enabled);
  19. const isSelfHostedErrorsOnly = ConfigStore.get('isSelfHostedErrorsOnly');
  20. return [
  21. {
  22. name: t('Project'),
  23. items: [
  24. {
  25. path: `${pathPrefix}/`,
  26. index: true,
  27. title: t('General Settings'),
  28. description: t('Configure general settings for a project'),
  29. },
  30. {
  31. path: `${pathPrefix}/teams/`,
  32. title: t('Project Teams'),
  33. description: t('Manage team access for a project'),
  34. },
  35. {
  36. path: `${pathPrefix}/alerts/`,
  37. title: t('Alert Settings'),
  38. description: t('Project alert settings'),
  39. },
  40. {
  41. path: `${pathPrefix}/tags/`,
  42. title: t('Tags & Context'),
  43. description: t("View and manage a project's tags and context"),
  44. },
  45. {
  46. path: `${pathPrefix}/environments/`,
  47. title: t('Environments'),
  48. description: t('Manage environments in a project'),
  49. },
  50. {
  51. path: `${pathPrefix}/ownership/`,
  52. title: t('Ownership Rules'),
  53. description: t('Manage ownership rules for a project'),
  54. },
  55. {
  56. path: `${pathPrefix}/data-forwarding/`,
  57. title: t('Data Forwarding'),
  58. },
  59. {
  60. path: `${pathPrefix}/user-feedback/`,
  61. title: t('User Feedback'),
  62. show: () => !isSelfHostedErrorsOnly,
  63. },
  64. {
  65. path: `${pathPrefix}/toolbar/`,
  66. title: t('Developer Toolbar'),
  67. show: () => !!organization?.features?.includes('dev-toolbar-ui'),
  68. },
  69. ],
  70. },
  71. {
  72. name: t('Processing'),
  73. items: [
  74. {
  75. path: `${pathPrefix}/filters/`,
  76. title: t('Inbound Filters'),
  77. description: t(
  78. "Configure a project's inbound filters (e.g. browsers, messages)"
  79. ),
  80. },
  81. {
  82. path: `${pathPrefix}/security-and-privacy/`,
  83. title: t('Security & Privacy'),
  84. description: t(
  85. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  86. ),
  87. },
  88. {
  89. path: `${pathPrefix}/issue-grouping/`,
  90. title: t('Issue Grouping'),
  91. },
  92. {
  93. path: `${pathPrefix}/debug-symbols/`,
  94. title: t('Debug Files'),
  95. badge: debugFilesNeedsReview ? () => 'warning' : undefined,
  96. },
  97. {
  98. path: `${pathPrefix}/proguard/`,
  99. title: t('ProGuard'),
  100. },
  101. {
  102. path: `${pathPrefix}/source-maps/`,
  103. title: t('Source Maps'),
  104. },
  105. {
  106. path: `${pathPrefix}/performance/`,
  107. title: t('Performance'),
  108. show: () =>
  109. !!organization?.features?.includes('performance-view') &&
  110. !isSelfHostedErrorsOnly,
  111. },
  112. {
  113. path: `${pathPrefix}/metrics/`,
  114. title: t('Metrics'),
  115. show: () =>
  116. !!(organization && hasCustomMetrics(organization)) && !isSelfHostedErrorsOnly,
  117. },
  118. {
  119. path: `${pathPrefix}/replays/`,
  120. title: t('Replays'),
  121. show: () =>
  122. !!organization?.features?.includes('session-replay-ui') &&
  123. !isSelfHostedErrorsOnly,
  124. },
  125. ],
  126. },
  127. {
  128. name: t('SDK Setup'),
  129. items: [
  130. {
  131. path: `${pathPrefix}/keys/`,
  132. title: t('Client Keys (DSN)'),
  133. description: t("View and manage the project's client keys (DSN)"),
  134. },
  135. {
  136. path: `${pathPrefix}/loader-script/`,
  137. title: t('Loader Script'),
  138. description: t("View and manage the project's Loader Script"),
  139. },
  140. {
  141. path: `${pathPrefix}/release-tracking/`,
  142. title: t('Releases'),
  143. },
  144. {
  145. path: `${pathPrefix}/security-headers/`,
  146. title: t('Security Headers'),
  147. },
  148. ],
  149. },
  150. {
  151. name: t('Legacy Integrations'),
  152. items: [
  153. {
  154. path: `${pathPrefix}/plugins/`,
  155. title: t('Legacy Integrations'),
  156. description: t('View, enable, and disable all integrations for a project'),
  157. id: 'legacy_integrations',
  158. recordAnalytics: true,
  159. },
  160. ...plugins.map(plugin => ({
  161. path: `${pathPrefix}/plugins/${plugin.id}/`,
  162. title: plugin.name,
  163. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  164. id: 'plugin_details',
  165. recordAnalytics: true,
  166. })),
  167. ],
  168. },
  169. ];
  170. }