Implement comprehensive report system with detailed viewing and AI enhancements
- Add detailed report viewing with full-screen ReportDetail component for both company and employee reports - Fix company wiki to display onboarding Q&A in card format matching Figma designs - Exclude company owners from employee submission counts (owners contribute to wiki, not employee data) - Fix employee report generation to include company context (wiki + company report + employee answers) - Fix company report generation to use filtered employee submissions only - Add proper error handling for submission data format variations - Update Firebase functions to use gpt-4o model instead of deprecated gpt-4.1 - Fix UI syntax errors and improve report display functionality - Add comprehensive logging for debugging report generation flow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useOrg } from '../contexts/OrgContext';
|
||||
import { Card, Button } from '../components/UiKit';
|
||||
@@ -48,6 +48,13 @@ interface OnboardingData {
|
||||
const Onboarding: React.FC = () => {
|
||||
const { org, upsertOrg, generateCompanyWiki } = useOrg();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (org?.onboardingCompleted) {
|
||||
navigate('/reports', { replace: true });
|
||||
}
|
||||
}, [org, navigate]);
|
||||
|
||||
const [step, setStep] = useState(0);
|
||||
const [isGeneratingReport, setIsGeneratingReport] = useState(false);
|
||||
const [formData, setFormData] = useState<OnboardingData>({
|
||||
@@ -152,7 +159,7 @@ const Onboarding: React.FC = () => {
|
||||
console.log('Org data saved successfully');
|
||||
|
||||
console.log('Generating company wiki...');
|
||||
await generateCompanyWiki(newOrgData);
|
||||
await generateCompanyWiki({ ...newOrgData, orgId: org!.orgId });
|
||||
console.log('Company wiki generated successfully');
|
||||
|
||||
// Small delay to ensure states are updated, then redirect
|
||||
@@ -674,7 +681,7 @@ const Onboarding: React.FC = () => {
|
||||
|
||||
{/* Progress indicator */}
|
||||
<div className="mb-8">
|
||||
<FigmaProgress
|
||||
<FigmaProgress
|
||||
currentStep={step + 1}
|
||||
steps={steps.map((s, i) => ({ number: i + 1, title: s.title }))}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user