navigationConfiguration.tsx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 && 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: organization?.features?.includes('streamline-targeting-context')
  49. ? t('Ownership Rules')
  50. : t('Issue Owners'),
  51. description: t('Manage ownership rules for a project'),
  52. },
  53. {
  54. path: `${pathPrefix}/data-forwarding/`,
  55. title: t('Data Forwarding'),
  56. },
  57. ],
  58. },
  59. {
  60. name: t('Processing'),
  61. items: [
  62. {
  63. path: `${pathPrefix}/filters/`,
  64. title: t('Inbound Filters'),
  65. description: t(
  66. "Configure a project's inbound filters (e.g. browsers, messages)"
  67. ),
  68. },
  69. {
  70. path: `${pathPrefix}/security-and-privacy/`,
  71. title: t('Security & Privacy'),
  72. description: t(
  73. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  74. ),
  75. },
  76. {
  77. path: `${pathPrefix}/issue-grouping/`,
  78. title: t('Issue Grouping'),
  79. },
  80. {
  81. path: `${pathPrefix}/processing-issues/`,
  82. title: t('Processing Issues'),
  83. // eslint-disable-next-line @typescript-eslint/no-shadow
  84. badge: ({project}) => {
  85. if (!project) {
  86. return null;
  87. }
  88. if (project.processingIssues <= 0) {
  89. return null;
  90. }
  91. return project.processingIssues > 99 ? '99+' : project.processingIssues;
  92. },
  93. },
  94. {
  95. path: `${pathPrefix}/debug-symbols/`,
  96. title: t('Debug Files'),
  97. badge: debugFilesNeedsReview ? () => 'warning' : undefined,
  98. },
  99. {
  100. path: `${pathPrefix}/proguard/`,
  101. title: t('ProGuard'),
  102. },
  103. {
  104. path: `${pathPrefix}/source-maps/`,
  105. title: t('Source Maps'),
  106. },
  107. {
  108. path: `${pathPrefix}/performance/`,
  109. title: t('Performance'),
  110. show: () => !!organization?.features?.includes('performance-view'),
  111. },
  112. {
  113. path: `${pathPrefix}/metrics/`,
  114. title: t('Metrics'),
  115. show: () =>
  116. !!(
  117. organization?.features?.includes('custom-metrics') &&
  118. organization?.features?.includes('ddm-ui')
  119. ),
  120. },
  121. {
  122. path: `${pathPrefix}/replays/`,
  123. title: t('Replays'),
  124. show: () => !!organization?.features?.includes('session-replay-ui'),
  125. },
  126. ],
  127. },
  128. {
  129. name: t('SDK Setup'),
  130. items: [
  131. {
  132. path: `${pathPrefix}/keys/`,
  133. title: t('Client Keys (DSN)'),
  134. description: t("View and manage the project's client keys (DSN)"),
  135. },
  136. {
  137. path: `${pathPrefix}/loader-script/`,
  138. title: t('Loader Script'),
  139. description: t("View and manage the project's Loader Script"),
  140. },
  141. {
  142. path: `${pathPrefix}/release-tracking/`,
  143. title: t('Releases'),
  144. },
  145. {
  146. path: `${pathPrefix}/security-headers/`,
  147. title: t('Security Headers'),
  148. },
  149. {
  150. path: `${pathPrefix}/user-feedback/`,
  151. title: t('User Feedback'),
  152. description: t('Configure user feedback reporting feature'),
  153. },
  154. ],
  155. },
  156. {
  157. name: t('Legacy Integrations'),
  158. items: [
  159. {
  160. path: `${pathPrefix}/plugins/`,
  161. title: t('Legacy Integrations'),
  162. description: t('View, enable, and disable all integrations for a project'),
  163. id: 'legacy_integrations',
  164. recordAnalytics: true,
  165. },
  166. ...plugins.map(plugin => ({
  167. path: `${pathPrefix}/plugins/${plugin.id}/`,
  168. title: plugin.name,
  169. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  170. id: 'plugin_details',
  171. recordAnalytics: true,
  172. })),
  173. ],
  174. },
  175. ];
  176. }