navigationConfiguration.tsx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. import {t} from 'sentry/locale';
  2. import {Organization, Project} from 'sentry/types';
  3. import {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 && 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('Issue Owners'),
  49. description: t('Manage issue 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}/server-side-sampling/`,
  69. title: t('Server-side Sampling'),
  70. show: () => !!organization?.features?.includes('server-side-sampling'),
  71. description: t(
  72. "Per-Project basis solution to configure sampling rules within Sentry's UI"
  73. ),
  74. },
  75. {
  76. path: `${pathPrefix}/security-and-privacy/`,
  77. title: t('Security & Privacy'),
  78. description: t(
  79. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  80. ),
  81. },
  82. {
  83. path: `${pathPrefix}/issue-grouping/`,
  84. title: t('Issue Grouping'),
  85. },
  86. {
  87. path: `${pathPrefix}/processing-issues/`,
  88. title: t('Processing Issues'),
  89. // eslint-disable-next-line @typescript-eslint/no-shadow
  90. badge: ({project}) => {
  91. if (!project) {
  92. return null;
  93. }
  94. if (project.processingIssues <= 0) {
  95. return null;
  96. }
  97. return project.processingIssues > 99 ? '99+' : project.processingIssues;
  98. },
  99. },
  100. {
  101. path: `${pathPrefix}/debug-symbols/`,
  102. title: t('Debug Files'),
  103. badge: debugFilesNeedsReview ? () => 'warning' : undefined,
  104. },
  105. {
  106. path: `${pathPrefix}/proguard/`,
  107. title: t('ProGuard'),
  108. },
  109. {
  110. path: `${pathPrefix}/source-maps/`,
  111. title: t('Source Maps'),
  112. },
  113. {
  114. path: `${pathPrefix}/performance/`,
  115. title: t('Performance'),
  116. show: () => !!organization?.features?.includes('performance-view'),
  117. },
  118. ],
  119. },
  120. {
  121. name: t('SDK Setup'),
  122. items: [
  123. {
  124. path: `${pathPrefix}/install/`,
  125. title: t('Instrumentation'),
  126. },
  127. {
  128. path: `${pathPrefix}/keys/`,
  129. title: t('Client Keys (DSN)'),
  130. description: t("View and manage the project's client keys (DSN)"),
  131. },
  132. {
  133. path: `${pathPrefix}/release-tracking/`,
  134. title: t('Releases'),
  135. },
  136. {
  137. path: `${pathPrefix}/security-headers/`,
  138. title: t('Security Headers'),
  139. },
  140. {
  141. path: `${pathPrefix}/user-feedback/`,
  142. title: t('User Feedback'),
  143. description: t('Configure user feedback reporting feature'),
  144. },
  145. ],
  146. },
  147. {
  148. name: t('Legacy Integrations'),
  149. items: [
  150. {
  151. path: `${pathPrefix}/plugins/`,
  152. title: t('Legacy Integrations'),
  153. description: t('View, enable, and disable all integrations for a project'),
  154. id: 'legacy_integrations',
  155. recordAnalytics: true,
  156. },
  157. ...plugins.map(plugin => ({
  158. path: `${pathPrefix}/plugins/${plugin.id}/`,
  159. title: plugin.name,
  160. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  161. id: 'plugin_details',
  162. recordAnalytics: true,
  163. })),
  164. ],
  165. },
  166. ];
  167. }