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:
@@ -113,19 +113,19 @@ const CompanyWiki: React.FC = () => {
|
||||
<div className="text-sm text-[--text-secondary]">Employees</div>
|
||||
</div>
|
||||
<div className="text-center p-4 bg-[--background-secondary] rounded-lg">
|
||||
<div className="text-2xl font-bold text-green-500">{companyReport.overview.departmentBreakdown.length}</div>
|
||||
<div className="text-2xl font-bold text-green-500">{companyReport.overview?.departmentBreakdown?.length || 0}</div>
|
||||
<div className="text-sm text-[--text-secondary]">Departments</div>
|
||||
</div>
|
||||
<div className="text-center p-4 bg-[--background-secondary] rounded-lg">
|
||||
<div className="text-2xl font-bold text-purple-500">{companyReport.organizationalStrengths.length}</div>
|
||||
<div className="text-2xl font-bold text-purple-500">{companyReport.organizationalStrengths?.length || 0}</div>
|
||||
<div className="text-sm text-[--text-secondary]">Strength Areas</div>
|
||||
</div>
|
||||
<div className="text-center p-4 bg-[--background-secondary] rounded-lg">
|
||||
<div className="text-2xl font-bold text-orange-500">{companyReport.organizationalRisks.length}</div>
|
||||
<div className="text-2xl font-bold text-orange-500">{companyReport.organizationalRisks?.length || 0}</div>
|
||||
<div className="text-sm text-[--text-secondary]">Risks</div>
|
||||
</div>
|
||||
</div>
|
||||
{companyReport.gradingOverview && (
|
||||
{(Array.isArray(companyReport.gradingOverview) && companyReport.gradingOverview.length > 0) && (
|
||||
<div className="mt-6 p-4 bg-[--background-tertiary] rounded-lg">
|
||||
<RadarPerformanceChart
|
||||
title="Organizational Grading"
|
||||
@@ -142,13 +142,13 @@ const CompanyWiki: React.FC = () => {
|
||||
<Card>
|
||||
<h4 className="text-lg font-semibold text-[--text-primary] mb-3">Strengths</h4>
|
||||
<ul className="space-y-2">
|
||||
{companyReport.organizationalStrengths.map((s: any, i) => <li key={i} className="text-[--text-secondary] text-sm">• {s.area}</li>)}
|
||||
{(companyReport.organizationalStrengths || []).map((s: any, i) => <li key={i} className="text-[--text-secondary] text-sm">• {s.area || s}</li>)}
|
||||
</ul>
|
||||
</Card>
|
||||
<Card>
|
||||
<h4 className="text-lg font-semibold text-[--text-primary] mb-3">Risks</h4>
|
||||
<ul className="space-y-2">
|
||||
{companyReport.organizationalRisks.map((r, i) => <li key={i} className="text-[--text-secondary] text-sm">• {r}</li>)}
|
||||
{(companyReport.organizationalRisks || []).map((r, i) => <li key={i} className="text-[--text-secondary] text-sm">• {r}</li>)}
|
||||
</ul>
|
||||
</Card>
|
||||
<Card>
|
||||
@@ -172,72 +172,152 @@ const CompanyWiki: React.FC = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Company Profile - Onboarding Data */}
|
||||
<Card className="mt-6">
|
||||
<h3 className="text-lg font-semibold text-[--text-primary] mb-4">Company Profile</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{/* Company Profile - Q&A Format from Onboarding */}
|
||||
<div className="mt-6">
|
||||
<h3 className="text-2xl font-semibold text-[--text-primary] mb-6">Company Profile</h3>
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
{org?.mission && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Mission</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.mission}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What is your company's mission?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.mission}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.vision && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Vision</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.vision}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What is your company's vision?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.vision}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.evolution && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Company Evolution</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.evolution}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">How has your company evolved over time?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.evolution}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.advantages && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Competitive Advantages</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.advantages}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What are your competitive advantages?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.advantages}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.vulnerabilities && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Vulnerabilities</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.vulnerabilities}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What are your key vulnerabilities?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.vulnerabilities}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.shortTermGoals && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Short Term Goals</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.shortTermGoals}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What are your short-term goals?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.shortTermGoals}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.longTermGoals && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Long Term Goals</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.longTermGoals}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What are your long-term goals?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.longTermGoals}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.cultureDescription && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Culture</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.cultureDescription}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">How would you describe your company culture?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.cultureDescription}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.workEnvironment && (
|
||||
<div>
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Work Environment</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.workEnvironment}</p>
|
||||
</div>
|
||||
<Card className="p-4">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">What is your work environment like?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.workEnvironment}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{org?.additionalContext && (
|
||||
<div className="md:col-span-2">
|
||||
<h4 className="font-medium text-[--text-primary] mb-2">Additional Context</h4>
|
||||
<p className="text-[--text-secondary] text-sm">{org.additionalContext}</p>
|
||||
</div>
|
||||
<Card className="p-4 lg:col-span-2">
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Question:</h4>
|
||||
<p className="text-[--text-primary] font-medium">Any additional context about your company?</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[--text-secondary] mb-1">Answer:</h4>
|
||||
<p className="text-[--text-primary] text-sm leading-relaxed">{org.additionalContext}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{org?.description && (
|
||||
<Card className="mt-6">
|
||||
|
||||
Reference in New Issue
Block a user