navigationConfiguration.tsx 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. import {t} from 'sentry/locale';
  2. import type {Organization} from 'sentry/types/organization';
  3. import type {Project} from 'sentry/types/project';
  4. import type {NavigationSection} from 'sentry/views/settings/types';
  5. type ConfigParams = {
  6. debugFilesNeedsReview?: boolean;
  7. organization?: Organization;
  8. project?: Project;
  9. };
  10. const pathPrefix = '/settings/:orgId/projects/:projectId';
  11. export default function getConfiguration({
  12. project,
  13. organization,
  14. debugFilesNeedsReview,
  15. }: ConfigParams): NavigationSection[] {
  16. const plugins = (project?.plugins || []).filter(plugin => plugin.enabled);
  17. return [
  18. {
  19. name: t('Project'),
  20. items: [
  21. {
  22. path: `${pathPrefix}/`,
  23. index: true,
  24. title: t('General Settings'),
  25. description: t('Configure general settings for a project'),
  26. },
  27. {
  28. path: `${pathPrefix}/teams/`,
  29. title: t('Project Teams'),
  30. description: t('Manage team access for a project'),
  31. },
  32. {
  33. path: `${pathPrefix}/alerts/`,
  34. title: t('Alert Settings'),
  35. description: t('Project alert settings'),
  36. },
  37. {
  38. path: `${pathPrefix}/tags/`,
  39. title: t('Tags & Context'),
  40. description: t("View and manage a project's tags and context"),
  41. },
  42. {
  43. path: `${pathPrefix}/environments/`,
  44. title: t('Environments'),
  45. description: t('Manage environments in a project'),
  46. },
  47. {
  48. path: `${pathPrefix}/ownership/`,
  49. title: t('Ownership Rules'),
  50. description: t('Manage ownership rules for a project'),
  51. },
  52. {
  53. path: `${pathPrefix}/data-forwarding/`,
  54. title: t('Data Forwarding'),
  55. },
  56. ],
  57. },
  58. {
  59. name: t('Processing'),
  60. items: [
  61. {
  62. path: `${pathPrefix}/filters/`,
  63. title: t('Inbound Filters'),
  64. description: t(
  65. "Configure a project's inbound filters (e.g. browsers, messages)"
  66. ),
  67. },
  68. {
  69. path: `${pathPrefix}/security-and-privacy/`,
  70. title: t('Security & Privacy'),
  71. description: t(
  72. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  73. ),
  74. },
  75. {
  76. path: `${pathPrefix}/issue-grouping/`,
  77. title: t('Issue Grouping'),
  78. },
  79. {
  80. path: `${pathPrefix}/processing-issues/`,
  81. title: t('Processing Issues'),
  82. show: () => {
  83. // NOTE: both `project` and `options` are non-null here.
  84. return 'sentry:reprocessing_active' in (project?.options ?? {});
  85. },
  86. // eslint-disable-next-line @typescript-eslint/no-shadow
  87. badge: ({project}) => {
  88. const issues = project?.processingIssues ?? 0;
  89. return issues <= 0 ? null : issues > 99 ? '99+' : issues;
  90. },
  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: () => !!organization?.features?.includes('performance-view'),
  109. },
  110. {
  111. path: `${pathPrefix}/metrics/`,
  112. title: t('Metrics'),
  113. show: () => !!organization?.features?.includes('custom-metrics'),
  114. },
  115. {
  116. path: `${pathPrefix}/replays/`,
  117. title: t('Replays'),
  118. show: () => !!organization?.features?.includes('session-replay-ui'),
  119. },
  120. {
  121. path: `${pathPrefix}/user-feedback-processing/`,
  122. title: t('User Feedback'),
  123. show: () => !!organization?.features?.includes('user-feedback-ui'),
  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. path: `${pathPrefix}/user-feedback/`,
  150. title: t('User Feedback'),
  151. description: t('Configure user feedback reporting feature'),
  152. },
  153. ],
  154. },
  155. {
  156. name: t('Legacy Integrations'),
  157. items: [
  158. {
  159. path: `${pathPrefix}/plugins/`,
  160. title: t('Legacy Integrations'),
  161. description: t('View, enable, and disable all integrations for a project'),
  162. id: 'legacy_integrations',
  163. recordAnalytics: true,
  164. },
  165. ...plugins.map(plugin => ({
  166. path: `${pathPrefix}/plugins/${plugin.id}/`,
  167. title: plugin.name,
  168. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  169. id: 'plugin_details',
  170. recordAnalytics: true,
  171. })),
  172. ],
  173. },
  174. ];
  175. }