Skip to content
Merged
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
18 changes: 7 additions & 11 deletions apps/web/src/app/(app)/components/OrganizationAppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { useOrganizationWithMembers } from '@/app/api/organizations/hooks';
import { useOrgKiloClawNavState } from '@/hooks/useOrgKiloClaw';
import SidebarMenuList from './SidebarMenuList';
import SidebarUserFooter from './SidebarUserFooter';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { useFeatureFlagEnabled } from 'posthog-js/react';
import { canManageOrganizationBilling } from '@kilocode/app-shared/organizations';

Expand All @@ -61,6 +60,7 @@ export default function OrganizationAppSidebar({
// Feature flags
const isAutoTriageFeatureEnabled = useFeatureFlagEnabled('auto-triage-feature');
const isAppBuilderEnabled = useFeatureFlagEnabled('app-builder-feature');
const isDeployEnabled = useFeatureFlagEnabled('deploy-feature');
const isDevelopment = process.env.NODE_ENV === 'development';

// Get current organization role and data
Expand Down Expand Up @@ -233,7 +233,7 @@ export default function OrganizationAppSidebar({
{ title: 'Auto Fix', icon: Wrench, url: `/organizations/${organizationId}/auto-fix` },
]
: []),
...(ENABLE_DEPLOY_FEATURE
...(isDeployEnabled || isDevelopment
? [
{
title: 'Deploy',
Expand Down Expand Up @@ -287,15 +287,11 @@ export default function OrganizationAppSidebar({
},
]
: []),
...(ENABLE_DEPLOY_FEATURE
? [
{
title: 'Integrations',
icon: Cable,
url: `/organizations/${organizationId}/integrations`,
},
]
: []),
{
title: 'Integrations',
icon: Cable,
url: `/organizations/${organizationId}/integrations`,
},
...(hasOwnerLevelAccess && currentOrg?.plan === 'enterprise'
? [
{
Expand Down
18 changes: 7 additions & 11 deletions apps/web/src/app/(app)/components/PersonalAppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import OrganizationSwitcher from './OrganizationSwitcher';
import SidebarMenuList from './SidebarMenuList';
import SidebarPromoBanner from './SidebarPromoBanner';
import SidebarUserFooter from './SidebarUserFooter';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { isEnabledForUser } from '@/lib/code-indexing/util';
import { useFeatureFlagEnabled } from 'posthog-js/react';
import { usePathname } from 'next/navigation';
Expand All @@ -59,6 +58,7 @@ export default function PersonalAppSidebar(props: React.ComponentProps<typeof Si
const isAutoTriageFeatureEnabled = useFeatureFlagEnabled('auto-triage-feature');
const isGastownEnabled = useFeatureFlagEnabled('gastown-access');
const isAppBuilderEnabled = useFeatureFlagEnabled('app-builder-feature');
const isDeployEnabled = useFeatureFlagEnabled('deploy-feature');
const isDevelopment = process.env.NODE_ENV === 'development';

// Dashboard group
Expand Down Expand Up @@ -173,7 +173,7 @@ export default function PersonalAppSidebar(props: React.ComponentProps<typeof Si
{ title: 'Auto Fix', icon: Wrench, url: '/auto-fix' },
]
: []),
...(ENABLE_DEPLOY_FEATURE
...(isDeployEnabled || isDevelopment
? [
{
title: 'Deploy',
Expand Down Expand Up @@ -223,15 +223,11 @@ export default function PersonalAppSidebar(props: React.ComponentProps<typeof Si
icon: CreditCard,
url: '/subscriptions',
},
...(ENABLE_DEPLOY_FEATURE
? [
{
title: 'Integrations',
icon: Cable,
url: '/integrations',
},
]
: []),
{
title: 'Integrations',
icon: Cable,
url: '/integrations',
},
{
title: 'Invoices',
icon: Receipt,
Expand Down
9 changes: 6 additions & 3 deletions apps/web/src/app/(app)/deploy/[deploymentId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { getUserFromAuthOrRedirect } from '@/lib/user/server';
import { DeployPageClient } from '../DeployPageClient';
import { notFound } from 'next/navigation';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';

export default async function DeploymentDetailPage({
params,
}: {
params: Promise<{ deploymentId: string }>;
}) {
await getUserFromAuthOrRedirect();
const user = await getUserFromAuthOrRedirect();

if (!ENABLE_DEPLOY_FEATURE) {
const isDeployEnabled = await isFeatureFlagEnabled('deploy-feature', user.id);
const isDevelopment = process.env.NODE_ENV === 'development';

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

Expand Down
9 changes: 6 additions & 3 deletions apps/web/src/app/(app)/deploy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { getUserFromAuthOrRedirect } from '@/lib/user/server';
import { DeployPageClient } from './DeployPageClient';
import { notFound } from 'next/navigation';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';

export default async function DeployPage() {
await getUserFromAuthOrRedirect('/users/sign_in?callbackPath=/deploy');
const user = await getUserFromAuthOrRedirect('/users/sign_in?callbackPath=/deploy');

if (!ENABLE_DEPLOY_FEATURE) {
const isDeployEnabled = await isFeatureFlagEnabled('deploy-feature', user.id);
const isDevelopment = process.env.NODE_ENV === 'development';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { getUserFromAuthOrRedirect } from '@/lib/user/server';
import { DeployPageClient } from '../DeployPageClient';
import { notFound } from 'next/navigation';
import { OrganizationByPageLayout } from '@/components/organizations/OrganizationByPageLayout';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';

export default async function OrgDeploymentDetailPage({
params,
}: {
params: Promise<{ id: string; deploymentId: string }>;
}) {
await getUserFromAuthOrRedirect('/users/sign_in');
const user = await getUserFromAuthOrRedirect('/users/sign_in');

if (!ENABLE_DEPLOY_FEATURE) {
const isDeployEnabled = await isFeatureFlagEnabled('deploy-feature', user.id);
const isDevelopment = process.env.NODE_ENV === 'development';

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

Expand Down
9 changes: 6 additions & 3 deletions apps/web/src/app/(app)/organizations/[id]/deploy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { getUserFromAuthOrRedirect } from '@/lib/user/server';
import { DeployPageClient } from './DeployPageClient';
import { notFound } from 'next/navigation';
import { OrganizationByPageLayout } from '@/components/organizations/OrganizationByPageLayout';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';

export default async function OrganizationDeployPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
await getUserFromAuthOrRedirect('/users/sign_in');
const user = await getUserFromAuthOrRedirect('/users/sign_in');

if (!ENABLE_DEPLOY_FEATURE) {
const isDeployEnabled = await isFeatureFlagEnabled('deploy-feature', user.id);
const isDevelopment = process.env.NODE_ENV === 'development';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ import { IntegrationsPageClient } from './IntegrationsPageClient';
import { OrganizationByPageLayout } from '@/components/organizations/OrganizationByPageLayout';
import { SetPageTitle } from '@/components/SetPageTitle';
import { getUserFromAuthOrRedirect } from '@/lib/user/server';
import { notFound } from 'next/navigation';
import { ENABLE_DEPLOY_FEATURE } from '@/lib/constants';

export default async function IntegrationsPage({ params }: { params: Promise<{ id: string }> }) {
await getUserFromAuthOrRedirect('/users/sign_in');

if (!ENABLE_DEPLOY_FEATURE) {
return notFound();
}

return (
<OrganizationByPageLayout
params={params}
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export const AUTOCOMPLETE_MODEL = 'codestral-2508';
export const INCEPTION_PROMO_MODEL = 'inception/mercury-edit-2';
export const INCEPTION_PROMO_RUNNING = false;

export const ENABLE_DEPLOY_FEATURE = true;

export const IS_DEVELOPMENT = process.env.NODE_ENV === 'development';

// Cloud Agent Next WebSocket URL (client-side, inlined at build time)
Expand Down