merge: resolve conflicts favoring local for frontend packages
This commit is contained in:
@@ -868,6 +868,66 @@ class ContentPlanningAPI {
|
||||
const url = `${this.baseURL}/enhanced-strategies/stream/ai-generation-status?strategy_id=${strategyId}`;
|
||||
return new EventSource(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate data for a specific category using CopilotKit
|
||||
*/
|
||||
async generateCategoryData(category: string, userDescription: string, currentFormData: any) {
|
||||
try {
|
||||
const response = await apiClient.post('/api/content-planning/strategy/generate-category-data', {
|
||||
category,
|
||||
userDescription,
|
||||
currentFormData
|
||||
});
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response?.data?.detail || 'Failed to generate category data');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a specific strategy field using CopilotKit
|
||||
*/
|
||||
async validateField(fieldId: string, value: any) {
|
||||
try {
|
||||
const response = await apiClient.post('/api/content-planning/strategy/validate-field', {
|
||||
fieldId,
|
||||
value
|
||||
});
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response?.data?.detail || 'Failed to validate field');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyze complete strategy using CopilotKit
|
||||
*/
|
||||
async analyzeStrategy(formData: any) {
|
||||
try {
|
||||
const response = await apiClient.post('/api/content-planning/strategy/analyze', {
|
||||
formData
|
||||
});
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response?.data?.detail || 'Failed to analyze strategy');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate suggestions for a specific field using CopilotKit
|
||||
*/
|
||||
async generateFieldSuggestions(fieldId: string, currentFormData: any) {
|
||||
try {
|
||||
const response = await apiClient.post('/api/content-planning/strategy/generate-suggestions', {
|
||||
fieldId,
|
||||
currentFormData
|
||||
});
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response?.data?.detail || 'Failed to generate suggestions');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Export singleton instance
|
||||
|
||||
@@ -220,7 +220,23 @@ class NavigationOrchestrator {
|
||||
strategicIntelligence: strategyData.strategicIntelligence || {}
|
||||
};
|
||||
|
||||
// Navigate to calendar wizard
|
||||
// Store strategy context for analytics page
|
||||
this.preserveContext('strategy', strategyContext);
|
||||
|
||||
// Navigate to analytics page first to show monitoring setup
|
||||
const navigate = this.getNavigateFunction();
|
||||
if (navigate) {
|
||||
navigate('/content-planning', {
|
||||
state: {
|
||||
activeTab: 2, // Analytics tab
|
||||
strategyContext,
|
||||
fromStrategyActivation: true,
|
||||
showMonitoringSetup: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Also preserve context for calendar wizard navigation
|
||||
this.navigateToCalendarWizard(strategyId, strategyContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { apiClient } from '../api/client';
|
||||
import { apiClient, aiApiClient } from '../api/client';
|
||||
import { useState } from 'react';
|
||||
|
||||
export interface MonitoringTask {
|
||||
@@ -154,7 +154,7 @@ export const strategyMonitoringApi = {
|
||||
*/
|
||||
async getTrendData(strategyId: number, timeRange: string = '30d'): Promise<{ success: boolean; data: any; message: string }> {
|
||||
try {
|
||||
const response = await apiClient.get(`/api/content-planning/strategy/${strategyId}/trend-data?time_range=${timeRange}`);
|
||||
const response = await aiApiClient.get(`/api/content-planning/strategy/${strategyId}/trend-data?time_range=${timeRange}`);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
console.error('Error getting trend data:', error);
|
||||
@@ -196,7 +196,7 @@ export const strategyMonitoringApi = {
|
||||
// Quality Analysis API methods
|
||||
async getQualityAnalysis(strategyId: number): Promise<{ success: boolean; data: any; message: string }> {
|
||||
try {
|
||||
const response = await apiClient.post(`/api/content-planning/quality-analysis/${strategyId}/analyze`);
|
||||
const response = await aiApiClient.post(`/api/content-planning/quality-analysis/${strategyId}/analyze`);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching quality analysis:', error);
|
||||
|
||||
Reference in New Issue
Block a user