Link documented investment complements to existing fiches and dossier context
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from '@/lib/investor-context';
|
||||
import { inheritCompatibleFields } from '@/lib/context-inheritance';
|
||||
import OpportunityChoices from './investment-opportunity-choices';
|
||||
import { SelectedComplements } from './investment-complements';
|
||||
type Props = {
|
||||
contextId?: string | null;
|
||||
consumer: 'simulator' | 'land' | 'desk' | 'submission';
|
||||
@@ -145,6 +146,7 @@ export function DossierPrefill(props: Props) {
|
||||
)}
|
||||
{message && <p role="status">{message}</p>}
|
||||
{consumer === 'simulator' && !!view.context.opportunity_choices?.length && <OpportunityChoices choices={view.context.opportunity_choices}/>}
|
||||
<SelectedComplements items={view.context.complements ?? []}/>
|
||||
{Object.entries(view.context.selection)
|
||||
.filter(([slot]) => consumer !== 'simulator' || !view.context.opportunity_choices?.length || !['opportunity', 'territory'].includes(slot))
|
||||
.map(([, r]) =>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
import { complementPreparationHref } from '@/lib/search-territory';
|
||||
import { useState } from 'react';
|
||||
import { createOperationKey } from '@/lib/operation-key';
|
||||
|
||||
export function ComplementEntryActions({target}: {target: string}) {
|
||||
const {url} = usePage();
|
||||
const href = complementPreparationHref(url,target);
|
||||
return href ? <Link className="block rounded border p-3 underline" href={href}>Seleccionar este complemento e continuar no dossier de origem</Link> : null;
|
||||
}
|
||||
|
||||
type Offer = {key: string; title: string; href: string; location?: string};
|
||||
export type Complement = {
|
||||
key: string; code: string; title: string; kind: 'opportunity' | 'service' | 'need';
|
||||
origin: Offer; target: Offer | null; territory_id: string | null;
|
||||
territory?: {title: string} | null;
|
||||
source: string; excerpt: string; source_sha256: string;
|
||||
availability?: 'review_required';
|
||||
};
|
||||
export type ComplementOption = Omit<Complement, 'key' | 'kind' | 'target'> & {opportunities: Offer[]; services: Offer[]};
|
||||
export const complementInput = (item: Complement) => ({origin: item.origin.key, code: item.code, target: item.target?.key ?? null, territory_id: item.territory_id});
|
||||
|
||||
export function SelectedComplements({items, onRemove}: {items: Complement[]; onRemove?: (key: string) => void}) {
|
||||
if (!items.length) return null;
|
||||
return <section className="space-y-3 rounded-xl border p-4" aria-label="Complementos escolhidos">
|
||||
<h2 className="text-xl font-bold">Complementos escolhidos no dossier</h2>
|
||||
{items.map(item => <article key={item.key} className="space-y-1">
|
||||
<h3 className="font-semibold">{item.title} · {item.kind === 'need' ? 'Necessidade complementar — ideia em preparação' : item.kind === 'service' ? 'Serviço ou instrumento' : 'Oportunidade cadastrada'}</h3>
|
||||
<p>Investimento de origem: <Link className="underline" href={item.origin.href}>{item.origin.title}</Link></p>
|
||||
<p>Localização da preparação: {item.territory?.title ?? 'Por definir'}</p>
|
||||
{item.target && <Link className="block underline" href={item.target.href}>Abrir ficha: {item.target.title}</Link>}
|
||||
{item.availability === 'review_required' && <p role="status">A oferta ou a referência mudou. Relação anterior conservada para revisão; consulte as opções actuais antes de a utilizar.</p>}
|
||||
<p className="text-sm">Fonte: {item.source} · Trecho: {item.excerpt}</p>
|
||||
{onRemove && <button type="button" className="underline" onClick={() => onRemove(item.key)}>Retirar esta relação da preparação</button>}
|
||||
</article>)}
|
||||
</section>;
|
||||
}
|
||||
|
||||
export default function InvestmentComplements({items, dossierId, onNavigate}: {items: ComplementOption[]; dossierId?: string; onNavigate?: (href: string) => void}) {
|
||||
const [selectionKey] = useState(createOperationKey);
|
||||
if (!items.length) return null;
|
||||
const prepare = (item: ComplementOption, target?: Offer) => {
|
||||
const query = new URLSearchParams({complement_origin: item.origin.key, complement_code: item.code});
|
||||
if (target) query.set('complement_target', target.key);
|
||||
if (item.territory_id) query.set('complement_territory', item.territory_id);
|
||||
if (dossierId) query.set('selection_key', selectionKey);
|
||||
return (dossierId ? `/investimentos/${dossierId}/contexto/editar` : '/investimentos/iniciar')+'?'+query;
|
||||
};
|
||||
const consult = (item: ComplementOption, offer: Offer) => {
|
||||
const query = prepare(item,offer).split('?')[1];
|
||||
return offer.href+'?'+query+(dossierId ? '&investment_dossier='+encodeURIComponent(dossierId) : '');
|
||||
};
|
||||
return <section className="space-y-4 rounded-xl border p-4" aria-label="Investimentos e serviços complementares">
|
||||
<h2 className="text-xl font-bold">Investimentos e serviços complementares</h2>
|
||||
<p>Escolha os complementos relevantes para o seu investimento. A localização e as condições de cada ficha conservam-se.</p>
|
||||
{items.map(item => <article className="space-y-2 border-t pt-3" key={item.origin.key+item.code+(item.territory_id ?? '')}>
|
||||
<h3 className="font-semibold">{item.title}</h3>
|
||||
<p>Investimento de origem: {item.origin.title} · {item.territory?.title ?? 'Localização por definir'}</p>
|
||||
<p className="text-sm">Referência: {item.source} · Trecho: {item.excerpt}</p>
|
||||
{[...item.opportunities, ...item.services].map(offer => <div key={offer.key} className="space-y-1">
|
||||
<p><Link className="underline" href={consult(item,offer)} onClick={event => {if(onNavigate){event.preventDefault();onNavigate(consult(item,offer));}}}>{offer.title}</Link> · {offer.location}</p>
|
||||
<Link className="block underline" href={prepare(item, offer)} onClick={event => {if(onNavigate){event.preventDefault();onNavigate(prepare(item,offer));}}}>Seleccionar esta {offer.key.startsWith('opportunity:') ? 'oportunidade' : 'oferta'} para o dossier</Link>
|
||||
</div>)}
|
||||
{!item.opportunities.length && !item.services.length && <>
|
||||
<p>Necessidade complementar referida; sem oferta cadastrada identificada nas relações deste contexto.</p>
|
||||
<Link className="underline" href={prepare(item)} onClick={event => {if(onNavigate){event.preventDefault();onNavigate(prepare(item));}}}>Iniciar preparação de uma ideia de {item.title.toLocaleLowerCase('pt-MZ')}</Link>
|
||||
</>}
|
||||
</article>)}
|
||||
</section>;
|
||||
}
|
||||
@@ -56,6 +56,7 @@ export type OpportunityChoice = {
|
||||
source_sha256?: string | null;
|
||||
};
|
||||
export type DossierContext = {
|
||||
complements?: import('@/components/investment-complements').Complement[];
|
||||
requirements_assessment?: RequirementsAssessment;
|
||||
opportunity_choices?: OpportunityChoice[];
|
||||
revision: number;
|
||||
@@ -98,6 +99,7 @@ export type ContextView = {
|
||||
notice: string;
|
||||
};
|
||||
export type ContextPlan = {
|
||||
complements?: import('@/components/investment-complements').Complement[];
|
||||
requirements_assessment?: RequirementsAssessment;
|
||||
opportunity_choices?: OpportunityChoice[];
|
||||
private_investment?: { before: Preparation; after: Preparation } | null;
|
||||
|
||||
@@ -691,6 +691,11 @@ export function buildProjectDossierRows(
|
||||
if (draft.context_applicability_snapshot) {
|
||||
try {
|
||||
const context = JSON.parse(String(draft.context_applicability_snapshot));
|
||||
if (context.version === 1 && Array.isArray(context.complements)) for (const item of context.complements) {
|
||||
if (typeof item?.title !== 'string' || typeof item?.origin?.title !== 'string') continue;
|
||||
rows.push(['Localização', 'Complemento escolhido', item.title, `Origem: ${item.origin.title}; ${item.kind === 'need' ? 'necessidade complementar em preparação' : item.kind === 'service' ? 'serviço/instrumento' : 'oportunidade cadastrada'}`]);
|
||||
if (typeof item.target?.title === 'string') rows.push(['Localização', 'Ficha complementar', item.target.title, item.target.href ?? 'Referência guardada']);
|
||||
}
|
||||
if (context.version === 1 && Array.isArray(context.opportunity_choices)) for (const choice of context.opportunity_choices) {
|
||||
if (typeof choice?.opportunity?.title !== 'string') continue;
|
||||
rows.push(['Localização', 'Oportunidade escolhida', choice.opportunity.title, 'Referência escolhida no mesmo dossier']);
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
const levels = ['province_id', 'district_id', 'admin_post_id', 'locality_id'];
|
||||
const searchRoutes = ['/carteira', '/oportunidades', '/zonas', '/educacao'];
|
||||
|
||||
/** Preserve an explicit complementary selection while consulting its canonical public fiche. */
|
||||
export function complementPreparationHref(pageUrl: string, target?: string): string | null {
|
||||
const params = new URL(pageUrl, 'https://portal.invalid').searchParams;
|
||||
if (!params.get('complement_origin') || !params.get('complement_code') || (target && params.get('complement_target') !== target)) return null;
|
||||
const query = new URLSearchParams();
|
||||
for (const field of ['complement_origin', 'complement_code', 'complement_target', 'complement_territory', 'selection_key']) if(params.get(field)) query.set(field,params.get(field)!);
|
||||
const dossier = params.get('investment_dossier');
|
||||
return (dossier && /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(dossier) ? `/investimentos/${dossier}/contexto/editar` : '/investimentos/iniciar')+'?'+query;
|
||||
}
|
||||
|
||||
/** Carry the explicitly consulted portfolio origin and search geography into the existing preparation entry. */
|
||||
export function investmentPreparationHref(opportunity: number, pageUrl: string, origin?: string | null): string {
|
||||
const complementary = complementPreparationHref(pageUrl, `opportunity:${opportunity}`);
|
||||
if (complementary) return complementary;
|
||||
const source = new URL(pageUrl, 'https://portal.invalid');
|
||||
const inherited = source.searchParams.has('catalogue_query') ? new URLSearchParams(source.searchParams.get('catalogue_query')!) : source.searchParams;
|
||||
const query = new URLSearchParams({source: `opportunity:${opportunity}`});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import EducationalGuides from '@/components/educational-guides';
|
||||
import InvestmentComplements, { type ComplementOption } from '@/components/investment-complements';
|
||||
import { searchTerritoryHref, investmentPreparationHref } from '@/lib/search-territory';
|
||||
import type { EducationalArticle } from '@/components/educational-article-card';
|
||||
import { ClassificationSummary } from '@/components/opportunity-classification';
|
||||
@@ -13,6 +14,7 @@ import TerritorialSources from '@/components/territorial-source-evidence';
|
||||
import { Frame, card, button, money, groupLabels } from './shared';
|
||||
import type { Opportunity, Context } from './shared';
|
||||
export default function Detail({
|
||||
complements = [],
|
||||
guides = [],
|
||||
record: r,
|
||||
context: c,
|
||||
@@ -20,6 +22,7 @@ export default function Detail({
|
||||
returnUrl = '/oportunidades',
|
||||
dossierOrigin,
|
||||
}: {
|
||||
complements?: ComplementOption[];
|
||||
guides?: EducationalArticle[];
|
||||
record: Opportunity;
|
||||
context: Context;
|
||||
@@ -57,6 +60,7 @@ export default function Detail({
|
||||
{r.reference} · {r.sector?.name} · {r.province} {r.district}
|
||||
</p>
|
||||
<p className="text-xl">{r.summary}</p>
|
||||
<InvestmentComplements items={complements}/>
|
||||
<ClassificationSummary rows={c.classification ?? []} />
|
||||
<TerritorialSources sources={c.source_evidence} />
|
||||
<section className={card + ' space-y-3'}>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import { SelectedComplements, type Complement } from '@/components/investment-complements';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { Frame, card, input, button } from '@/pages/investment/shared';
|
||||
@@ -10,23 +11,26 @@ export default function ContextStart({
|
||||
opportunityChoices = [],
|
||||
step = null,
|
||||
entryQuery = {},
|
||||
entryComplements = [],
|
||||
}: {
|
||||
contexts: { id: string; title: string; version: number }[];
|
||||
source: ContextReference | null;
|
||||
opportunityChoices?: OpportunityChoice[];
|
||||
step?: string | null;
|
||||
entryQuery?: Record<string, string>;
|
||||
entryComplements?: Complement[];
|
||||
}) {
|
||||
const [chosen, setChosen] = useState('');
|
||||
const [title, setTitle] = useState(source?.title ?? opportunityChoices[0]?.opportunity.title ?? '');
|
||||
const [title, setTitle] = useState(entryComplements[0]?.kind === 'need' ? `Preparação de ${entryComplements[0].title} — ${entryComplements[0].origin.title}`.slice(0,200) : source?.title ?? opportunityChoices[0]?.opportunity.title ?? '');
|
||||
const [consent, setConsent] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const [key] = useState(createOperationKey);
|
||||
const sourceSuffix = opportunityChoices.length ? '?' + opportunityChoices.map(c => `opportunities[]=${encodeURIComponent(c.opportunity.id)}`).join('&') : source ? '?source=' + encodeURIComponent(source.key) : '';
|
||||
const suffix = sourceSuffix ? sourceSuffix+'&selection_key='+encodeURIComponent(key)+'&'+new URLSearchParams(entryQuery).toString() : '';
|
||||
const suffix = sourceSuffix || Object.keys(entryQuery).length ? (sourceSuffix || '?')+(sourceSuffix ? '&' : '')+'selection_key='+encodeURIComponent(key)+'&'+new URLSearchParams(entryQuery).toString() : '';
|
||||
return (
|
||||
<Frame title="Iniciar ou continuar um investimento">
|
||||
<SelectedComplements items={entryComplements}/>
|
||||
{!!opportunityChoices.length && <section className={card}><h2 className="font-bold">Oportunidades escolhidas</h2><ul>{opportunityChoices.map(c => <li key={c.opportunity.key}><Link className="underline" href={c.opportunity.href}>{c.opportunity.title}</Link> · {c.territory?.title ?? 'Localização por escolher'}{c.portfolio_origins?.map(origin=><p key={origin.id}>Associação escolhida: <Link className="underline" href={origin.href}>{origin.title}</Link></p>)}</li>)}</ul><p>Confirme a localização de cada ficha na comparação do dossier. Ao continuar um dossier, as escolhas já guardadas conservam-se.</p></section>}
|
||||
<p>
|
||||
Ideia, oportunidade, sector e localização convergem no mesmo
|
||||
|
||||
@@ -3,7 +3,8 @@ import {
|
||||
PreparationImpact,
|
||||
} from '@/components/private-investment-preparation';
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import InvestmentComplements, { SelectedComplements, complementInput, type Complement, type ComplementOption } from '@/components/investment-complements';
|
||||
import { Link, router } from '@inertiajs/react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Frame, button, card, input } from '@/pages/investment/shared';
|
||||
import {
|
||||
@@ -39,6 +40,7 @@ export default function ContextEditor({
|
||||
draft = null,
|
||||
entrySources = [],
|
||||
entryLocationDifferences = [],
|
||||
entryComplements = [],
|
||||
}: {
|
||||
initial: ContextView;
|
||||
options: Options;
|
||||
@@ -46,12 +48,34 @@ export default function ContextEditor({
|
||||
territorySelection?: TerritoryOption[];
|
||||
requestedChoices?: OpportunityChoice[] | null;
|
||||
entrySources?: string[];
|
||||
entryComplements?: Complement[];
|
||||
entryLocationDifferences?: {title:string;saved:string;requested:string}[];
|
||||
draft?: {draft_sequence?:number;needs_review?:boolean;selection?:Partial<Record<Slot,string>>;declarations?:Record<string,string>;replace_fields?:string[];document_links?:Record<string,string|null>}|null;
|
||||
}) {
|
||||
const navigation = useNavigationContext();
|
||||
const [complements, setComplements] = useState<Complement[]>(entryComplements);
|
||||
const [complementOptions, setComplementOptions] = useState<ComplementOption[]>([]);
|
||||
const [complementError, setComplementError] = useState('');
|
||||
const [choices, setChoices] = useState<OpportunityChoice[]>(requestedChoices ?? initial.context.opportunity_choices ?? []);
|
||||
const [manageChoices, setManageChoices] = useState(requestedChoices !== null || !!initial.context.opportunity_choices?.length);
|
||||
const complementContexts = JSON.stringify([...choices.flatMap(c => [{origin:c.opportunity.key, territory_id:c.territory?.id ?? null}, ...(c.portfolio_origins ?? []).map(p => ({origin:'portfolio:'+p.id,territory_id:c.territory?.id ?? null}))]), ...complements.filter(c => c.origin.key.startsWith('portfolio:')).map(c => ({origin:c.origin.key,territory_id:c.territory_id}))].filter((c,i,all) => all.findIndex(other => other.origin === c.origin && other.territory_id === c.territory_id) === i));
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
setComplementError(''); setComplementOptions([]);
|
||||
const contexts = JSON.parse(complementContexts) as {origin:string;territory_id:string|null}[];
|
||||
const load = async () => {
|
||||
const items: ComplementOption[] = [];
|
||||
const issues: string[] = [];
|
||||
for(let index=0;index<contexts.length;index+=100) {
|
||||
const result = await contextApi<{items:ComplementOption[];issues:{message:string}[]}>('/complementos-investimento', {contexts:contexts.slice(index,index+100)});
|
||||
items.push(...result.items);issues.push(...result.issues.map(issue => issue.message));
|
||||
if(!active) return;
|
||||
}
|
||||
if(active) {setComplementOptions(items);setComplementError([...new Set(issues)].join(' '));}
|
||||
};
|
||||
void load().catch(e => {if(active) setComplementError(e.message);});
|
||||
return () => {active=false;};
|
||||
}, [complementContexts]);
|
||||
const [view, setView] = useState(initial);
|
||||
const [preparation, setPreparation] = useState(initial.private_investment);
|
||||
const [options, setOptions] = useState(initialOptions);
|
||||
@@ -97,7 +121,7 @@ export default function ContextEditor({
|
||||
}).catch(e=>{if(active)setCorridorError(e.message)}).finally(()=>{if(active)setCorridorLoading(false)});
|
||||
return()=>{active=false};
|
||||
},[firstCorridor,firstTerritory,corridorRetry]);
|
||||
const draftBody=JSON.stringify({entry_sources:entrySources,version:view.case.version,selection:changes,declarations,replace_fields:replace,document_links:documentLinks,
|
||||
const draftBody=JSON.stringify({complements:complements.map(complementInput),entry_sources:entrySources,version:view.case.version,selection:changes,declarations,replace_fields:replace,document_links:documentLinks,
|
||||
...(manageChoices?{opportunity_choices:choices.map(c=>({source:c.opportunity.key,portfolio_origins:(c.portfolio_origins??[]).map(r=>r.id),corridor_key:c.corridor_key,territory:c.territory?.key??null,location_reason:c.location_reason,confirm_location_change:!!c.confirm_location_change,activities:c.activities??[]}))}:{})});
|
||||
const latestDraft=useRef(draftBody);latestDraft.current=draftBody;
|
||||
const skipNextDraft=useRef(false);
|
||||
@@ -167,6 +191,7 @@ export default function ContextEditor({
|
||||
setError('');
|
||||
setMessage('');
|
||||
const body = {
|
||||
complements: complements.map(complementInput),
|
||||
...(manageChoices ? {opportunity_choices: choices.map(c => ({source:c.opportunity.key,portfolio_origins:(c.portfolio_origins??[]).map(r=>r.id),corridor_key:c.corridor_key,territory:c.territory?.key ?? null,location_reason:c.location_reason,confirm_location_change:!!c.confirm_location_change,activities:c.activities??[]}))} : {}),
|
||||
version: view.case.version,
|
||||
selection: changes,
|
||||
@@ -215,6 +240,7 @@ export default function ContextEditor({
|
||||
window.history.replaceState(window.history.state, '', `/investimentos/${view.case.id}/contexto/editar${window.location.hash}`);
|
||||
setView(next);
|
||||
setChoices(next.context.opportunity_choices ?? []);
|
||||
setComplements(next.context.complements ?? []);
|
||||
setPreparation(next.private_investment);
|
||||
navigation.refresh();
|
||||
setChanges({});
|
||||
@@ -249,6 +275,18 @@ export default function ContextEditor({
|
||||
{view.case.title}
|
||||
</p>
|
||||
<p>Confirme as oportunidades e a localização, complete os dados disponíveis e reveja antes de guardar.</p>
|
||||
<SelectedComplements items={complements} onRemove={busy ? undefined : key => {setComplements(items => items.filter(item => item.key !== key));setPlan(null);}}/>
|
||||
{complementError && <p role="alert">{complementError} As escolhas anteriores foram conservadas.</p>}
|
||||
<InvestmentComplements items={complementOptions} dossierId={view.case.id} onNavigate={async href => {
|
||||
if(busy) return;
|
||||
setBusy(true);setError('');
|
||||
try {
|
||||
await queue.current.catch(()=>{});
|
||||
await contextApi('/investimentos/'+view.case.id+'/contexto/rascunho', {...JSON.parse(latestDraft.current), draft_sequence:++sequence.current.value}, 'POST');
|
||||
router.visit(href);
|
||||
} catch(e) {setError(e instanceof Error ? e.message : 'Não foi possível conservar as escolhas antes de abrir o complemento.');}
|
||||
finally {setBusy(false);}
|
||||
}}/>
|
||||
{!!entryLocationDifferences.length && <aside className="rounded border border-amber-500 p-3" aria-label="Localização anterior conservada">{entryLocationDifferences.map(row=><p key={row.title}>{row.title}: a localização recebida ({row.requested}) não substituiu a escolha guardada ({row.saved}). Pode rever a localização abaixo antes de confirmar.</p>)}</aside>}
|
||||
{error && (
|
||||
<div
|
||||
@@ -642,6 +680,7 @@ export default function ContextEditor({
|
||||
Comparação antes da confirmação
|
||||
</h2>
|
||||
{!!plan.opportunity_choices?.length && <OpportunityChoices choices={plan.opportunity_choices}/>}
|
||||
<SelectedComplements items={plan.complements ?? []}/>
|
||||
<InvestmentRequirements assessment={plan.requirements_assessment} contextId={view.case.id}/>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[36rem] table-fixed text-left">
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
type Preparation,
|
||||
} from '@/components/private-investment-preparation';
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import { SelectedComplements } from '@/components/investment-complements';
|
||||
import InvestmentRequirements from '@/components/investment-requirements';
|
||||
import OpportunityChoices from '@/components/investment-opportunity-choices';
|
||||
import type { DossierContext } from '@/lib/investor-context';
|
||||
@@ -531,6 +532,7 @@ export default function InvestmentPath(path: Path) {
|
||||
/>
|
||||
)}
|
||||
{!!path.investment_context?.opportunity_choices?.length && <OpportunityChoices choices={path.investment_context.opportunity_choices}/>}
|
||||
<SelectedComplements items={path.investment_context?.complements ?? []}/>
|
||||
<InvestmentRequirements assessment={path.investment_context?.requirements_assessment} contextId={path.case.id} excludedSteps={path.steps.filter((step) => !step.preparation_allowed).map((step) => step.code)}/>
|
||||
{!!path.content_sources?.length && (
|
||||
<section
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Link, useForm, usePage } from '@inertiajs/react';
|
||||
import { ComplementEntryActions } from '@/components/investment-complements';
|
||||
import StructureGeographyPanel, {
|
||||
type StructureGeography,
|
||||
} from '@/components/structure-geography';
|
||||
@@ -478,6 +479,7 @@ export default function Detail(p: Props) {
|
||||
const { auth } = usePage<{ auth: { user: unknown } }>().props;
|
||||
return (
|
||||
<Frame title={p.record.title || 'Pré-visualização da ideia'}>
|
||||
<ComplementEntryActions target={'partnership:'+p.record.id}/>
|
||||
<div className="space-y-6">
|
||||
<p>
|
||||
{p.record.partnership_type
|
||||
|
||||
@@ -10,6 +10,7 @@ import PartnershipSourceLinks from '@/components/partnership-source-links';
|
||||
import { Management } from '../management/shared';
|
||||
import { Layout, Field, control, button, labels, kind } from './shared';
|
||||
import type { Dossier } from './shared';
|
||||
import InvestmentComplements, { type ComplementOption } from '@/components/investment-complements';
|
||||
export default function Show(props: Props) {
|
||||
return (
|
||||
<Editor
|
||||
@@ -20,6 +21,7 @@ export default function Show(props: Props) {
|
||||
}
|
||||
|
||||
type Props = {
|
||||
complements?: ComplementOption[];
|
||||
geography: StructureGeography;
|
||||
existingSubmissions?: { id: string; version: number; updated_at: string }[];
|
||||
anchorProject?: {
|
||||
@@ -52,6 +54,7 @@ type Props = {
|
||||
};
|
||||
|
||||
function Editor({
|
||||
complements = [],
|
||||
record,
|
||||
related,
|
||||
management,
|
||||
@@ -200,6 +203,7 @@ function Editor({
|
||||
</section>
|
||||
)}
|
||||
{origin && <p>Exploração iniciada em: {origin.title}</p>}
|
||||
{!management && <InvestmentComplements items={complements}/>}
|
||||
{!management && auth.user && (
|
||||
<div className="space-y-2 rounded-xl border p-4">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user