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

fix(metrics): allow access with a direct url (#78673)

Ogi 5 месяцев назад
Родитель
Сommit
c9ecb749e7

+ 1 - 23
static/app/views/metrics/index.tsx

@@ -1,31 +1,9 @@
-import Feature from 'sentry/components/acl/feature';
-import {Alert} from 'sentry/components/alert';
-import * as Layout from 'sentry/components/layouts/thirds';
-import NoProjectMessage from 'sentry/components/noProjectMessage';
-import {t} from 'sentry/locale';
-import useOrganization from 'sentry/utils/useOrganization';
-
 type Props = {
   children: React.ReactNode;
 };
 
 function MetricsContainer({children}: Props) {
-  const organization = useOrganization();
-
-  return (
-    <Feature
-      features={['custom-metrics']}
-      requireAll
-      organization={organization}
-      renderDisabled={() => (
-        <Layout.Page withPadding>
-          <Alert type="warning">{t("You don't have access to this feature")}</Alert>
-        </Layout.Page>
-      )}
-    >
-      <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
-    </Feature>
-  );
+  return children;
 }
 
 export default MetricsContainer;

+ 1 - 1
static/app/views/metrics/metricsRemovedAlertsWidgetsAlert.tsx

@@ -20,7 +20,7 @@ export function MetricsRemovedAlertsWidgetsAlert({
     expirationDays: 365,
   });
   const hasDeletedAlertsOrWidgets = organization.features.includes(
-    'organizations:custom-metrics-alerts-widgets-removal-info'
+    'custom-metrics-alerts-widgets-removal-info'
   );
 
   if (isDismissed || !hasDeletedAlertsOrWidgets) {

+ 1 - 6
static/app/views/settings/projectMetrics/index.tsx

@@ -1,4 +1,3 @@
-import Feature from 'sentry/components/acl/feature';
 import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
 import type {Organization} from 'sentry/types/organization';
 import type {Project} from 'sentry/types/project';
@@ -11,11 +10,7 @@ type Props = RouteComponentProps<{projectId: string}, {}> & {
 };
 
 function ProjectMetricsContainer(props: Props) {
-  return (
-    <Feature features={['custom-metrics']}>
-      <ProjectMetrics {...props} />
-    </Feature>
-  );
+  return <ProjectMetrics {...props} />;
 }
 
 export default ProjectMetricsContainer;