Implement Stage 3: Enhance content generation and metadata features
- Updated AI prompts to include metadata context, cluster roles, and product attributes for improved content generation. - Enhanced GenerateContentFunction to incorporate taxonomy and keyword objects for richer context. - Introduced new metadata fields in frontend components for better content organization and filtering. - Added cluster match, taxonomy match, and relevance score to LinkResults for improved link management. - Implemented metadata completeness scoring and recommended actions in AnalysisPreview for better content optimization. - Updated API services to support new metadata structures and site progress tracking.
This commit is contained in:
@@ -17,7 +17,8 @@ import PageMeta from '../../components/common/PageMeta';
|
||||
import { Card } from '../../components/ui/card';
|
||||
import Button from '../../components/ui/button/Button';
|
||||
import { useToast } from '../../components/ui/toast/ToastContainer';
|
||||
import { fetchAPI } from '../../services/api';
|
||||
import { fetchAPI, fetchSiteBlueprints } from '../../services/api';
|
||||
import SiteProgressWidget from '../../components/sites/SiteProgressWidget';
|
||||
|
||||
interface Site {
|
||||
id: number;
|
||||
@@ -51,6 +52,7 @@ export default function SiteDashboard() {
|
||||
const toast = useToast();
|
||||
const [site, setSite] = useState<Site | null>(null);
|
||||
const [stats, setStats] = useState<SiteStats | null>(null);
|
||||
const [blueprints, setBlueprints] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -62,9 +64,10 @@ export default function SiteDashboard() {
|
||||
const loadSiteData = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const [siteData, statsData] = await Promise.all([
|
||||
const [siteData, statsData, blueprintsData] = await Promise.all([
|
||||
fetchAPI(`/v1/auth/sites/${siteId}/`),
|
||||
fetchSiteStats(),
|
||||
fetchSiteBlueprints({ site_id: Number(siteId) }),
|
||||
]);
|
||||
|
||||
if (siteData) {
|
||||
@@ -74,6 +77,10 @@ export default function SiteDashboard() {
|
||||
if (statsData) {
|
||||
setStats(statsData);
|
||||
}
|
||||
|
||||
if (blueprintsData && blueprintsData.results) {
|
||||
setBlueprints(blueprintsData.results);
|
||||
}
|
||||
} catch (error: any) {
|
||||
toast.error(`Failed to load site data: ${error.message}`);
|
||||
} finally {
|
||||
@@ -207,6 +214,19 @@ export default function SiteDashboard() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Stage 3: Site Progress Widget */}
|
||||
{blueprints.length > 0 && (
|
||||
<div className="mb-6">
|
||||
{blueprints.map((blueprint) => (
|
||||
<SiteProgressWidget
|
||||
key={blueprint.id}
|
||||
blueprintId={blueprint.id}
|
||||
siteId={Number(siteId)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Stats Grid */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6">
|
||||
{statCards.map((stat, index) => (
|
||||
|
||||
Reference in New Issue
Block a user