|
@@ -1,5 +1,3 @@
|
|
|
-import {useEffect} from 'react';
|
|
|
-
|
|
|
import Feature from 'sentry/components/acl/feature';
|
|
|
import {Alert} from 'sentry/components/alert';
|
|
|
import * as Layout from 'sentry/components/layouts/thirds';
|
|
@@ -7,10 +5,7 @@ import NoProjectMessage from 'sentry/components/noProjectMessage';
|
|
|
import {t} from 'sentry/locale';
|
|
|
import {Organization} from 'sentry/types';
|
|
|
import {QueryClient, QueryClientProvider} from 'sentry/utils/queryClient';
|
|
|
-import {useLocation} from 'sentry/utils/useLocation';
|
|
|
-import useRouter from 'sentry/utils/useRouter';
|
|
|
import withOrganization from 'sentry/utils/withOrganization';
|
|
|
-import {ALLOWED_PROJECT_IDS_FOR_ORG_SLUG} from 'sentry/views/starfish/allowedProjects';
|
|
|
|
|
|
type Props = {
|
|
|
children: React.ReactChildren;
|
|
@@ -20,24 +15,6 @@ type Props = {
|
|
|
const queryClient = new QueryClient();
|
|
|
|
|
|
function StarfishContainer({organization, children}: Props) {
|
|
|
- const location = useLocation();
|
|
|
- const router = useRouter();
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- const allowedProjectIDs: string[] =
|
|
|
- ALLOWED_PROJECT_IDS_FOR_ORG_SLUG[organization.slug] ?? [];
|
|
|
- const requestedProjectID: string = Array.isArray(location?.query?.project)
|
|
|
- ? location.query.project[0]
|
|
|
- : location.query.project ?? '';
|
|
|
-
|
|
|
- if (allowedProjectIDs.length > 0 && !allowedProjectIDs.includes(requestedProjectID)) {
|
|
|
- router.replace({
|
|
|
- pathname: location.pathname,
|
|
|
- query: {...location.query, project: allowedProjectIDs[0]},
|
|
|
- });
|
|
|
- }
|
|
|
- }, [router, location, organization]);
|
|
|
-
|
|
|
return (
|
|
|
<Feature
|
|
|
hookName="feature-disabled:starfish-view"
|