navigationConfiguration.tsx 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 {hasTempestAccess} from 'sentry/utils/tempest/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. const isSelfHosted = ConfigStore.get('isSelfHosted');
  22. return [
  23. {
  24. name: t('Project'),
  25. items: [
  26. {
  27. path: `${pathPrefix}/`,
  28. index: true,
  29. title: t('General Settings'),
  30. description: t('Configure general settings for a project'),
  31. },
  32. {
  33. path: `${pathPrefix}/teams/`,
  34. title: t('Project Teams'),
  35. description: t('Manage team access for a project'),
  36. },
  37. {
  38. path: `${pathPrefix}/alerts/`,
  39. title: t('Alert Settings'),
  40. description: t('Project alert settings'),
  41. },
  42. {
  43. path: `${pathPrefix}/tags/`,
  44. title: t('Tags & Context'),
  45. description: t("View and manage a project's tags and context"),
  46. },
  47. {
  48. path: `${pathPrefix}/environments/`,
  49. title: t('Environments'),
  50. description: t('Manage environments in a project'),
  51. },
  52. {
  53. path: `${pathPrefix}/ownership/`,
  54. title: t('Ownership Rules'),
  55. description: t('Manage ownership rules for a project'),
  56. },
  57. {
  58. path: `${pathPrefix}/data-forwarding/`,
  59. title: t('Data Forwarding'),
  60. },
  61. {
  62. path: `${pathPrefix}/user-feedback/`,
  63. title: t('User Feedback'),
  64. show: () => !isSelfHostedErrorsOnly,
  65. },
  66. {
  67. path: `${pathPrefix}/toolbar/`,
  68. title: t('Developer Toolbar'),
  69. show: () => !!organization?.features?.includes('dev-toolbar-ui'),
  70. },
  71. ],
  72. },
  73. {
  74. name: t('Processing'),
  75. items: [
  76. {
  77. path: `${pathPrefix}/filters/`,
  78. title: t('Inbound Filters'),
  79. description: t(
  80. "Configure a project's inbound filters (e.g. browsers, messages)"
  81. ),
  82. },
  83. {
  84. path: `${pathPrefix}/security-and-privacy/`,
  85. title: t('Security & Privacy'),
  86. description: t(
  87. 'Configuration related to dealing with sensitive data and other security settings. (Data Scrubbing, Data Privacy, Data Scrubbing) for a project'
  88. ),
  89. },
  90. {
  91. path: `${pathPrefix}/issue-grouping/`,
  92. title: t('Issue Grouping'),
  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: () =>
  111. !!organization?.features?.includes('performance-view') &&
  112. !isSelfHostedErrorsOnly,
  113. },
  114. {
  115. path: `${pathPrefix}/metrics/`,
  116. title: t('Metrics'),
  117. show: () =>
  118. !!(organization && hasCustomMetrics(organization)) && !isSelfHostedErrorsOnly,
  119. },
  120. {
  121. path: `${pathPrefix}/replays/`,
  122. title: t('Replays'),
  123. show: () =>
  124. !!organization?.features?.includes('session-replay-ui') &&
  125. !isSelfHostedErrorsOnly,
  126. },
  127. {
  128. path: `${pathPrefix}/playstation/`,
  129. title: t('PlayStation'),
  130. show: () => !!(organization && hasTempestAccess(organization)) && !isSelfHosted,
  131. },
  132. ],
  133. },
  134. {
  135. name: t('SDK Setup'),
  136. items: [
  137. {
  138. path: `${pathPrefix}/keys/`,
  139. title: t('Client Keys (DSN)'),
  140. description: t("View and manage the project's client keys (DSN)"),
  141. },
  142. {
  143. path: `${pathPrefix}/loader-script/`,
  144. title: t('Loader Script'),
  145. description: t("View and manage the project's Loader Script"),
  146. },
  147. {
  148. path: `${pathPrefix}/release-tracking/`,
  149. title: t('Releases'),
  150. },
  151. {
  152. path: `${pathPrefix}/security-headers/`,
  153. title: t('Security Headers'),
  154. },
  155. ],
  156. },
  157. {
  158. name: t('Legacy Integrations'),
  159. items: [
  160. {
  161. path: `${pathPrefix}/plugins/`,
  162. title: t('Legacy Integrations'),
  163. description: t('View, enable, and disable all integrations for a project'),
  164. id: 'legacy_integrations',
  165. recordAnalytics: true,
  166. },
  167. ...plugins.map(plugin => ({
  168. path: `${pathPrefix}/plugins/${plugin.id}/`,
  169. title: plugin.name,
  170. show: opts => opts?.access?.has('project:write') && !plugin.isDeprecated,
  171. id: 'plugin_details',
  172. recordAnalytics: true,
  173. })),
  174. ],
  175. },
  176. ];
  177. }