Skip to content

Commit c9ecb74

Browse files
authored
fix(metrics): allow access with a direct url (#78673)
1 parent e282378 commit c9ecb74

File tree

3 files changed

+3
-30
lines changed

3 files changed

+3
-30
lines changed

static/app/views/metrics/index.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
import Feature from 'sentry/components/acl/feature';
2-
import {Alert} from 'sentry/components/alert';
3-
import * as Layout from 'sentry/components/layouts/thirds';
4-
import NoProjectMessage from 'sentry/components/noProjectMessage';
5-
import {t} from 'sentry/locale';
6-
import useOrganization from 'sentry/utils/useOrganization';
7-
81
type Props = {
92
children: React.ReactNode;
103
};
114

125
function MetricsContainer({children}: Props) {
13-
const organization = useOrganization();
14-
15-
return (
16-
<Feature
17-
features={['custom-metrics']}
18-
requireAll
19-
organization={organization}
20-
renderDisabled={() => (
21-
<Layout.Page withPadding>
22-
<Alert type="warning">{t("You don't have access to this feature")}</Alert>
23-
</Layout.Page>
24-
)}
25-
>
26-
<NoProjectMessage organization={organization}>{children}</NoProjectMessage>
27-
</Feature>
28-
);
6+
return children;
297
}
308

319
export default MetricsContainer;

static/app/views/metrics/metricsRemovedAlertsWidgetsAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function MetricsRemovedAlertsWidgetsAlert({
2020
expirationDays: 365,
2121
});
2222
const hasDeletedAlertsOrWidgets = organization.features.includes(
23-
'organizations:custom-metrics-alerts-widgets-removal-info'
23+
'custom-metrics-alerts-widgets-removal-info'
2424
);
2525

2626
if (isDismissed || !hasDeletedAlertsOrWidgets) {
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Feature from 'sentry/components/acl/feature';
21
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
32
import type {Organization} from 'sentry/types/organization';
43
import type {Project} from 'sentry/types/project';
@@ -11,11 +10,7 @@ type Props = RouteComponentProps<{projectId: string}, {}> & {
1110
};
1211

1312
function ProjectMetricsContainer(props: Props) {
14-
return (
15-
<Feature features={['custom-metrics']}>
16-
<ProjectMetrics {...props} />
17-
</Feature>
18-
);
13+
return <ProjectMetrics {...props} />;
1914
}
2015

2116
export default ProjectMetricsContainer;

0 commit comments

Comments
 (0)