navigationConfiguration.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. import {t} from 'app/locale';
  2. import {Organization, Project} from 'app/types';
  3. import {NavigationSection} from 'app/views/settings/types';
  4. type ConfigParams = {
  5. organization?: Organization;
  6. project?: Project;
  7. };
  8. const pathPrefix = '/settings/:orgId/projects/:projectId';
  9. export default function getConfiguration({
  10. project,
  11. organization,
  12. }: ConfigParams): NavigationSection[] {
  13. const plugins = ((project && project.plugins) || []).filter(plugin => plugin.enabled);
  14. return [
  15. {
  16. name: t('Project'),
  17. items: [
  18. {
  19. path: `${pathPrefix}/`,
  20. index: true,
  21. title: t('General Settings'),
  22. description: t('Configure general settings for a project'),
  23. },
  24. {
  25. path: `${pathPrefix}/teams/`,
  26. title: t('Project Teams'),
  27. description: t('Manage team access for a project'),
  28. },
  29. {
  30. path: `${pathPrefix}/alerts/`,
  31. title: t('Alerts'),
  32. description: t('Manage alert rules for a project'),
  33. },
  34. {
  35. path: `${pathPrefix}/tags/`,
  36. title: t('Tags'),
  37. description: t("View and manage a project's tags"),
  38. },
  39. {
  40. path: `${pathPrefix}/environments/`,
  41. title: t('Environments'),
  42. description: t('Manage environments in a project'),
  43. },
  44. {
  45. path: `${pathPrefix}/ownership/`,
  46. title: t('Issue Owners'),
  47. description: t('Manage issue ownership rules for a project'),
  48. },
  49. {
  50. path: `${pathPrefix}/data-forwarding/`,
  51. title: t('Data Forwarding'),
  52. },
  53. ],
  54. },
  55. {
  56. name: t('Processing'),
  57. items: [
  58. {
  59. path: `${pathPrefix}/filters/`,
  60. title: t('Inbound Filters'),
  61. description: t(
  62. "Configure a project's inbound filters (e.g. browsers, messages)"
  63. ),
  64. },
  65. {
  66. path: `${pathPrefix}/filters-and-sampling/`,
  67. title: t('Filters & Sampling'),
  68. show: () => !!organization?.features?.includes('filters-and-sampling'),
  69. description: t("Manage an organization's inbound data"),
  70. badge: () => 'new',
  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. // eslint-disable-next-line no-shadow
  87. badge: ({project}) => {
  88. if (!project) {
  89. return null;
  90. }
  91. if (project.processingIssues <= 0) {
  92. return null;
  93. }
  94. return project.processingIssues > 99 ? '99+' : project.processingIssues;
  95. },
  96. },
  97. {
  98. path: `${pathPrefix}/debug-symbols/`,
  99. title: t('Debug Files'),
  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. },
  111. {
  112. name: t('SDK Setup'),
  113. items: [
  114. {
  115. path: `${pathPrefix}/install/`,
  116. title: t('Instrumentation'),
  117. },
  118. {
  119. path: `${pathPrefix}/keys/`,
  120. title: t('Client Keys (DSN)'),
  121. description: t("View and manage the project's client keys (DSN)"),
  122. },
  123. {
  124. path: `${pathPrefix}/release-tracking/`,
  125. title: t('Releases'),
  126. },
  127. {
  128. path: `${pathPrefix}/security-headers/`,
  129. title: t('Security Headers'),
  130. },
  131. {
  132. path: `${pathPrefix}/user-feedback/`,
  133. title: t('User Feedback'),
  134. description: t('Configure user feedback reporting feature'),
  135. },
  136. ],
  137. },
  138. {
  139. name: t('Legacy Integrations'),
  140. items: [
  141. {
  142. path: `${pathPrefix}/plugins/`,
  143. title: t('Legacy Integrations'),
  144. description: t('View, enable, and disable all integrations for a project'),
  145. id: 'legacy_integrations',
  146. recordAnalytics: true,
  147. },
  148. ...plugins.map(plugin => ({
  149. path: `${pathPrefix}/plugins/${plugin.id}/`,
  150. title: plugin.name,
  151. show: opts => opts?.access?.has('project:write'),
  152. id: 'plugin_details',
  153. recordAnalytics: true,
  154. })),
  155. ],
  156. },
  157. ];
  158. }