navigationConfiguration.tsx 5.4 KB

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