🚀 Auto-deploy: BrainWind atualizado em 16/07/2026 11:35:26
This commit is contained in:
@@ -65,6 +65,33 @@ function statusColor(s: CheckStatus): string {
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizeForPDF(text: string | undefined): string {
|
||||
if (!text) return '';
|
||||
return text
|
||||
.replace(/φ/g, 'phi')
|
||||
.replace(/ϕ/g, 'phi')
|
||||
.replace(/α/g, 'alpha')
|
||||
.replace(/θ/g, 'theta')
|
||||
.replace(/β/g, 'beta')
|
||||
.replace(/γ/g, 'gamma')
|
||||
.replace(/Δ/g, 'Delta')
|
||||
.replace(/—/g, '-')
|
||||
.replace(/–/g, '-')
|
||||
.replace(/“/g, '"')
|
||||
.replace(/”/g, '"')
|
||||
.replace(/‘/g, "'")
|
||||
.replace(/’/g, "'")
|
||||
.replace(/Æ/g, 'phi') // Fix specifically the one seen in user screenshot
|
||||
.replace(/≤/g, '<=')
|
||||
.replace(/≥/g, '>=')
|
||||
.replace(/≈/g, '~')
|
||||
.replace(/×/g, 'x')
|
||||
.replace(/÷/g, '/')
|
||||
.replace(/²/g, '^2')
|
||||
.replace(/³/g, '^3')
|
||||
.replace(/°/g, ' deg');
|
||||
}
|
||||
|
||||
interface ReportPDFProps {
|
||||
report: AuditReport;
|
||||
}
|
||||
@@ -119,27 +146,27 @@ function AuditReportDocument({ report }: ReportPDFProps) {
|
||||
return (
|
||||
<View key={sc.scenarioId} style={styles.scenarioItem}>
|
||||
<Text style={styles.scenarioId}>
|
||||
{sc.scenarioId} — {sc.verdict === 'PASS' ? '✓' : sc.verdict === 'WARN' ? '⚠' : '✗'} {summaryTranslated}
|
||||
{sanitizeForPDF(sc.scenarioId)} — {sc.verdict === 'PASS' ? '✓' : sc.verdict === 'WARN' ? '⚠' : '✗'} {sanitizeForPDF(summaryTranslated)}
|
||||
</Text>
|
||||
{sc.enunciado_problema && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Enunciado: {sc.enunciado_problema}</Text>
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Enunciado: {sanitizeForPDF(sc.enunciado_problema)}</Text>
|
||||
)}
|
||||
{sc.tabelas_nbr_consultadas && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Tabelas: {sc.tabelas_nbr_consultadas}</Text>
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Tabelas: {sanitizeForPDF(sc.tabelas_nbr_consultadas)}</Text>
|
||||
)}
|
||||
{sc.resultado_app && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Avaliação do App: {sc.resultado_app}</Text>
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Avaliação do App: {sanitizeForPDF(sc.resultado_app)}</Text>
|
||||
)}
|
||||
{sc.calculation_steps && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 4, fontStyle: 'italic' }}>
|
||||
CoT: {sc.calculation_steps.substring(0, 300)}{sc.calculation_steps.length > 300 ? '...' : ''}
|
||||
CoT: {sanitizeForPDF(sc.calculation_steps.substring(0, 300))}{sc.calculation_steps.length > 300 ? '...' : ''}
|
||||
</Text>
|
||||
)}
|
||||
{sc.checks.map((chk, i) => (
|
||||
<View key={i} style={styles.checkRow}>
|
||||
<Text style={[styles.statusBadge, { color: statusColor(chk.status) }]}>{chk.status}</Text>
|
||||
<Text style={styles.checkLabel}>{chk.name}</Text>
|
||||
<Text style={styles.checkValue}>{chk.actual} ({chk.expected})</Text>
|
||||
<Text style={styles.checkLabel}>{sanitizeForPDF(chk.name)}</Text>
|
||||
<Text style={styles.checkValue}>{sanitizeForPDF(chk.actual)} ({sanitizeForPDF(chk.expected)})</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user