Ahmed Darrazi
d9afe6d3a9
fix(policy-explorer): handle both PolicySettingRow and PolicySettingSearchResult types
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
The PolicyDetailSheet component now properly handles both type unions:
- PolicySettingRow (has graphPolicyId) - used in V2
- PolicySettingSearchResult (has id) - used in V1
Uses type guard to check for 'graphPolicyId' property and falls back to 'id' field.
This fixes the TypeScript compilation error in production builds.
2025-12-10 00:45:52 +01:00
Ahmed Darrazi
aa598452e9
feat(policy-explorer-v2): Phase 6 - Enhanced Detail View
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
Implemented Tasks T038-T046:
- T038: Created useCopyToClipboard hook with toast notifications
- T039: Skipped (unit tests - optional)
- T040: Added copy button for Policy ID field
- T041: Added copy button for Setting Name field
- T042: Added tabs for Details and Raw JSON views
- T043: Implemented Raw JSON tab with syntax highlighting
- T044: Created getIntunePortalLink utility (8 policy types)
- T045: Added Open in Intune button with URL construction
- T046: Fallback to copy Policy ID if URL unavailable
Files Created:
- lib/hooks/useCopyToClipboard.ts (65 lines)
- lib/utils/policy-table-helpers.ts (127 lines)
Files Updated:
- components/policy-explorer/PolicyDetailSheet.tsx (enhanced with tabs, copy buttons, Intune links)
Features:
- Copy-to-clipboard for all fields with visual feedback
- Two-tab interface: Details (enhanced fields) and Raw JSON (full object)
- Deep linking to Intune portal by policy type
- Clipboard API with document.execCommand fallback
- Toast notifications for user feedback
2025-12-10 00:40:09 +01:00
Ahmed Darrazi
4288bc7884
feat(policy-explorer-v2): implement Phase 5 - Bulk CSV Export
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
✨ New Features (Tasks T029-T037)
- Client-side CSV export for selected rows
- Server-side CSV export for all filtered results (max 5000)
- RFC 4180 compliant CSV formatting with proper escaping
- UTF-8 BOM for Excel compatibility
- ExportButton dropdown with two export modes
- Warning UI when results exceed 5000 rows
- Loading state with spinner during server export
📦 New Files
- lib/utils/csv-export.ts - CSV generation utilities
- components/policy-explorer/ExportButton.tsx - Export dropdown
🔧 Updates
- PolicyTableToolbar now includes ExportButton
- PolicyExplorerV2Client passes export props
- Filename generation with timestamp and row count
✅ Zero TypeScript compilation errors
✅ All Phase 5 tasks complete (T029-T037)
✅ Ready for Phase 6 (Enhanced Detail View)
Refs: specs/004-policy-explorer-v2/tasks.md Phase 5
2025-12-10 00:30:33 +01:00
Ahmed Darrazi
c59400cd48
feat(policy-explorer-v2): implement Phase 4 - Enhanced Filtering
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
✨ New Features (Tasks T023-T028)
- PolicyTypeFilter component with multi-select checkboxes
- 8 common Intune policy types (deviceConfiguration, compliancePolicy, etc.)
- Active filter badges with individual remove buttons
- 'Clear All Filters' button when filters active
- Filter count badge in dropdown trigger
🔧 Updates
- PolicyTableToolbar now accepts filter props
- PolicyExplorerV2Client connects filters to URL state
- Filters sync with URL for shareable links
- Filter state triggers data refetch automatically
📦 Dependencies
- Added shadcn DropdownMenu component
✅ Zero TypeScript compilation errors
✅ All Phase 4 tasks complete (T023-T028)
✅ Ready for Phase 5 (CSV Export)
Refs: specs/004-policy-explorer-v2/tasks.md Phase 4
2025-12-10 00:28:35 +01:00
Ahmed Darrazi
41e80b6c0c
feat(policy-explorer-v2): implement MVP Phase 1-3
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
✨ New Features
- Advanced data table with TanStack Table v8 + Server Actions
- Server-side pagination (10/25/50/100 rows per page)
- Multi-column sorting with visual indicators
- Column management (show/hide, resize) persisted to localStorage
- URL state synchronization for shareable filtered views
- Sticky header with compact/comfortable density modes
📦 Components Added
- PolicyTableV2.tsx - Main table with TanStack integration
- PolicyTableColumns.tsx - 7 column definitions with sorting
- PolicyTablePagination.tsx - Pagination controls
- PolicyTableToolbar.tsx - Density toggle + column visibility menu
- ColumnVisibilityMenu.tsx - Show/hide columns dropdown
🔧 Hooks Added
- usePolicyTable.ts - TanStack Table initialization
- useURLState.ts - URL query param sync with nuqs
- useTablePreferences.ts - localStorage persistence
🎨 Server Actions Updated
- getPolicySettingsV2 - Pagination + sorting + filtering + Zod validation
- exportPolicySettingsCSV - Server-side CSV generation (max 5000 rows)
📚 Documentation Added
- Intune Migration Guide (1400+ lines) - Reverse engineering strategy
- Intune Reference Version tracking
- Tasks completed: 22/62 (Phase 1-3)
✅ Zero TypeScript compilation errors
✅ All MVP success criteria met (pagination, sorting, column management)
✅ Ready for Phase 4-7 (filtering, export, detail view, polish)
Refs: specs/004-policy-explorer-v2/tasks.md
2025-12-10 00:18:05 +01:00
Ahmed Darrazi
2eaf325770
Use Graph beta for beta-only endpoints
Trigger Cloudarix Deploy / call-webhook (push) Successful in 4s
2025-12-09 21:56:38 +01:00
Ahmed Darrazi
b6d69295aa
fix: Update route handler params for Next.js 16 async params
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 14:30:48 +01:00
Ahmed Darrazi
6ce68b9a2f
fix: Copy tsconfig.json for tsx path mapping resolution
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 14:05:28 +01:00
Ahmed Darrazi
1cf1b00a9a
fix: Simplify Dockerfile to single-stage with tsx runtime
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 13:59:23 +01:00
Ahmed Darrazi
6afee7d03b
fix: Revert to repo-root COPY paths, set dockerContextPath in Dokploy DB
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 13:54:19 +01:00
Ahmed Darrazi
024c5fca00
fix: Adjust Dockerfile COPY paths for worker/ build context
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 13:48:51 +01:00
Ahmed Darrazi
51a76ef944
fix: Remove .env copy and fix TypeScript errors in worker build
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 13:38:13 +01:00
Ahmed Darrazi
cd2abed1ab
fix(worker): update Dockerfile and README - build path must be / (repo root)
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 12:53:02 +01:00
Ahmed Darrazi
4c6b6613ae
chore(ci): trigger deploy workflow (routine test)
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
2025-12-09 12:48:22 +01:00
Ahmed Darrazi
14722adf0c
chore(worker): two-stage Dockerfile + README with Dokploy settings
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
2025-12-09 12:47:00 +01:00
Ahmed Darrazi
2843281f2f
chore(worker): add Dockerfile and Dokploy README (build path: worker/)
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
2025-12-09 12:43:46 +01:00
Ahmed Darrazi
54e6ed7ecc
ci: call worker deploy webhook (tenantpilot-worker) on development push
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
2025-12-09 12:38:50 +01:00
Ahmed Darrazi
ecb606c038
ci: trigger worker deployment webhook (tenantpilot-worker) from deploy workflow
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 12:37:25 +01:00
Ahmed Darrazi
b360c3311c
chore: merge feature/005-worker-scaffold into development
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-09 12:34:56 +01:00
Ahmed Darrazi
726fb0f890
chore(pr): add PR description draft for feature/005-worker-scaffold
2025-12-09 12:30:50 +01:00
Ahmed Darrazi
75979e7995
chore(worker): add structured logging, job events, worker health endpoint and health-check script
2025-12-09 12:22:16 +01:00
Ahmed Darrazi
434f33ac8f
feat: Improve policy type badge system with definitive mapping
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
- Create PolicyTypeBadge component for consistent badge rendering
- Add POLICY_TYPE_MAP with explicit labels for all 7 policy types:
- configurationProfile → 'Settings Catalog'
- deviceConfiguration → 'Device Configuration'
- compliancePolicy → 'Compliance Policy'
- endpointSecurity → 'Endpoint Security'
- windowsUpdateForBusiness → 'Windows Update'
- enrollmentConfiguration → 'Enrollment'
- appConfiguration → 'App Configuration'
- Update PolicyTable and PolicyDetailSheet to use new component
- Maintain fallback heuristic matching for unknown types
2025-12-08 11:31:45 +01:00
Ahmed Darrazi
56088ca6c0
fix: Resolve search infinite loop issue
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
Fixed useEffect dependency problem in SearchInput that caused
infinite re-renders when searching with 2+ characters.
Changes:
- Removed onSearch from useEffect dependencies
- Added ESLint disable comment for exhaustive-deps
- Search now only triggers on debouncedQuery changes
Issue: Search spinner would hang indefinitely when typing 2 chars
Root cause: onSearch callback recreated on every render, causing loop
Solution: Only depend on debouncedQuery in useEffect
2025-12-07 22:59:07 +01:00
Ahmed Darrazi
4a201bfd26
Merge feature 003: Policy Explorer UX Upgrade
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
Complete implementation of Policy Explorer with:
- Browse 50 newest policies with null filtering
- Detail sheet with JSON formatting
- Real-time search functionality
- Badge colors for policy types
- Consolidated navigation
All tests passing, production-ready MVP.
2025-12-07 02:32:16 +01:00
Ahmed Darrazi
f592e5f55b
feat: Policy Explorer UX Upgrade (003)
...
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
2025-12-07 02:28:15 +01:00
Ahmed Darrazi
ae999e925d
Generate task breakdown for Policy Explorer UX Upgrade
...
47 tasks organized across 8 phases by user story:
Phase 1: Setup (3 tasks)
- Install Shadcn Sheet and Badge components
- Create component directory structure
Phase 2: Foundation (5 tasks) ⚠️ BLOCKING
- getRecentPolicySettings() Server Action
- Extend searchPolicySettings() with limit param
- Null-value filtering in backend
- Type exports
Phase 3: User Story 1 - Browse Recent (8 tasks) 🎯 MVP
- PolicyTable component with click handlers
- PolicySearchContainer client wrapper
- Refactor page to Server Component
- 50 newest policies on load, no empty state
Phase 4: User Story 2 - Detail Sheet (9 tasks) 🎯 MVP
- PolicyDetailSheet component
- JSON detection and formatting
- Click-to-open sheet integration
- Handle long content and errors
Phase 5: User Story 3 - Search (6 tasks) P2
- Integrate SearchInput component
- Search state management
- Null filtering in results
Phase 6: User Story 4 - Visual (5 tasks) P3
- Badge color mapping
- Badge rendering for policy types
- Hover effects verification
Phase 7: Navigation (4 tasks)
- Update config/nav.ts
- Remove 'All Settings' menu item
- Consolidate to single 'Policy Explorer'
Phase 8: Polish (7 tasks)
- Responsive layout
- Loading states
- Performance validation (<2s load, <300ms sheet)
- Accessibility and cross-browser testing
MVP Scope: Phases 1-4 (25 tasks)
Total: 47 tasks with dependency graph and parallel execution opportunities
2025-12-07 02:12:31 +01:00
Ahmed Darrazi
414eb709b9
Add implementation plan for Policy Explorer UX Upgrade
...
Phase 0 (Research): 6 key decisions to make
- Server/Client composition pattern for initial data + search
- Null filtering strategy (backend vs frontend)
- JSON formatting approach (native vs syntax highlighter)
- Badge color mapping for policy types
- Route strategy (/search redirect vs replacement)
- Sheet component state management
Phase 1 (Design): API contracts and component design
- getRecentPolicySettings() Server Action (new)
- searchPolicySettings() extension with limit param
- PolicyDetailSheet component (Shadcn Sheet)
- PolicyTable component with click handlers
- PolicySearchContainer client wrapper
Phase 2 (Implementation): 44 tasks across 7 epics
- Epic 1: Backend Server Actions (P1, T001-T005)
- Epic 2: Detail Sheet component (P1, T006-T011)
- Epic 3: Table & Search components (P1, T012-T018)
- Epic 4: Page refactor (P1, T019-T024)
- Epic 5: Navigation update (P2, T025-T029)
- Epic 6: Visual improvements (P3, T030-T034)
- Epic 7: Testing & validation (T035-T044)
Constitution compliance: ✅ All checks pass
Performance targets: <2s initial load, <300ms detail sheet, <2s search
No database changes required - extends existing schema
2025-12-07 02:09:53 +01:00
Ahmed Darrazi
06341038ea
Add specification for Policy Explorer UX Upgrade
...
- Feature 003: Transform global search into full Policy Explorer
- Show 50 newest policies by default (no empty state)
- Filter out null values automatically
- Add clickable rows with detail sheet for JSON formatting
- Improve visual hierarchy with policy type badges
- Consolidate navigation (remove 'All Settings')
Spec includes 4 prioritized user stories (P1/P2/P3), 11 functional requirements, and 6 measurable success criteria. All requirements are testable and technology-agnostic.
Checklist validation: All items pass ✅
2025-12-07 02:06:19 +01:00
Ahmed Darrazi
156df400f0
merge: Integrate 001-global-policy-search spec clarifications
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-07 01:55:27 +01:00
Ahmed Darrazi
2592b89bc6
feat: Add settings overview page with getAllPolicySettings
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
- Add new /settings-overview route displaying all policy settings in table
- Implement getAllPolicySettings() server action with tenant isolation
- Add 'All Settings' navigation item with Database icon
- Use date-fns for relative time display (lastSyncedAt)
- Server-side rendering for optimal performance
2025-12-07 01:50:34 +01:00
Ahmed Darrazi
f3d074e105
docs: Add clarifications to 001-global-policy-search spec
2025-12-07 01:50:13 +01:00
Ahmed Darrazi
8b36902767
Fix: Add unique constraint for policy_settings upsert
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-06 23:33:43 +01:00
Ahmed Darrazi
bd7758191e
Switch to development branch and update deployment workflow
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-06 20:42:10 +01:00
Ahmed Darrazi
88c1474884
Add specification for 002-manual-policy-sync feature
2025-12-06 13:35:54 +01:00
Ahmed Darrazi
c4600ba68c
Fix tenant_id not being saved to database on login
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-06 12:29:00 +01:00
Ahmed Darrazi
e0a746b29c
Add tenant_id to users table and admin tenants API endpoint
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-06 00:35:02 +01:00
Ahmed Darrazi
e1df2a98dd
Fix: Make Azure AD env vars optional for build time
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:54:03 +01:00
Ahmed Darrazi
477ac67703
Fix: Make all env vars optional for Docker build time
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:52:11 +01:00
Ahmed Darrazi
f80c3a1598
Fix: Multiple TypeScript build errors for production
...
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
- Remove unused NextAuthOptions import, use inferred types
- Add 'as const' to session strategy
- Add explicit callback parameter types with optional properties
- Update Stripe API version to 2025-11-17.clover
- Make Stripe and Resend initialization conditional for build time
- Update next-auth.d.ts type declarations
2025-12-05 23:49:00 +01:00
Ahmed Darrazi
3695f7eb0c
Fix: Import getServerSession from next-auth/next
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:42:15 +01:00
Ahmed Darrazi
8b12c3ed9e
Fix: Use type imports for NextAuth types
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:40:46 +01:00
Ahmed Darrazi
9b34f87bcb
Fix: Remove unused DefaultSession import
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:39:18 +01:00
Ahmed Darrazi
f40dcb2538
Fix: Import ThemeProviderProps from next-themes root
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:16:43 +01:00
Ahmed Darrazi
cd1878755d
Workflow changed
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:15:49 +01:00
Ahmed Darrazi
6c3ca9bf24
Fix: Use subscription item's current_period_end (Stripe API v2)
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:11:04 +01:00
Ahmed Darrazi
09f0ea8aa7
Fix: Cast Stripe subscription to correct type
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:07:13 +01:00
Ahmed Darrazi
2e41bbc149
Fix: Add type guards for Stripe subscription current_period_end
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 23:02:57 +01:00
Ahmed Darrazi
bde9b3fee0
Fix: Await headers() in stripe webhook
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 22:58:12 +01:00
Ahmed Darrazi
f15a5188dc
Add GitHub Actions workflow for Cloudarix deployment
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
2025-12-05 22:49:38 +01:00
Ahmed Darrazi
76b83c178c
Fix: TypeScript error in email route
2025-12-05 22:46:53 +01:00