feat: add nonblocking optional narrative guidance for V14 in QA
This commit is contained in:
@@ -35,6 +35,16 @@ export function BusinessPlanWarnings({
|
||||
<p role="status">
|
||||
<span aria-hidden="true">⚠ </span>
|
||||
{warning.message}
|
||||
{warning.id === 'optional-texts' && (
|
||||
<span className="mt-1 block text-xs">
|
||||
Secções opcionais em falta:{' '}
|
||||
{metrics.optionalTexts
|
||||
?.filter((field) => !field.value.trim())
|
||||
.map((field) => field.label)
|
||||
.join(', ')}
|
||||
.
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { BusinessPlanWarnings } from './business-plan-warnings';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { DossierReportPreview } from './dossier-report-preview';
|
||||
import {
|
||||
@@ -114,6 +115,22 @@ function InvestorDossierReportsContent({
|
||||
return (
|
||||
<section id="relatorios" className="space-y-4 rounded-xl border p-4">
|
||||
<h2 className="text-lg font-semibold">Relatórios deste dossier</h2>
|
||||
{!requiresChoice && (
|
||||
<BusinessPlanWarnings
|
||||
metrics={{
|
||||
optionalTexts: [
|
||||
{
|
||||
label: 'SWOT',
|
||||
value: dossier.preparation_report?.swot.rows.some(
|
||||
(row) => row.text.trim(),
|
||||
)
|
||||
? 'preenchido'
|
||||
: '',
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<p>
|
||||
Dossier {dossier.case.title} · versão {dossier.case.version} ·
|
||||
oportunidade {dossier.context_opportunity ?? 'contexto comum'}.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { BusinessPlanWarnings } from './business-plan-warnings';
|
||||
import {
|
||||
getProjectReadiness,
|
||||
readPlannedRiskResponses,
|
||||
@@ -88,6 +89,26 @@ export function ProjectReadiness({
|
||||
className="space-y-4"
|
||||
aria-labelledby="project-readiness-title"
|
||||
>
|
||||
<BusinessPlanWarnings
|
||||
metrics={{
|
||||
optionalTexts: [
|
||||
{
|
||||
label: 'Concorrência',
|
||||
value:
|
||||
typeof draft.competitor_assumption === 'string'
|
||||
? draft.competitor_assumption
|
||||
: '',
|
||||
},
|
||||
{
|
||||
label: 'Marketing',
|
||||
value:
|
||||
typeof draft.marketing_approach === 'string'
|
||||
? draft.marketing_approach
|
||||
: '',
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>
|
||||
<div>
|
||||
<h4
|
||||
id="project-readiness-title"
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultPlanWarningLimits: PlanWarningLimits = {
|
||||
};
|
||||
export type PlanWarning = { id: string; message: string };
|
||||
export type PlanWarningMetrics = {
|
||||
optionalTexts?: { label: string; value: string }[];
|
||||
fundingGap?: number;
|
||||
currency?: string;
|
||||
netProfit?: number;
|
||||
@@ -36,6 +37,11 @@ export function businessPlanWarnings(
|
||||
): PlanWarning[] {
|
||||
const warnings: PlanWarning[] = [];
|
||||
const add = (id: string, message: string) => warnings.push({ id, message });
|
||||
if (metrics.optionalTexts?.some((field) => !field.value.trim()))
|
||||
add(
|
||||
'optional-texts',
|
||||
'Pode completar estas secções para um relatório mais convincente.',
|
||||
);
|
||||
if ((metrics.fundingGap ?? 0) > 0)
|
||||
add(
|
||||
'funding',
|
||||
|
||||
Reference in New Issue
Block a user