navigationConfiguration.tsx 5.4 KB

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