Skip to content

Commit 3b32159

Browse files
author
Gerome El-assaad
committed
Cleaned up integrations page and removed GitHub-related functionality
1 parent 9d4a7be commit 3b32159

File tree

12 files changed

+550
-179
lines changed

12 files changed

+550
-179
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@
1717
"files.associations": {
1818
"*.css": "tailwindcss"
1919
},
20-
"CodeGPT.apiKey": "CodeGPT Plus Beta"
2120
}

CHANGELOG.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,86 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [v0.0.30] - Changelog Updates
5+
## [v0.0.31] - 2025-08-07
6+
7+
### 🗑️ Removed
8+
- **GitHub Integration**: Cleaned up integrations page and removed GitHub-related functionality
9+
- Removed GitHub from available integrations list in settings
10+
- Eliminated GitHub OAuth flow and token management logic
11+
- Removed GitHub Integration Status monitoring card
12+
- Cleaned up GitHub-specific imports and connection handling
13+
- Reduced integrations page bundle size from 133KB to 6.45KB
14+
15+
### 🔧 Fixed
16+
- **Build Configuration**: Resolved Tailwind CSS configuration issues
17+
- Fixed duplicate `tailwind.config.js` file causing content warnings
18+
- Eliminated "content option missing" build warnings
19+
- Improved build performance and clean compilation
20+
21+
---
22+
23+
## [v0.0.30] - 2025-08-07
24+
25+
### 🔒 Security
26+
- **Dependency Vulnerabilities**: Resolved npm audit security issues
27+
- Fixed `tmp` package vulnerability (GHSA-52f5-9888-hmc6) in development dependencies
28+
- Added npm override to force secure version of `tmp` package
29+
- Zero vulnerabilities now reported by npm audit
30+
31+
### 🔧 Fixed
32+
- **Account Settings Page**: Complete rewrite and bug fixes for `/app/settings/account/page.tsx`
33+
- Fixed broken authentication hook usage with proper callback functions
34+
- Eliminated race conditions in async operations with mounted component checks
35+
- Resolved memory leaks by adding proper cleanup functions and dependency management
36+
- Fixed duplicate Supabase instance creation and consolidated auth state management
37+
- Added comprehensive form validation with real-time feedback
38+
- Enhanced error handling with user-friendly messages and recovery suggestions
39+
40+
### 🚀 Added
41+
- **GrowthBook Feature Flags Integration**: Complete feature flag system for A/B testing and feature rollouts
42+
- Integrated @flags-sdk/growthbook with production-ready configuration
43+
- Smart user identification system with device/browser detection and UTM tracking
44+
- Comprehensive feature flag setup with 10+ predefined flags for platform features
45+
- API endpoint for feature flag status (`/api/flags`)
46+
- Utility functions for easy feature flag management and conditional rendering
47+
- Example components demonstrating feature flag usage patterns
48+
49+
### 🚀 Enhanced
50+
- **Security Improvements**: Strengthened account security features
51+
- Enhanced password validation with strict security requirements (8+ characters, mixed case, numbers)
52+
- Improved email validation with proper regex patterns
53+
- Better file upload validation for avatars (type, size, and format checks)
54+
- Added form state tracking to prevent unnecessary API calls
55+
56+
- **User Experience**: Comprehensive UX improvements
57+
- Added dirty state tracking for forms to enable/disable buttons appropriately
58+
- Enhanced loading states with proper coordination across components
59+
- Improved error messaging with contextual, actionable feedback
60+
- Better avatar upload flow with progress indicators and validation
61+
62+
### ♿ Accessibility
63+
- **WCAG Compliance**: Added comprehensive accessibility features
64+
- Proper ARIA labels and descriptions for all interactive elements
65+
- Screen reader announcements for loading states and errors
66+
- Form field associations with error messages
67+
- Keyboard navigation support throughout the interface
68+
69+
### 🛠️ Technical Improvements
70+
- **Code Quality**: Production-ready improvements
71+
- Eliminated all race conditions with proper async coordination
72+
- Added TypeScript validation and error handling
73+
- Implemented proper component lifecycle management
74+
- Enhanced file upload handling with comprehensive validation
75+
76+
### 🧹 Maintenance
77+
- **Build System**: Ensured production readiness
78+
- All ESLint checks passing without warnings
79+
- Successful TypeScript compilation
80+
- No build errors or type safety issues
81+
82+
---
83+
84+
## [v0.0.29] - Previous Workflow Release
685

786
### 🚀 Added
887
- **Workflow System Integration**: Complete AI-powered workflow creation and execution system

app/api/flags/route.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { NextRequest, NextResponse } from 'next/server';
2+
import { getAllFeatureFlags } from '@/lib/feature-flags';
3+
4+
// Force dynamic rendering for this route
5+
export const dynamic = 'force-dynamic';
6+
7+
export async function GET(request: NextRequest) {
8+
try {
9+
const flags = await getAllFeatureFlags();
10+
11+
return NextResponse.json({
12+
success: true,
13+
flags,
14+
timestamp: new Date().toISOString(),
15+
});
16+
} catch (error) {
17+
console.error('Error fetching feature flags:', error);
18+
19+
return NextResponse.json(
20+
{
21+
success: false,
22+
error: 'Failed to fetch feature flags',
23+
timestamp: new Date().toISOString(),
24+
},
25+
{ status: 500 }
26+
);
27+
}
28+
}

app/settings/integrations/page.tsx

Lines changed: 1 addition & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import { Switch } from '@/components/ui/switch'
66
import { Badge } from '@/components/ui/badge'
77
import { useToast } from '@/components/ui/use-toast'
88
import {
9-
Github,
109
Mail,
1110
Calendar,
1211
FolderOpen,
1312
Plus,
1413
Unlink,
1514
Loader2,
1615
ExternalLink,
17-
Activity,
18-
Clock,
1916
RefreshCw
2017
} from 'lucide-react'
2118
import { useState, useEffect, useCallback } from 'react'
@@ -26,24 +23,8 @@ import {
2623
disconnectUserIntegration,
2724
UserIntegration
2825
} from '@/lib/user-settings'
29-
import {
30-
generateGitHubOAuthUrl,
31-
getGitHubScopes,
32-
revokeGitHubToken,
33-
isGitHubIntegrationHealthy,
34-
formatGitHubWebhookEvent,
35-
getGitHubEventIcon,
36-
type GitHubOAuthConfig
37-
} from '@/lib/github-oauth'
3826

3927
const availableIntegrations = [
40-
{
41-
id: 'github',
42-
name: 'GitHub',
43-
description: 'Access your repositories and collaborate on code',
44-
icon: Github,
45-
color: 'bg-gray-900 text-white'
46-
},
4728
{
4829
id: 'google-drive',
4930
name: 'Google Drive',
@@ -110,29 +91,6 @@ export default function IntegrationsSettings() {
11091
initializeIntegrations()
11192
}, [session?.user?.id, loadIntegrations])
11293

113-
useEffect(() => {
114-
const urlParams = new URLSearchParams(window.location.search)
115-
const success = urlParams.get('success')
116-
const error = urlParams.get('error')
117-
118-
if (success === 'github_connected') {
119-
toast({
120-
title: "Success",
121-
description: "GitHub connected successfully!",
122-
})
123-
window.history.replaceState({}, '', window.location.pathname)
124-
loadIntegrations()
125-
}
126-
127-
if (error) {
128-
toast({
129-
title: "Error",
130-
description: decodeURIComponent(error),
131-
variant: "destructive",
132-
})
133-
window.history.replaceState({}, '', window.location.pathname)
134-
}
135-
}, [loadIntegrations, toast])
13694

13795
const getIntegrationStatus = useCallback((serviceId: string) => {
13896
const integration = integrations.find(integration => integration.service_name === serviceId)
@@ -163,27 +121,6 @@ export default function IntegrationsSettings() {
163121
setConnecting(serviceId)
164122

165123
try {
166-
if (serviceId === 'github') {
167-
if (!process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID) {
168-
throw new Error('GitHub OAuth not configured. Please check environment variables.')
169-
}
170-
171-
const redirectUri = process.env.NEXT_PUBLIC_SITE_URL
172-
? `${process.env.NEXT_PUBLIC_SITE_URL}/api/auth/github`
173-
: `${window.location.origin}/api/auth/github`
174-
175-
const config: GitHubOAuthConfig = {
176-
clientId: process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID,
177-
redirectUri: redirectUri,
178-
scopes: getGitHubScopes(),
179-
}
180-
181-
console.log('Initiating GitHub OAuth with config:', config)
182-
const authUrl = generateGitHubOAuthUrl(config)
183-
window.location.href = authUrl
184-
return
185-
}
186-
187124
console.log(`Connecting ${serviceId} for user:`, session.user.id)
188125

189126
const success = await upsertUserIntegration(session.user.id, serviceId, {
@@ -224,17 +161,6 @@ export default function IntegrationsSettings() {
224161
try {
225162
console.log(`Disconnecting ${serviceId} for user:`, session.user.id)
226163

227-
if (serviceId === 'github') {
228-
const integration = getIntegrationStatus(serviceId)
229-
if (integration?.connection_data?.access_token) {
230-
console.log('Revoking GitHub token...')
231-
const revoked = await revokeGitHubToken(integration.connection_data.access_token)
232-
if (!revoked) {
233-
console.warn('Failed to revoke GitHub token, but continuing with disconnect')
234-
}
235-
}
236-
}
237-
238164
const success = await disconnectUserIntegration(session.user.id, serviceId)
239165

240166
if (success) {
@@ -288,8 +214,6 @@ export default function IntegrationsSettings() {
288214
)
289215
}
290216

291-
const githubIntegration = getIntegrationStatus('github')
292-
293217
return (
294218
<div className="space-y-6">
295219
<div className="flex items-center justify-between">
@@ -330,7 +254,7 @@ export default function IntegrationsSettings() {
330254
const isConnecting = connecting === service.id
331255
const isDisconnecting = disconnecting === service.id
332256
const isProcessing = isConnecting || isDisconnecting
333-
const isHealthy = service.id === 'github' && integration ? isGitHubIntegrationHealthy(integration) : isConnected
257+
const isHealthy = isConnected
334258

335259
console.log(`Service ${service.id}: connected=${isConnected}, integration=`, integration)
336260

@@ -362,11 +286,6 @@ export default function IntegrationsSettings() {
362286
Connected {new Date(integration.connection_data.connected_at).toLocaleDateString()}
363287
</p>
364288
)}
365-
{service.id === 'github' && isConnected && integration?.connection_data?.username && (
366-
<p className="text-xs text-muted-foreground">
367-
GitHub: @{integration.connection_data.username}
368-
</p>
369-
)}
370289
{integration?.connection_data?.simulated && (
371290
<p className="text-xs text-yellow-600">
372291
Simulated connection
@@ -413,74 +332,6 @@ export default function IntegrationsSettings() {
413332
</CardContent>
414333
</Card>
415334

416-
{githubIntegration?.is_connected && (
417-
<Card>
418-
<CardHeader>
419-
<CardTitle className="flex items-center gap-2">
420-
<Activity className="h-5 w-5" />
421-
GitHub Integration Status
422-
</CardTitle>
423-
<CardDescription>
424-
Monitor your GitHub integration health and recent activity.
425-
</CardDescription>
426-
</CardHeader>
427-
<CardContent>
428-
<div className="space-y-4">
429-
<div className="flex items-center justify-between">
430-
<span className="text-sm font-medium">Connection Status</span>
431-
<div className="flex items-center gap-2">
432-
<div className={`h-2 w-2 rounded-full ${isGitHubIntegrationHealthy(githubIntegration) ? 'bg-green-500' : 'bg-yellow-500'}`}></div>
433-
<span className="text-sm text-muted-foreground">
434-
{isGitHubIntegrationHealthy(githubIntegration) ? 'Healthy' : 'Needs Attention'}
435-
</span>
436-
</div>
437-
</div>
438-
439-
{githubIntegration.connection_data?.github_user_id && (
440-
<div className="flex items-center justify-between">
441-
<span className="text-sm font-medium">GitHub User ID</span>
442-
<span className="text-sm text-muted-foreground">
443-
{githubIntegration.connection_data.github_user_id}
444-
</span>
445-
</div>
446-
)}
447-
448-
{githubIntegration.last_sync_at && (
449-
<div className="flex items-center justify-between">
450-
<span className="text-sm font-medium flex items-center gap-2">
451-
<Clock className="h-4 w-4" />
452-
Last Sync
453-
</span>
454-
<span className="text-sm text-muted-foreground">
455-
{new Date(githubIntegration.last_sync_at).toLocaleString()}
456-
</span>
457-
</div>
458-
)}
459-
460-
{githubIntegration.connection_data?.last_webhook_event && (
461-
<div className="space-y-2">
462-
<span className="text-sm font-medium">Recent Activity</span>
463-
<div className="p-3 bg-muted rounded-lg">
464-
<div className="flex items-start gap-2">
465-
<span className="text-lg">
466-
{getGitHubEventIcon(githubIntegration.connection_data.last_webhook_event.type)}
467-
</span>
468-
<div className="flex-1">
469-
<p className="text-sm">
470-
{formatGitHubWebhookEvent(githubIntegration.connection_data.last_webhook_event)}
471-
</p>
472-
<p className="text-xs text-muted-foreground">
473-
{new Date(githubIntegration.connection_data.last_webhook_event.timestamp).toLocaleString()}
474-
</p>
475-
</div>
476-
</div>
477-
</div>
478-
</div>
479-
)}
480-
</div>
481-
</CardContent>
482-
</Card>
483-
)}
484335

485336
<Card>
486337
<CardHeader>

0 commit comments

Comments
 (0)