Implemented MVP with all core features:
- Browse 50 newest policies on load with null filtering
- Click row to view details in slide-over sheet
- JSON detection and pretty formatting
- Search with real-time filtering
- Badge colors for policy types (Security=red, Compliance=blue, Config=gray, App=outline)
- Navigation consolidated to 'Policy Explorer'
New components:
- PolicyTable.tsx - table with badges and hover effects
- PolicySearchContainer.tsx - search state management
- PolicyDetailSheet.tsx - JSON detail view with formatting
- PolicyExplorerClient.tsx - client wrapper
- lib/utils/policyBadges.ts - badge color mapping
Updated:
- lib/actions/policySettings.ts - added getRecentPolicySettings() with null filtering
- app/(app)/search/page.tsx - converted to Server Component
- config/nav.ts - renamed Search to Policy Explorer, removed All Settings
- components/search/EmptyState.tsx - updated messaging
Tasks complete: 36/47 (MVP ready)
- Phase 1-7: All critical features implemented
- Phase 8: Core polish complete (T041), optional tasks remain
TypeScript: ✅ No errors
Status: Production-ready MVP
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { SyncButton } from '@/components/search/SyncButton';
|
|
import { PolicyExplorerClient } from './PolicyExplorerClient';
|
|
import { getRecentPolicySettings } from '@/lib/actions/policySettings';
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
import { Metadata } from 'next';
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Policy Explorer | TenantPilot',
|
|
description: 'Browse and search Microsoft Intune policy settings with detailed views and filtering',
|
|
};
|
|
|
|
export default async function SearchPage() {
|
|
// Fetch initial 50 newest policies on server
|
|
const initialData = await getRecentPolicySettings(50);
|
|
|
|
return (
|
|
<main className="flex flex-1 flex-col gap-4 p-4 md:gap-8 md:p-8">
|
|
<div className="mx-auto w-full max-w-6xl">
|
|
<Card>
|
|
<CardHeader>
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<CardTitle>Policy Explorer</CardTitle>
|
|
<CardDescription>
|
|
Browse and search Intune policy settings
|
|
</CardDescription>
|
|
</div>
|
|
<SyncButton />
|
|
</div>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<PolicyExplorerClient initialPolicies={initialData.data ?? []} />
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</main>
|
|
);
|
|
}
|