ALwrity + Wix + Wordpress + GSC + Bug Fixes

This commit is contained in:
ajaysi
2025-10-10 13:08:09 +05:30
parent af4c8afb5b
commit 11f164ae21
80 changed files with 125 additions and 678 deletions

View File

@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useEffect } from 'react';
import {
Box,
Card,
@@ -7,10 +7,6 @@ import {
IconButton,
Button,
Typography,
Stepper,
Step,
StepLabel,
StepConnector,
Fade,
LinearProgress,
} from '@mui/material';
@@ -25,7 +21,6 @@ import {
Key,
ContentPasteRounded,
} from '@mui/icons-material';
import { styled } from '@mui/material/styles';
interface ApiKeyCarouselProps {
providers: Array<{
@@ -40,40 +35,19 @@ interface ApiKeyCarouselProps {
link: string;
free: boolean;
recommended: boolean;
benefits: string[];
}>;
benefits: string[];
}>;
currentProvider: number;
setCurrentProvider: (index: number) => void;
onProviderFocus: (provider: any) => void;
}
const CustomStepConnector = styled(StepConnector)(({ theme }) => ({
'&.MuiStepConnector-alternativeLabel': {
top: 10,
left: 'calc(-50% + 16px)',
right: 'calc(50% + 16px)',
},
'& .MuiStepConnector-line': {
height: 3,
border: 0,
background: 'linear-gradient(90deg, #E2E8F0 0%, #CBD5E1 100%)',
borderRadius: 2,
},
'&.MuiStepConnector-active .MuiStepConnector-line': {
background: 'linear-gradient(90deg, #3B82F6 0%, #1D4ED8 100%)',
},
'&.MuiStepConnector-completed .MuiStepConnector-line': {
background: 'linear-gradient(90deg, #10B981 0%, #059669 100%)',
},
}));
const ApiKeyCarousel: React.FC<ApiKeyCarouselProps> = ({
providers,
currentProvider,
setCurrentProvider,
onProviderFocus,
}) => {
const [autoProgress, setAutoProgress] = useState(false);
const provider = providers[currentProvider];
const getAccentColor = (name: string) => {
@@ -117,14 +91,6 @@ const ApiKeyCarousel: React.FC<ApiKeyCarouselProps> = ({
}
};
const getStepIcon = (index: number) => {
const stepProvider = providers[index];
if (stepProvider.status === 'valid') {
return <CheckCircle sx={{ color: 'success.main' }} />;
}
return <Key sx={{ color: stepProvider === provider ? 'primary.main' : 'text.disabled' }} />;
};
return (
<Box sx={{ width: '100%', maxWidth: 600, mx: 'auto' }}>
{/* Progress Stepper - Hidden as requested */}

View File

@@ -10,13 +10,10 @@ import {
ListItemText,
Chip,
Divider,
Alert,
} from '@mui/material';
import {
CheckCircle,
Star,
Security,
Speed,
TrendingUp,
Insights,
Search,

View File

@@ -1,12 +1,10 @@
import { useState, useEffect, useCallback } from 'react';
import { useAuth } from '@clerk/clerk-react';
import { getApiKeysForOnboarding, getStep1ApiKeysFromProgress, saveApiKey } from '../../../../api/onboarding';
import { getKeyStatus, formatErrorMessage } from '../../common/onboardingUtils';
import { Provider } from './ProviderCard';
import { apiClient } from '../../../../api/client';
export const useApiKeyStep = (onContinue: (stepData?: any) => void) => {
const { getToken } = useAuth();
const [geminiKey, setGeminiKey] = useState('');
const [exaKey, setExaKey] = useState('');
const [copilotkitKey, setCopilotkitKey] = useState('');

View File

@@ -52,7 +52,7 @@ const CompetitorAnalysisStep: React.FC<CompetitorAnalysisStepProps> = ({
const [analysisStep, setAnalysisStep] = useState('');
const [competitors, setCompetitors] = useState<Competitor[]>([]);
const [socialMediaAccounts, setSocialMediaAccounts] = useState<any>({});
const [socialMediaCitations, setSocialMediaCitations] = useState<any[]>([]);
const [, setSocialMediaCitations] = useState<any[]>([]);
const [researchSummary, setResearchSummary] = useState<ResearchSummary | null>(null);
const [error, setError] = useState<string | null>(null);
const [showProgressModal, setShowProgressModal] = useState(false);
@@ -260,6 +260,7 @@ const CompetitorAnalysisStep: React.FC<CompetitorAnalysisStepProps> = ({
} finally {
setIsAnalyzingSitemap(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [userUrl, competitors, industryContext, isAnalyzingSitemap]);
// Initialize: Check cache first, then run analysis if needed
@@ -313,36 +314,6 @@ const CompetitorAnalysisStep: React.FC<CompetitorAnalysisStepProps> = ({
};
}, [competitors, researchSummary, sitemapAnalysis, userUrl, industryContext]);
const handleContinue = async () => {
// Save research preferences to backend before continuing
try {
const researchData = getResearchData();
// Extract research preferences for saving (use defaults if not available)
const researchPreferences = {
research_depth: 'Comprehensive',
content_types: ['blog_posts', 'social_media'],
auto_research: true,
factual_content: true
};
// Save research preferences to backend
await aiApiClient.post('/api/ai-research/configure-preferences', {
research_depth: researchPreferences.research_depth,
content_types: researchPreferences.content_types,
auto_research: researchPreferences.auto_research,
factual_content: researchPreferences.factual_content
});
console.log('Research preferences saved to backend');
} catch (error) {
console.error('Error saving research preferences:', error);
// Continue anyway - don't block user progress for save errors
}
// Continue with wizard navigation
onContinue(getResearchData());
};
// Expose data collection function to parent (only when onDataReady changes)
useEffect(() => {

View File

@@ -15,22 +15,13 @@ import {
ListItem,
ListItemIcon,
ListItemText,
Alert,
LinearProgress
Alert
} from '@mui/material';
import {
Search as SearchIcon,
Analytics as AnalyticsIcon,
TrendingUp as TrendingIcon,
Speed as SpeedIcon,
Security as SecurityIcon,
CheckCircle as CheckIcon,
Schedule as ScheduleIcon,
Rocket as RocketIcon,
DataUsage as DataIcon,
Compare as CompareIcon,
Insights as InsightsIcon,
Assessment as AssessmentIcon
Insights as InsightsIcon
} from '@mui/icons-material';
export const ComingSoonSection: React.FC = () => {

View File

@@ -1,5 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useAuth } from '@clerk/clerk-react';
import {
Box,
Fade,
@@ -17,19 +16,7 @@ import {
// Platform Icons
Web as WordPressIcon,
Web as WixIcon,
Google as GoogleIcon,
// Status Icons
CheckCircle as CheckIcon,
Error as ErrorIcon,
Info as InfoIcon,
Launch as LaunchIcon,
Security as SecurityIcon,
Verified as VerifiedIcon,
Schedule as ScheduleIcon,
TrendingUp as TrendingUpIcon,
Email as EmailIcon,
Business as BusinessIcon,
Notifications as NotificationsIcon
Google as GoogleIcon
} from '@mui/icons-material';
// Import refactored components
@@ -59,12 +46,11 @@ interface IntegrationPlatform {
}
const IntegrationsStep: React.FC<IntegrationsStepProps> = ({ onContinue, updateHeaderContent }) => {
const { getToken } = useAuth();
const [email, setEmail] = useState<string>('');
// Use custom hooks
const { gscSites, connectedPlatforms, setConnectedPlatforms, setGscSites, handleGSCConnect } = useGSCConnection();
const { isLoading, showToast, setShowToast, toastMessage, setToastMessage, handleConnect } = usePlatformConnections();
const { gscSites, connectedPlatforms, setConnectedPlatforms, handleGSCConnect } = useGSCConnection();
const { isLoading, showToast, setShowToast, toastMessage, handleConnect } = usePlatformConnections();
// Initialize integrations data
const [integrations] = useState<IntegrationPlatform[]>([
@@ -211,6 +197,7 @@ const IntegrationsStep: React.FC<IntegrationsStepProps> = ({ onContinue, updateH
// Remove query parameters from URL
window.history.replaceState({}, document.title, window.location.pathname);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// Get user email from Clerk
@@ -255,6 +242,7 @@ const IntegrationsStep: React.FC<IntegrationsStepProps> = ({ onContinue, updateH
const userEmail = getUserEmail();
setEmail(userEmail);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const handlePlatformConnect = async (platformId: string) => {

View File

@@ -15,22 +15,12 @@ import {
ListItem,
ListItemIcon,
ListItemText,
Divider,
Alert,
LinearProgress
Alert
} from '@mui/material';
import {
AutoAwesome as AutoAwesomeIcon,
ContentPaste as ContentIcon,
Psychology as PsychologyIcon,
TrendingUp as TrendingIcon,
Security as SecurityIcon,
Speed as SpeedIcon,
CheckCircle as CheckIcon,
Schedule as ScheduleIcon,
Rocket as RocketIcon,
DataUsage as DataIcon,
Tune as TuneIcon,
SmartToy as SmartToyIcon
} from '@mui/icons-material';

View File

@@ -5,10 +5,8 @@
import React from 'react';
import {
Box,
Typography,
Card,
CardContent,
LinearProgress,
Stepper,
Step,

View File

@@ -17,26 +17,18 @@ import {
Alert,
Button,
Slide,
Zoom,
Divider
Zoom
} from '@mui/material';
import { useTheme, alpha } from '@mui/material/styles';
import {
ExpandMore as ExpandMoreIcon,
CheckCircle as CheckIcon,
Info as InfoIcon,
Psychology as PsychologyIcon,
TrendingUp as TrendingUpIcon,
Analytics as AnalyticsIcon,
Business as BusinessIcon,
AutoAwesome as AutoAwesomeIcon,
Star as StarIcon,
Warning as WarningIcon,
Language as LanguageIcon,
Web as WebIcon,
Palette as PaletteIcon,
Speed as SpeedIcon,
Group as GroupIcon
Warning as WarningIcon
} from '@mui/icons-material';
/**

View File

@@ -110,7 +110,6 @@ const Wizard: React.FC<WizardProps> = ({ onComplete }) => {
// Use refs to avoid dependency cycles
const stepDataRef = useRef(stepData);
const competitorDataCollectorRef = useRef(competitorDataCollector);
const personaStepRef = useRef<{ handleContinue: () => void } | null>(null);
// Keep refs in sync with state
useEffect(() => {

View File

@@ -10,10 +10,9 @@ import {
Tooltip
} from '@mui/material';
import {
Google as GoogleIcon,
Refresh as RefreshIcon
} from '@mui/icons-material';
import { gscAPI, type GSCSite } from '../../../api/gsc';
import { type GSCSite } from '../../../api/gsc';
interface GSCPlatformCardProps {
platform: {

View File

@@ -17,7 +17,6 @@ import {
} from '@mui/material';
import {
Web as WixIcon,
Add as AddIcon,
CheckCircle as CheckCircleIcon,
Error as ErrorIcon,
Refresh as RefreshIcon

View File

@@ -15,7 +15,6 @@ import {
DialogTitle,
DialogContent,
DialogActions,
Alert,
CircularProgress,
IconButton,
Tooltip,
@@ -27,12 +26,10 @@ import {
} from '@mui/material';
import {
Web as WordPressIcon,
Add as AddIcon,
Delete as DeleteIcon,
CheckCircle as CheckCircleIcon,
Error as ErrorIcon,
Refresh as RefreshIcon,
Launch as LaunchIcon
Refresh as RefreshIcon
} from '@mui/icons-material';
import { useWordPressOAuth } from '../../../hooks/useWordPressOAuth';