fix(#338): Gate mock data behind NODE_ENV check
- Create ComingSoon component for production placeholders - Federation connections page shows Coming Soon in production - Workspaces settings page shows Coming Soon in production - Teams page shows Coming Soon in production - Add comprehensive tests for environment-based rendering Refs #338 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,14 @@ import type { ReactElement } from "react";
|
||||
|
||||
import { useState } from "react";
|
||||
import { WorkspaceCard } from "@/components/workspace/WorkspaceCard";
|
||||
import { ComingSoon } from "@/components/ui/ComingSoon";
|
||||
import { WorkspaceMemberRole } from "@mosaic/shared";
|
||||
import Link from "next/link";
|
||||
|
||||
// Mock data - TODO: Replace with real API calls
|
||||
// Check if we're in development mode
|
||||
const isDevelopment = process.env.NODE_ENV === "development";
|
||||
|
||||
// Mock data - TODO: Replace with real API calls (development only)
|
||||
const mockWorkspaces = [
|
||||
{
|
||||
id: "ws-1",
|
||||
@@ -32,7 +36,11 @@ const mockMemberships = [
|
||||
{ workspaceId: "ws-2", role: WorkspaceMemberRole.MEMBER, memberCount: 5 },
|
||||
];
|
||||
|
||||
export default function WorkspacesPage(): ReactElement {
|
||||
/**
|
||||
* Workspaces Page Content - Development Only
|
||||
* Shows mock workspace data for development purposes
|
||||
*/
|
||||
function WorkspacesPageContent(): ReactElement {
|
||||
const [isCreating, setIsCreating] = useState(false);
|
||||
const [newWorkspaceName, setNewWorkspaceName] = useState("");
|
||||
|
||||
@@ -140,3 +148,26 @@ export default function WorkspacesPage(): ReactElement {
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Workspaces Page Entry Point
|
||||
* Shows development content or Coming Soon based on environment
|
||||
*/
|
||||
export default function WorkspacesPage(): ReactElement {
|
||||
// In production, show Coming Soon placeholder
|
||||
if (!isDevelopment) {
|
||||
return (
|
||||
<ComingSoon
|
||||
feature="Workspace Management"
|
||||
description="Create and manage workspaces to organize your projects and collaborate with your team. This feature is currently under development."
|
||||
>
|
||||
<Link href="/settings" className="text-sm text-blue-600 hover:text-blue-700">
|
||||
Back to Settings
|
||||
</Link>
|
||||
</ComingSoon>
|
||||
);
|
||||
}
|
||||
|
||||
// In development, show the full page with mock data
|
||||
return <WorkspacesPageContent />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user