Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/app/(app)/auto-triage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { getUserFromAuthOrRedirect } from '@/lib/user.server';
import { AutoTriagePageClient } from './AutoTriagePageClient';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';
import { notFound } from 'next/navigation';

type AutoTriagePageProps = {
searchParams: Promise<{ success?: string; error?: string }>;
Expand All @@ -11,14 +9,6 @@ export default async function PersonalAutoTriagePage({ searchParams }: AutoTriag
const search = await searchParams;
const user = await getUserFromAuthOrRedirect('/users/sign_in?callbackPath=/auto-triage');

// Feature flags - use server-side check with user ID as distinct ID
const isAutoTriageFeatureEnabled = await isFeatureFlagEnabled('auto-triage-feature', user.id);
const isDevelopment = process.env.NODE_ENV === 'development';

if (!isAutoTriageFeatureEnabled && !isDevelopment) {
return notFound();
}

return (
<AutoTriagePageClient
userId={user.id}
Expand Down
18 changes: 6 additions & 12 deletions src/app/(app)/components/OrganizationAppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,13 @@ export default function OrganizationAppSidebar({
},
]
: []),
{
title: 'Auto Triage',
icon: ListChecks,
url: `/organizations/${organizationId}/auto-triage`,
},
...(isAutoTriageFeatureEnabled || isDevelopment
? [
{
title: 'Auto Triage',
icon: ListChecks,
url: `/organizations/${organizationId}/auto-triage`,
},
{
title: 'Auto Fix',
icon: Wrench,
url: `/organizations/${organizationId}/auto-fix`,
},
]
? [{ title: 'Auto Fix', icon: Wrench, url: `/organizations/${organizationId}/auto-fix` }]
: []),
...(ENABLE_DEPLOY_FEATURE
? [
Expand Down
18 changes: 6 additions & 12 deletions src/app/(app)/components/PersonalAppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,13 @@ export default function PersonalAppSidebar(props: React.ComponentProps<typeof Si
},
]
: []),
{
title: 'Auto Triage',
icon: ListChecks,
url: '/auto-triage',
},
...(isAutoTriageFeatureEnabled || isDevelopment
? [
{
title: 'Auto Triage',
icon: ListChecks,
url: '/auto-triage',
},
{
title: 'Auto Fix',
icon: Wrench,
url: '/auto-fix',
},
]
? [{ title: 'Auto Fix', icon: Wrench, url: '/auto-fix' }]
: []),
...(ENABLE_DEPLOY_FEATURE
? [
Expand Down
14 changes: 0 additions & 14 deletions src/app/(app)/organizations/[id]/auto-triage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { OrganizationByPageLayout } from '@/components/organizations/OrganizationByPageLayout';
import { notFound } from 'next/navigation';
import { AutoTriagePageClient } from './AutoTriagePageClient';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';

type AutoTriagePageProps = {
params: Promise<{ id: string }>;
searchParams: Promise<{ success?: string; error?: string }>;
};

export default async function AutoTriagePage({ params, searchParams }: AutoTriagePageProps) {
const { id: organizationId } = await params;
const search = await searchParams;

// Feature flags - use server-side check with organization ID as distinct ID
const isAutoTriageFeatureEnabled = await isFeatureFlagEnabled(
'auto-triage-feature',
organizationId
);
const isDevelopment = process.env.NODE_ENV === 'development';

if (!isAutoTriageFeatureEnabled && !isDevelopment) {
return notFound();
}

return (
<OrganizationByPageLayout
params={params}
Expand Down