Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

7.2 KB
Raw Blame
import { isNil } from '@activepieces/core-utils';
import { ApEdition } from '@activepieces/shared';
import { type ComponentType } from 'react';

import { BotIcon } from '@/components/icons/bot';
import { ChartLineIcon } from '@/components/icons/chart-line';
import { CompassIcon } from '@/components/icons/compass';
import { ConnectIcon } from '@/components/icons/connect';
import { FileHeartIcon } from '@/components/icons/file-heart';
import { FileJson2Icon } from '@/components/icons/file-json2';
import { FrameIcon } from '@/components/icons/frame';
import { KeyRoundIcon } from '@/components/icons/key-round';
import { LayoutGridIcon } from '@/components/icons/layout-grid';
import { LogInIcon } from '@/components/icons/log-in';
import { MousePointerClickIcon } from '@/components/icons/mouse-pointer-click';
import { PaletteIcon } from '@/components/icons/palette';
import { PuzzleIcon } from '@/components/icons/puzzle';
import { ReceiptIcon } from '@/components/icons/receipt';
import { ServerIcon } from '@/components/icons/server';
import { Settings2Icon } from '@/components/icons/settings2';
import { ShieldIcon } from '@/components/icons/shield';
import { SquareDashedBottomCodeIcon } from '@/components/icons/square-dashed-bottom-code';
import { UnplugIcon } from '@/components/icons/unplug';
import { UsersIcon } from '@/components/icons/users';
import { WebhookIcon } from '@/components/icons/webhook';
import { WorkflowIcon } from '@/components/icons/workflow';

export type StaticPage = {
  id: string;
  label: string;
  href: string;
  icon: ComponentType<{ className?: string; size?: number }>;
  requiresPlatformAdmin?: boolean;
  requiresEdition?: ApEdition;
};

export const STATIC_PAGES: StaticPage[] = [
  {
    id: 'page-automations',
    label: 'Automations',
    href: '/automations',
    icon: WorkflowIcon,
  },
  {
    id: 'page-explore',
    label: 'Explore Templates',
    href: '/templates',
    icon: CompassIcon,
  },
  {
    id: 'page-impact',
    label: 'Impact',
    href: '/impact',
    icon: ChartLineIcon,
  },
  {
    id: 'page-mcp',
    label: 'MCP',
    href: '/mcp-server',
    icon: ConnectIcon,
  },
  // Platform Admin pages
  {
    id: 'page-platform-projects',
    label: 'Platform Admin — Projects',
    href: '/platform/projects',
    icon: LayoutGridIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-users',
    label: 'Platform Admin — Users',
    href: '/platform/users',
    icon: UsersIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-ai',
    label: 'Platform Admin — AI Center',
    href: '/platform/ai',
    icon: BotIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-ai-tiers',
    label: 'Platform Admin — AI Tiers',
    href: '/platform/ai/tiers',
    icon: BotIcon,
    requiresPlatformAdmin: true,
    requiresEdition: ApEdition.CLOUD,
  },
  {
    id: 'page-platform-ai-capabilities',
    label: 'Platform Admin — AI Capabilities',
    href: '/platform/ai/capabilities',
    icon: BotIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-mcp',
    label: 'Platform Admin — MCP Tools',
    href: '/platform/mcp',
    icon: ConnectIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-mcp-activity',
    label: 'Platform Admin — MCP Activity',
    href: '/platform/mcp/activity',
    icon: ConnectIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-branding',
    label: 'Platform Admin — General',
    href: '/platform/general',
    icon: PaletteIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-connections',
    label: 'Platform Admin — Global Connections',
    href: '/platform/connections/global',
    icon: UnplugIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-pieces',
    label: 'Platform Admin — Pieces',
    href: '/platform/pieces',
    icon: PuzzleIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-piece-sets',
    label: 'Platform Admin — Piece Sets',
    href: '/platform/pieces/piece-sets',
    icon: PuzzleIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-templates',
    label: 'Platform Admin — Templates',
    href: '/platform/templates',
    icon: LayoutGridIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-billing',
    label: 'Platform Admin — Billing',
    href: '/platform/billing',
    icon: ReceiptIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-embedding',
    label: 'Platform Admin — Embedding',
    href: '/platform/embedding',
    icon: FrameIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-audit-logs',
    label: 'Platform Admin — Audit Logs',
    href: '/platform/audit-log',
    icon: SquareDashedBottomCodeIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-sso',
    label: 'Platform Admin — Authentication',
    href: '/platform/sso',
    icon: LogInIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-project-roles',
    label: 'Platform Admin — Roles & Access',
    href: '/platform/users/roles',
    icon: Settings2Icon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-api-keys',
    label: 'Platform Admin — API Keys',
    href: '/platform/api-keys',
    icon: FileJson2Icon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-secret-managers',
    label: 'Platform Admin — Secret Managers',
    href: '/platform/secret-managers',
    icon: KeyRoundIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-workers',
    label: 'Platform Admin — Workers',
    href: '/platform/workers',
    icon: ServerIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-worker-groups',
    label: 'Platform Admin — Worker Groups',
    href: '/platform/workers/groups',
    icon: ServerIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-health',
    label: 'Platform Admin — Health',
    href: '/platform/health',
    icon: FileHeartIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-health-runs',
    label: 'Platform Admin — Runs Health',
    href: '/platform/health/runs',
    icon: FileHeartIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-health-queue',
    label: 'Platform Admin — Queue Health',
    href: '/platform/health/queue',
    icon: FileHeartIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-triggers',
    label: 'Platform Admin — Triggers',
    href: '/platform/triggers',
    icon: MousePointerClickIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-event-streaming',
    label: 'Platform Admin — Event Streaming',
    href: '/platform/audit-log/streaming',
    icon: WebhookIcon,
    requiresPlatformAdmin: true,
  },
  {
    id: 'page-platform-admin',
    label: 'Platform Admin',
    href: '/platform/projects',
    icon: ShieldIcon,
    requiresPlatformAdmin: true,
  },
];

function isVisible({
  page,
  isPlatformAdmin,
  edition,
}: {
  page: StaticPage;
  isPlatformAdmin: boolean;
  edition: ApEdition | null;
}): boolean {
  return (
    (!page.requiresPlatformAdmin || isPlatformAdmin) &&
    (isNil(page.requiresEdition) || page.requiresEdition === edition)
  );
}

export const staticPageUtils = { isVisible };