Просмотр исходного кода

chore(sampling): Decouple feature flags (#37591)

Matej Minar 2 лет назад
Родитель
Сommit
ef4edda386

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

@@ -73,7 +73,9 @@ export default function getConfiguration({
         {
           path: `${pathPrefix}/server-side-sampling/`,
           title: t('Server-Side Sampling'),
-          show: () => !!organization?.features?.includes('server-side-sampling'),
+          show: () =>
+            !!organization?.features?.includes('server-side-sampling') &&
+            !!organization?.features?.includes('server-side-sampling-ui'),
           description: t(
             "Per-Project basis solution to configure sampling rules within Sentry's UI"
           ),

+ 5 - 2
static/app/views/settings/project/server-side-sampling/index.tsx

@@ -16,12 +16,15 @@ export default function ServerSideSamplingContainer({project}: Props) {
 
   return (
     <Feature
-      features={['server-side-sampling']}
+      features={['server-side-sampling', 'server-side-sampling-ui']}
       organization={organization}
       renderDisabled={() => (
         <FeatureDisabled
           alert={PanelAlert}
-          features={['organization:server-side-sampling']}
+          features={[
+            'organization:server-side-sampling',
+            'organization:server-side-sampling-ui',
+          ]}
           featureName={t('Server-Side Sampling')}
         />
       )}

+ 1 - 1
tests/js/spec/views/settings/project/server-side-sampling/utils.tsx

@@ -194,7 +194,7 @@ export function getMockData({
     ...initializeOrg(),
     organization: {
       ...initializeOrg().organization,
-      features: ['server-side-sampling'],
+      features: ['server-side-sampling', 'server-side-sampling-ui'],
       access: access ?? initializeOrg().organization.access,
       projects,
     },