Browse Source

feat(self-hosted): Errors only self-hosted for project settings (#72831)

Remove project settings for features not enabled for errors-only
self-hosted

<img width="214" alt="Screenshot 2024-06-14 at 4 10 01 PM"
src="https://github.com/getsentry/sentry/assets/25517925/c2b98325-b073-4ebc-b6ed-1eeb9e1e0adc">
Hubert Deng 8 months ago
parent
commit
3ff7bb79a9
1 changed files with 11 additions and 3 deletions
  1. 11 3
      static/app/views/settings/project/navigationConfiguration.tsx

+ 11 - 3
static/app/views/settings/project/navigationConfiguration.tsx

@@ -1,5 +1,6 @@
 import FeatureBadge from 'sentry/components/badge/featureBadge';
 import {t} from 'sentry/locale';
+import ConfigStore from 'sentry/stores/configStore';
 import type {Organization} from 'sentry/types/organization';
 import type {Project} from 'sentry/types/project';
 import {hasCustomMetrics} from 'sentry/utils/metrics/features';
@@ -19,6 +20,7 @@ export default function getConfiguration({
   debugFilesNeedsReview,
 }: ConfigParams): NavigationSection[] {
   const plugins = (project?.plugins || []).filter(plugin => plugin.enabled);
+  const isSelfHostedErrorsOnly = ConfigStore.get('isSelfHostedErrorsOnly');
   return [
     {
       name: t('Project'),
@@ -61,6 +63,7 @@ export default function getConfiguration({
         {
           path: `${pathPrefix}/user-feedback/`,
           title: t('User Feedback'),
+          show: () => !isSelfHostedErrorsOnly,
         },
       ],
     },
@@ -114,17 +117,22 @@ export default function getConfiguration({
         {
           path: `${pathPrefix}/performance/`,
           title: t('Performance'),
-          show: () => !!organization?.features?.includes('performance-view'),
+          show: () =>
+            !!organization?.features?.includes('performance-view') &&
+            !isSelfHostedErrorsOnly,
         },
         {
           path: `${pathPrefix}/metrics/`,
           title: t('Metrics'),
-          show: () => !!(organization && hasCustomMetrics(organization)),
+          show: () =>
+            !!(organization && hasCustomMetrics(organization)) && !isSelfHostedErrorsOnly,
         },
         {
           path: `${pathPrefix}/replays/`,
           title: t('Replays'),
-          show: () => !!organization?.features?.includes('session-replay-ui'),
+          show: () =>
+            !!organization?.features?.includes('session-replay-ui') &&
+            !isSelfHostedErrorsOnly,
         },
       ],
     },