navigationConfiguration.tsx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import {t} from 'sentry/locale';
  2. import ConfigStore from 'sentry/stores/configStore';
  3. import type {Organization} from 'sentry/types/organization';
  4. import type {Project} from 'sentry/types/project';
  5. import {hasCustomMetrics} from 'sentry/utils/metrics/features';
  6. import type {NavigationSection} from 'sentry/views/settings/types';
  7. type ConfigParams = {
  8. debugFilesNeedsReview?: boolean;
  9. organization?: Organization;
  10. project?: Project;
  11. };
  12. const pathPrefix = '/settings/:orgId/projects/:projectId';
  13. export default function getConfiguration({
  14. project,
  15. organization,
  16. debugFilesNeedsReview,
  17. }: ConfigParams): NavigationSection[] {
  18. const plugins = (project?.plugins || []).filter(plugin => plugin.enabled);
  19. const isSelfHostedErrorsOnly = ConfigStore.get('isSelfHostedErrorsOnly');
  20. return [
  21. {
  22. name: t('Project'),
  23. items: [
  24. {
  25. path: `${pathPrefix}/`,
  26. index: true,
  27. title: t('General Settings'),
  28. description: t('Configure general settings for a project'),
  29. },
  30. {
  31. path: `${pathPrefix}/teams/`,
  32. title: t('Project Teams'),
  33. description: t('Manage team access for a project'),
  34. },
  35. {
  36. path: `${pathPrefix}/alerts/`,
  37. title: t('Alert Settings'),
  38. description: t('Project alert settings'),
  39. },
  40. {
  41. path: `${pathPrefix}/tags/`,
  42. title: t('Tags & Context'),
  43. description: t("View and manage a project's tags and context"),
  44. },
  45. {
  46. path: `${pathPrefix}/environments/`,
  47. title: t('Environments'),
  48. description: t('Manage environments in a project'),
  49. },
  50. {
  51. path: `${pathPrefix}/ownership/`,
  52. title: t('Ownership Rules'),
  53. description: t('Manage ownership rules for a project'),
  54. },
  55. {
  56. path: `${pathPrefix}/data-forwarding/`,
  57. title: t('Data Forwarding'),
  58. },
  59. {
  60. path: `${pathPrefix}/user-feedback/`,
  61. title: t('User Feedback'),
  62. show: () => !isSelfHostedErrorsOnly,
  63. },
  64. ],
  65. },
  66. {
  67. name: t('Processing'),
  68. items: [
  69. {
  70. path: `${pathPrefix}/filters/`,
  71. title: t('Inbound Filters'),
  72. description: t(
  73. "Configure a project's inbound filters (e.g. browsers, messages)"
  74. ),
  75. },
  76. {
  77. path: `${pathPrefix}/security-and-privacy/`,
  78. title: t('Security & Privacy'),
  79. description: t(
  80. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  81. ),
  82. },
  83. {
  84. path: `${pathPrefix}/issue-grouping/`,
  85. title: t('Issue Grouping'),
  86. },
  87. {
  88. path: `${pathPrefix}/debug-symbols/`,
  89. title: t('Debug Files'),
  90. badge: debugFilesNeedsReview ? () => 'warning' : undefined,
  91. },
  92. {
  93. path: `${pathPrefix}/proguard/`,
  94. title: t('ProGuard'),
  95. },
  96. {
  97. path: `${pathPrefix}/source-maps/`,
  98. title: t('Source Maps'),
  99. },
  100. {
  101. path: `${pathPrefix}/performance/`,
  102. title: t('Performance'),
  103. show: () =>
  104. !!organization?.features?.includes('performance-view') &&
  105. !isSelfHostedErrorsOnly,
  106. },
  107. {
  108. path: `${pathPrefix}/metrics/`,
  109. title: t('Metrics'),
  110. show: () =>
  111. !!(organization && hasCustomMetrics(organization)) && !isSelfHostedErrorsOnly,
  112. },
  113. {
  114. path: `${pathPrefix}/replays/`,
  115. title: t('Replays'),
  116. show: () =>
  117. !!organization?.features?.includes('session-replay-ui') &&
  118. !isSelfHostedErrorsOnly,
  119. },
  120. ],
  121. },
  122. {
  123. name: t('SDK Setup'),
  124. items: [
  125. {
  126. path: `${pathPrefix}/keys/`,
  127. title: t('Client Keys (DSN)'),
  128. description: t("View and manage the project's client keys (DSN)"),
  129. },
  130. {
  131. path: `${pathPrefix}/loader-script/`,
  132. title: t('Loader Script'),
  133. description: t("View and manage the project's Loader Script"),
  134. },
  135. {
  136. path: `${pathPrefix}/release-tracking/`,
  137. title: t('Releases'),
  138. },
  139. {
  140. path: `${pathPrefix}/security-headers/`,
  141. title: t('Security Headers'),
  142. },
  143. ],
  144. },
  145. {
  146. name: t('Legacy Integrations'),
  147. items: [
  148. {
  149. path: `${pathPrefix}/plugins/`,
  150. title: t('Legacy Integrations'),
  151. description: t('View, enable, and disable all integrations for a project'),
  152. id: 'legacy_integrations',
  153. recordAnalytics: true,
  154. },
  155. ...plugins.map(plugin => ({
  156. path: `${pathPrefix}/plugins/${plugin.id}/`,
  157. title: plugin.name,
  158. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  159. id: 'plugin_details',
  160. recordAnalytics: true,
  161. })),
  162. ],
  163. },
  164. ];
  165. }