navigationConfiguration.tsx 5.2 KB

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