@@ -3,7 +3,10 @@ import { Management } from '../management/shared';
|
||||
import type { Paginated } from '../management/shared';
|
||||
import { Layout, Field, control, button, Pagination, kind } from './shared';
|
||||
import type { Dossier } from './shared';
|
||||
import { TerritoryFields, type TerritoryOption } from '@/components/investment-territory';
|
||||
import {
|
||||
TerritoryFields,
|
||||
type TerritoryOption,
|
||||
} from '@/components/investment-territory';
|
||||
export default function Index({
|
||||
records,
|
||||
management,
|
||||
@@ -12,10 +15,24 @@ export default function Index({
|
||||
}: {
|
||||
records: Paginated<Dossier>;
|
||||
management: boolean;
|
||||
filters: { q?: string; kind?: string; province_id?: string; district_id?: string; admin_post_id?: string; locality_id?: string };
|
||||
filters: {
|
||||
q?: string;
|
||||
kind?: string;
|
||||
province_id?: string;
|
||||
district_id?: string;
|
||||
admin_post_id?: string;
|
||||
locality_id?: string;
|
||||
};
|
||||
territorySelection?: TerritoryOption[];
|
||||
}) {
|
||||
const form = useForm({ q: filters.q ?? '', kind: filters.kind ?? '', province_id: filters.province_id ?? '', district_id: filters.district_id ?? '', admin_post_id: filters.admin_post_id ?? '', locality_id: filters.locality_id ?? '' });
|
||||
const form = useForm({
|
||||
q: filters.q ?? '',
|
||||
kind: filters.kind ?? '',
|
||||
province_id: filters.province_id ?? '',
|
||||
district_id: filters.district_id ?? '',
|
||||
admin_post_id: filters.admin_post_id ?? '',
|
||||
locality_id: filters.locality_id ?? '',
|
||||
});
|
||||
const base = management ? '/management/portfolio' : '/carteira';
|
||||
const Frame = management ? Management : Layout;
|
||||
return (
|
||||
@@ -57,7 +74,18 @@ export default function Index({
|
||||
<option value="project">Projectos âncora</option>
|
||||
</select>
|
||||
</Field>
|
||||
<TerritoryFields initial={territorySelection} onChange={(path) => form.setData((current) => ({ ...current, province_id: path[0]?.id ?? '', district_id: path[1]?.id ?? '', admin_post_id: path[2]?.id ?? '', locality_id: path[3]?.id ?? '' }))} />
|
||||
<TerritoryFields
|
||||
initial={territorySelection}
|
||||
onChange={(path) =>
|
||||
form.setData((current) => ({
|
||||
...current,
|
||||
province_id: path[0]?.id ?? '',
|
||||
district_id: path[1]?.id ?? '',
|
||||
admin_post_id: path[2]?.id ?? '',
|
||||
locality_id: path[3]?.id ?? '',
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<button className={button}>Pesquisar</button>
|
||||
</form>
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
@@ -84,7 +112,12 @@ export default function Index({
|
||||
r.content.focus ??
|
||||
r.content.anchors}
|
||||
</p>
|
||||
{(r.content.location || r.content.region) && <p>Localização: {r.content.location ?? r.content.region}</p>}
|
||||
{(r.content.location || r.content.region) && (
|
||||
<p>
|
||||
Localização:{' '}
|
||||
{r.content.location ?? r.content.region}
|
||||
</p>
|
||||
)}
|
||||
{r.content.priority && (
|
||||
<p>
|
||||
{r.content.priority}{' '}
|
||||
@@ -101,12 +134,28 @@ export default function Index({
|
||||
</div>
|
||||
{!records.data.length && (
|
||||
<div className="space-y-3 rounded-xl border p-5" role="status">
|
||||
<p>Ainda não existem fichas publicadas para esta pesquisa. Os filtros activos foram mantidos.</p>
|
||||
<p>Esta lista contém dossiers territoriais documentados; não representa concursos abertos nem confirma disponibilidade de infra-estruturas ou incentivos.</p>
|
||||
<nav aria-label="Alternativas de exploração" className="flex flex-wrap gap-4">
|
||||
<Link className="underline" href="/oportunidades">Ver oportunidades publicadas</Link>
|
||||
<Link className="underline" href="/zonas">Consultar ZEE, ZFI e parques</Link>
|
||||
<Link className="underline" href="/Simulador">Transformar uma ideia num projecto</Link>
|
||||
<p>
|
||||
Ainda não existem fichas publicadas para esta pesquisa.
|
||||
Os filtros activos foram mantidos.
|
||||
</p>
|
||||
<p>
|
||||
Esta lista contém dossiers territoriais documentados;
|
||||
não representa concursos abertos nem confirma
|
||||
disponibilidade de infra-estruturas ou incentivos.
|
||||
</p>
|
||||
<nav
|
||||
aria-label="Alternativas de exploração"
|
||||
className="flex flex-wrap gap-4"
|
||||
>
|
||||
<Link className="underline" href="/oportunidades">
|
||||
Ver oportunidades publicadas
|
||||
</Link>
|
||||
<Link className="underline" href="/zonas">
|
||||
Consultar ZEE, ZFI e parques
|
||||
</Link>
|
||||
<Link className="underline" href="/Simulador">
|
||||
Transformar uma ideia num projecto
|
||||
</Link>
|
||||
</nav>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Head, Link, usePage } from "@inertiajs/react";
|
||||
import type { ReactNode } from "react";
|
||||
export { button, control, Field, Pagination } from "../management/shared";
|
||||
import { Head, Link, usePage } from '@inertiajs/react';
|
||||
import type { ReactNode } from 'react';
|
||||
export { button, control, Field, Pagination } from '../management/shared';
|
||||
export type Dossier = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -13,30 +13,41 @@ export type Dossier = {
|
||||
version_no?: number;
|
||||
};
|
||||
export const labels: Record<string, string> = {
|
||||
description: "Visão e proposta de valor",
|
||||
location: "Território",
|
||||
region: "Região",
|
||||
sector: "Sector",
|
||||
promotion: "Promoção",
|
||||
facts: "Dados indicativos da fonte",
|
||||
partners: "Investidores e parceiros",
|
||||
cta: "Próxima acção",
|
||||
anchors: "Projectos âncora e oportunidades",
|
||||
gaps: "Lacunas da cadeia de valor",
|
||||
priority: "Prioridade proposta na matriz",
|
||||
clusters: "Clusters associados",
|
||||
focus: "Investimentos complementares",
|
||||
notice: "Estado de validação",
|
||||
code: "Código",
|
||||
description: 'Visão e proposta de valor',
|
||||
location: 'Território',
|
||||
region: 'Região',
|
||||
sector: 'Sector',
|
||||
promotion: 'Promoção',
|
||||
facts: 'Dados indicativos da fonte',
|
||||
partners: 'Investidores e parceiros',
|
||||
cta: 'Próxima acção',
|
||||
anchors: 'Projectos âncora e oportunidades',
|
||||
gaps: 'Lacunas da cadeia de valor',
|
||||
priority: 'Prioridade proposta na matriz',
|
||||
clusters: 'Clusters associados',
|
||||
focus: 'Investimentos complementares',
|
||||
notice: 'Estado de validação',
|
||||
code: 'Código',
|
||||
};
|
||||
export const kind = (r: Pick<Dossier, "project_id" | "cluster_id" | "corridor_id">) =>
|
||||
r.corridor_id ? "Corredor" : r.cluster_id ? "Cluster" : "Projecto âncora";
|
||||
export function Layout({ title, children }: { title: string; children: ReactNode }) {
|
||||
export const kind = (
|
||||
r: Pick<Dossier, 'project_id' | 'cluster_id' | 'corridor_id'>,
|
||||
) =>
|
||||
r.corridor_id ? 'Corredor' : r.cluster_id ? 'Cluster' : 'Projecto âncora';
|
||||
export function Layout({
|
||||
title,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const { flash } = usePage<{ flash?: { success?: string } }>().props;
|
||||
return (
|
||||
<main className="mx-auto w-full min-w-0 max-w-6xl space-y-6 break-words p-4 md:p-8">
|
||||
<main className="mx-auto w-full max-w-6xl min-w-0 space-y-6 p-4 break-words md:p-8">
|
||||
<Head title={title} />
|
||||
<nav className="flex flex-wrap gap-5 text-sm underline" aria-label="Investimento">
|
||||
<nav
|
||||
className="flex flex-wrap gap-5 text-sm underline"
|
||||
aria-label="Investimento"
|
||||
>
|
||||
<Link href="/">InvestMoz</Link>
|
||||
<Link href="/carteira?kind=corridor">Corredores</Link>
|
||||
<Link href="/carteira?kind=cluster">Clusters</Link>
|
||||
|
||||
@@ -1,19 +1,34 @@
|
||||
import { Link, useForm, router, usePage } from "@inertiajs/react";
|
||||
import { useState } from "react";
|
||||
import InvestmentMapPanel from "@/components/investment-map-panel";
|
||||
import StructureGeographyPanel, { type StructureGeography } from '@/components/structure-geography';
|
||||
import { Link, useForm, router, usePage } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import InvestmentMapPanel from '@/components/investment-map-panel';
|
||||
import StructureGeographyPanel, {
|
||||
type StructureGeography,
|
||||
} from '@/components/structure-geography';
|
||||
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 { Management } from '../management/shared';
|
||||
import { Layout, Field, control, button, labels, kind } from './shared';
|
||||
import type { Dossier } from './shared';
|
||||
export default function Show(props: Props) {
|
||||
return <Editor key={`${props.record.id}:${props.record.version_no ?? 0}`} {...props} />;
|
||||
return (
|
||||
<Editor
|
||||
key={`${props.record.id}:${props.record.version_no ?? 0}`}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type Props = {
|
||||
geography: StructureGeography;
|
||||
existingSubmissions?: { id: string; version: number; updated_at: string }[];
|
||||
anchorProject?: { code: string; name: string; status: string; budget_amount: string | null; budget_currency: string | null; start_date: string | null; end_date: string | null } | null;
|
||||
anchorProject?: {
|
||||
code: string;
|
||||
name: string;
|
||||
status: string;
|
||||
budget_amount: string | null;
|
||||
budget_currency: string | null;
|
||||
start_date: string | null;
|
||||
end_date: string | null;
|
||||
} | null;
|
||||
zones?: {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -25,7 +40,12 @@ type Props = {
|
||||
related: Dossier[];
|
||||
management: boolean;
|
||||
origin: { id: string; title: string } | null;
|
||||
opportunities?: { id: number; title: string; slug: string; summary: string }[];
|
||||
opportunities?: {
|
||||
id: number;
|
||||
title: string;
|
||||
slug: string;
|
||||
summary: string;
|
||||
}[];
|
||||
chains?: { id: string; name: string; stage: string }[];
|
||||
};
|
||||
|
||||
@@ -49,53 +69,122 @@ function Editor({
|
||||
content: record.content,
|
||||
version_no: record.version_no,
|
||||
});
|
||||
const approval = useForm({ approval_evidence: "", version_no: record.version_no });
|
||||
const approval = useForm({
|
||||
approval_evidence: '',
|
||||
version_no: record.version_no,
|
||||
});
|
||||
const save = useForm({ origin_id: origin?.id ?? null });
|
||||
const Frame = management ? Management : Layout;
|
||||
const base = management ? "/management/portfolio" : "/carteira";
|
||||
const base = management ? '/management/portfolio' : '/carteira';
|
||||
return (
|
||||
<Frame title={record.title}>
|
||||
<p>
|
||||
{kind(record)} · {record.content.code}
|
||||
</p>
|
||||
<p className="text-sm">Fonte: {record.source}</p>
|
||||
{(record.project_id||record.cluster_id)&&<PartnershipSourceLinks type={record.project_id?'project':'cluster'} id={record.project_id??record.cluster_id!}/>}
|
||||
{(record.project_id || record.cluster_id) && <StructureGeographyPanel geography={geography} cluster={Boolean(record.cluster_id)} dossierId={record.id} />}
|
||||
{(record.project_id || record.cluster_id) && (
|
||||
<PartnershipSourceLinks
|
||||
type={record.project_id ? 'project' : 'cluster'}
|
||||
id={record.project_id ?? record.cluster_id!}
|
||||
/>
|
||||
)}
|
||||
{(record.project_id || record.cluster_id) && (
|
||||
<StructureGeographyPanel
|
||||
geography={geography}
|
||||
cluster={Boolean(record.cluster_id)}
|
||||
dossierId={record.id}
|
||||
/>
|
||||
)}
|
||||
{anchorProject && (
|
||||
<section className="space-y-2 rounded-xl border p-5" aria-labelledby="anchor-project-heading">
|
||||
<h2 id="anchor-project-heading" className="text-xl font-bold">Referência de projecto âncora</h2>
|
||||
<p>{anchorProject.code} · {anchorProject.name}</p>
|
||||
<p>Estado registado: {{ draft: "rascunho", planned: "previsto", active: "em execução", suspended: "suspenso", completed: "concluído", cancelled: "cancelado" }[anchorProject.status] ?? "por confirmar"}.</p>
|
||||
{anchorProject.budget_amount && <p>Investimento estimado documentado: {anchorProject.budget_amount} {anchorProject.budget_currency}</p>}
|
||||
{(anchorProject.start_date || anchorProject.end_date) && <p>Calendário registado: {anchorProject.start_date ?? "início não indicado"} – {anchorProject.end_date ?? "fim não indicado"}</p>}
|
||||
<p>Esta é uma referência de planeamento. Não significa concurso aberto, disponibilidade imediata ou convite à apresentação de propostas.</p>
|
||||
<section
|
||||
className="space-y-2 rounded-xl border p-5"
|
||||
aria-labelledby="anchor-project-heading"
|
||||
>
|
||||
<h2
|
||||
id="anchor-project-heading"
|
||||
className="text-xl font-bold"
|
||||
>
|
||||
Referência de projecto âncora
|
||||
</h2>
|
||||
<p>
|
||||
{anchorProject.code} · {anchorProject.name}
|
||||
</p>
|
||||
<p>
|
||||
Estado registado:{' '}
|
||||
{{
|
||||
draft: 'rascunho',
|
||||
planned: 'previsto',
|
||||
active: 'em execução',
|
||||
suspended: 'suspenso',
|
||||
completed: 'concluído',
|
||||
cancelled: 'cancelado',
|
||||
}[anchorProject.status] ?? 'por confirmar'}
|
||||
.
|
||||
</p>
|
||||
{anchorProject.budget_amount && (
|
||||
<p>
|
||||
Investimento estimado documentado:{' '}
|
||||
{anchorProject.budget_amount}{' '}
|
||||
{anchorProject.budget_currency}
|
||||
</p>
|
||||
)}
|
||||
{(anchorProject.start_date || anchorProject.end_date) && (
|
||||
<p>
|
||||
Calendário registado:{' '}
|
||||
{anchorProject.start_date ?? 'início não indicado'}{' '}
|
||||
– {anchorProject.end_date ?? 'fim não indicado'}
|
||||
</p>
|
||||
)}
|
||||
<p>
|
||||
Esta é uma referência de planeamento. Não significa
|
||||
concurso aberto, disponibilidade imediata ou convite à
|
||||
apresentação de propostas.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
{record.project_id && !anchorProject && (
|
||||
<section className="space-y-2 rounded-xl border p-5" aria-labelledby="anchor-status-pending-heading">
|
||||
<h2 id="anchor-status-pending-heading" className="text-xl font-bold">Referência de projecto âncora</h2>
|
||||
<p>O estado de execução e o investimento não estão confirmados num registo publicável. A referência do dossier não representa concurso aberto nem disponibilidade imediata.</p>
|
||||
<section
|
||||
className="space-y-2 rounded-xl border p-5"
|
||||
aria-labelledby="anchor-status-pending-heading"
|
||||
>
|
||||
<h2
|
||||
id="anchor-status-pending-heading"
|
||||
className="text-xl font-bold"
|
||||
>
|
||||
Referência de projecto âncora
|
||||
</h2>
|
||||
<p>
|
||||
O estado de execução e o investimento não estão
|
||||
confirmados num registo publicável. A referência do
|
||||
dossier não representa concurso aberto nem
|
||||
disponibilidade imediata.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
{!management && (record.cluster_id || record.corridor_id || record.project_id) && (
|
||||
<InvestmentMapPanel
|
||||
filters={
|
||||
record.cluster_id
|
||||
? { cluster_id: record.cluster_id }
|
||||
: record.corridor_id
|
||||
? { corridor_id: record.corridor_id }
|
||||
: { project_id: record.project_id! }
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{!management &&
|
||||
(record.cluster_id ||
|
||||
record.corridor_id ||
|
||||
record.project_id) && (
|
||||
<InvestmentMapPanel
|
||||
filters={
|
||||
record.cluster_id
|
||||
? { cluster_id: record.cluster_id }
|
||||
: record.corridor_id
|
||||
? { corridor_id: record.corridor_id }
|
||||
: { project_id: record.project_id! }
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{zones.length > 0 && (
|
||||
<section>
|
||||
<h2 className="text-xl font-bold">ZEE, ZFI e parques relacionados</h2>
|
||||
<h2 className="text-xl font-bold">
|
||||
ZEE, ZFI e parques relacionados
|
||||
</h2>
|
||||
{zones.map((z) => (
|
||||
<p key={z.id}>
|
||||
<Link className="underline" href={`/zonas/${z.id}`}>
|
||||
{z.name}
|
||||
</Link>{" "}
|
||||
</Link>{' '}
|
||||
· {z.association_type} · Fonte: {z.source_reference}
|
||||
</p>
|
||||
))}
|
||||
@@ -104,12 +193,35 @@ function Editor({
|
||||
{origin && <p>Exploração iniciada em: {origin.title}</p>}
|
||||
{!management && auth.user && (
|
||||
<div className="space-y-2 rounded-xl border p-4">
|
||||
<p>As manifestações ficam privadas até uma submissão separada. A referência não copia nem publica o dossier público no seu nome.</p>
|
||||
<p>
|
||||
As manifestações ficam privadas até uma submissão
|
||||
separada. A referência não copia nem publica o dossier
|
||||
público no seu nome.
|
||||
</p>
|
||||
{existingSubmissions.length > 0 && (
|
||||
<section className="space-y-2" aria-label="Manifestações em rascunho para esta ficha">
|
||||
<h2 className="font-semibold">Continuar um rascunho existente</h2>
|
||||
{existingSubmissions.map((submission) => <Link key={submission.id} className="block underline" href={`/investidor/manifestacoes/${submission.id}`}>Continuar rascunho actualizado em {new Date(submission.updated_at).toLocaleDateString("pt-MZ")}</Link>)}
|
||||
<p>Ou crie outra manifestação privada. Os rascunhos não serão fundidos.</p>
|
||||
<section
|
||||
className="space-y-2"
|
||||
aria-label="Manifestações em rascunho para esta ficha"
|
||||
>
|
||||
<h2 className="font-semibold">
|
||||
Continuar um rascunho existente
|
||||
</h2>
|
||||
{existingSubmissions.map((submission) => (
|
||||
<Link
|
||||
key={submission.id}
|
||||
className="block underline"
|
||||
href={`/investidor/manifestacoes/${submission.id}`}
|
||||
>
|
||||
Continuar rascunho actualizado em{' '}
|
||||
{new Date(
|
||||
submission.updated_at,
|
||||
).toLocaleDateString('pt-MZ')}
|
||||
</Link>
|
||||
))}
|
||||
<p>
|
||||
Ou crie outra manifestação privada. Os rascunhos
|
||||
não serão fundidos.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
<button
|
||||
@@ -117,31 +229,52 @@ function Editor({
|
||||
className={button}
|
||||
disabled={creatingManifestation}
|
||||
onClick={() => {
|
||||
if (!window.confirm(`Criar ${existingSubmissions.length ? "outra" : "uma"} manifestação privada associada a “${record.title}”? Pode continuar a editá-la antes de submeter. Os rascunhos existentes não serão alterados.`)) return;
|
||||
if (
|
||||
!window.confirm(
|
||||
`Criar ${existingSubmissions.length ? 'outra' : 'uma'} manifestação privada associada a “${record.title}”? Pode continuar a editá-la antes de submeter. Os rascunhos existentes não serão alterados.`,
|
||||
)
|
||||
)
|
||||
return;
|
||||
setCreatingManifestation(true);
|
||||
router.post("/investidor/manifestacoes", { dossier_id: record.id }, { onFinish: () => setCreatingManifestation(false) });
|
||||
router.post(
|
||||
'/investidor/manifestacoes',
|
||||
{ dossier_id: record.id },
|
||||
{
|
||||
onFinish: () =>
|
||||
setCreatingManifestation(false),
|
||||
},
|
||||
);
|
||||
}}
|
||||
>
|
||||
{creatingManifestation ? "A preparar…" : "Preparar manifestação privada"}
|
||||
{creatingManifestation
|
||||
? 'A preparar…'
|
||||
: 'Preparar manifestação privada'}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{!management && !auth.user && (
|
||||
<p className="rounded-xl border p-4">Para associar esta referência a uma manifestação privada, entre na sua conta. Esta ficha continuará pública e não será copiada nem publicada no seu nome. <Link className="underline" href="/login">Entrar</Link></p>
|
||||
<p className="rounded-xl border p-4">
|
||||
Para associar esta referência a uma manifestação privada,
|
||||
entre na sua conta. Esta ficha continuará pública e não será
|
||||
copiada nem publicada no seu nome.{' '}
|
||||
<Link className="underline" href="/login">
|
||||
Entrar
|
||||
</Link>
|
||||
</p>
|
||||
)}
|
||||
{chains.length > 0 && (
|
||||
<section>
|
||||
<h2 className="text-xl font-bold">Cadeia de valor</h2>
|
||||
{chains.map((chain) => (
|
||||
<p key={chain.id}>
|
||||
{chain.name} —{" "}
|
||||
{chain.name} —{' '}
|
||||
{(
|
||||
{
|
||||
input: "Insumos",
|
||||
production: "Produção",
|
||||
processing: "Transformação",
|
||||
logistics: "Logística",
|
||||
market: "Mercado",
|
||||
input: 'Insumos',
|
||||
production: 'Produção',
|
||||
processing: 'Transformação',
|
||||
logistics: 'Logística',
|
||||
market: 'Mercado',
|
||||
} as Record<string, string>
|
||||
)[chain.stage] ?? chain.stage}
|
||||
</p>
|
||||
@@ -149,7 +282,9 @@ function Editor({
|
||||
</section>
|
||||
)}
|
||||
<section className="space-y-3">
|
||||
<h2 className="text-xl font-bold">Oportunidades relacionadas</h2>
|
||||
<h2 className="text-xl font-bold">
|
||||
Oportunidades relacionadas
|
||||
</h2>
|
||||
{opportunities.map((opportunity) => (
|
||||
<article key={opportunity.id}>
|
||||
<Link
|
||||
@@ -168,8 +303,8 @@ function Editor({
|
||||
{management ? (
|
||||
<>
|
||||
<p>
|
||||
Versão editorial: {record.version_no}. Guarde as alterações antes de
|
||||
publicar.
|
||||
Versão editorial: {record.version_no}. Guarde as
|
||||
alterações antes de publicar.
|
||||
</p>
|
||||
<form
|
||||
className="space-y-4"
|
||||
@@ -182,30 +317,36 @@ function Editor({
|
||||
<input
|
||||
className={control}
|
||||
value={form.data.title}
|
||||
onChange={(e) => form.setData("title", e.target.value)}
|
||||
onChange={(e) =>
|
||||
form.setData('title', e.target.value)
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Fonte e versão">
|
||||
<input
|
||||
className={control}
|
||||
value={form.data.source}
|
||||
onChange={(e) => form.setData("source", e.target.value)}
|
||||
onChange={(e) =>
|
||||
form.setData('source', e.target.value)
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
{Object.entries(form.data.content).map(([key, value]) => (
|
||||
<Field key={key} label={labels[key] ?? key}>
|
||||
<textarea
|
||||
className={control}
|
||||
value={value ?? ""}
|
||||
onChange={(e) =>
|
||||
form.setData("content", {
|
||||
...form.data.content,
|
||||
[key]: e.target.value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
))}
|
||||
{Object.entries(form.data.content).map(
|
||||
([key, value]) => (
|
||||
<Field key={key} label={labels[key] ?? key}>
|
||||
<textarea
|
||||
className={control}
|
||||
value={value ?? ''}
|
||||
onChange={(e) =>
|
||||
form.setData('content', {
|
||||
...form.data.content,
|
||||
[key]: e.target.value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
),
|
||||
)}
|
||||
{Object.entries(form.errors).map(([k, v]) => (
|
||||
<p role="alert" key={k}>
|
||||
{v}
|
||||
@@ -223,8 +364,8 @@ function Editor({
|
||||
}}
|
||||
>
|
||||
<p>
|
||||
O gestor autorizado pode aprovar e publicar esta ficha. Registe a
|
||||
referência da sua decisão.
|
||||
O gestor autorizado pode aprovar e publicar esta
|
||||
ficha. Registe a referência da sua decisão.
|
||||
</p>
|
||||
<Field label="Referência da autorização e revisão">
|
||||
<textarea
|
||||
@@ -233,14 +374,22 @@ function Editor({
|
||||
minLength={15}
|
||||
value={approval.data.approval_evidence}
|
||||
onChange={(e) =>
|
||||
approval.setData("approval_evidence", e.target.value)
|
||||
approval.setData(
|
||||
'approval_evidence',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
{approval.errors.approval_evidence && (
|
||||
<p role="alert">{approval.errors.approval_evidence}</p>
|
||||
<p role="alert">
|
||||
{approval.errors.approval_evidence}
|
||||
</p>
|
||||
)}
|
||||
<button className={button} disabled={approval.processing || form.isDirty}>
|
||||
<button
|
||||
className={button}
|
||||
disabled={approval.processing || form.isDirty}
|
||||
>
|
||||
Validar e publicar
|
||||
</button>
|
||||
</form>
|
||||
@@ -249,11 +398,15 @@ function Editor({
|
||||
<>
|
||||
<dl className="space-y-5">
|
||||
{Object.entries(record.content)
|
||||
.filter(([k]) => k !== "name" && k !== "code")
|
||||
.filter(([k]) => k !== 'name' && k !== 'code')
|
||||
.map(([key, value]) => (
|
||||
<div key={key}>
|
||||
<dt className="font-semibold">{labels[key] ?? key}</dt>
|
||||
<dd className="mt-1 whitespace-pre-line">{value}</dd>
|
||||
<dt className="font-semibold">
|
||||
{labels[key] ?? key}
|
||||
</dt>
|
||||
<dd className="mt-1 whitespace-pre-line">
|
||||
{value}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
@@ -266,54 +419,73 @@ function Editor({
|
||||
<button className={button} disabled={save.processing}>
|
||||
Guardar no painel e preparar interesse
|
||||
</button>
|
||||
<p className="mt-2 text-sm">Acesso com conta e email verificado.</p>
|
||||
<p className="mt-2 text-sm">
|
||||
Acesso com conta e email verificado.
|
||||
</p>
|
||||
</form>
|
||||
</>
|
||||
)}
|
||||
<section className="space-y-3">
|
||||
<h2 className="text-xl font-semibold">Percurso de execução</h2>
|
||||
<ol className="list-decimal space-y-2 pl-6">
|
||||
<li>Explore as relações entre corredor, cluster e projecto âncora.</li>
|
||||
<li>
|
||||
Consulte as componentes, parceiros e oportunidades de participação da ficha.
|
||||
Explore as relações entre corredor, cluster e projecto
|
||||
âncora.
|
||||
</li>
|
||||
<li>
|
||||
Guarde a ficha no painel do investidor e manifeste interesse com o papel e
|
||||
prazo pretendidos.
|
||||
Consulte as componentes, parceiros e oportunidades de
|
||||
participação da ficha.
|
||||
</li>
|
||||
<li>
|
||||
Guarde a ficha no painel do investidor e manifeste
|
||||
interesse com o papel e prazo pretendidos.
|
||||
</li>
|
||||
<li>
|
||||
A equipa acompanha o pedido no CRM, com responsável e
|
||||
próxima acção.
|
||||
</li>
|
||||
<li>A equipa acompanha o pedido no CRM, com responsável e próxima acção.</li>
|
||||
</ol>
|
||||
{management && (
|
||||
<div className="flex flex-wrap gap-4 underline">
|
||||
{record.project_id && (
|
||||
<Link href={`/management/projects/${record.project_id}/edit`}>
|
||||
<Link
|
||||
href={`/management/projects/${record.project_id}/edit`}
|
||||
>
|
||||
Gerir projecto
|
||||
</Link>
|
||||
)}
|
||||
{record.cluster_id && (
|
||||
<Link href={`/management/clusters/${record.cluster_id}/edit`}>
|
||||
<Link
|
||||
href={`/management/clusters/${record.cluster_id}/edit`}
|
||||
>
|
||||
Gerir cadeias e lacunas do cluster
|
||||
</Link>
|
||||
)}
|
||||
<Link href="/management/interests">Acompanhar pedidos</Link>
|
||||
{record.publication_status === "published" && (
|
||||
<Link href={`/carteira/${record.id}`}>Abrir ficha pública</Link>
|
||||
<Link href="/management/interests">
|
||||
Acompanhar pedidos
|
||||
</Link>
|
||||
{record.publication_status === 'published' && (
|
||||
<Link href={`/carteira/${record.id}`}>
|
||||
Abrir ficha pública
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<h2 className="text-xl font-semibold">Relações na carteira</h2>
|
||||
{related.map((r) => (
|
||||
<p key={r.id}>
|
||||
{kind(r)}:{" "}
|
||||
{kind(r)}:{' '}
|
||||
<Link
|
||||
className="underline"
|
||||
href={`${base}/${r.id}${management ? "" : `?from=${record.id}`}`}
|
||||
href={`${base}/${r.id}${management ? '' : `?from=${record.id}`}`}
|
||||
>
|
||||
{r.title}
|
||||
</Link>
|
||||
</p>
|
||||
))}
|
||||
{!related.length && <p>Sem relações disponíveis para consulta.</p>}
|
||||
{!related.length && (
|
||||
<p>Sem relações disponíveis para consulta.</p>
|
||||
)}
|
||||
</section>
|
||||
</Frame>
|
||||
);
|
||||
|
||||
@@ -31,6 +31,12 @@ function JourneyCard({ journey }: { journey: Journey }) {
|
||||
)}
|
||||
</h2>
|
||||
<p className="text-sm break-all">Jornada: {journey.id}</p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/balcao-virtual/painel?journey_id=${journey.id}`}
|
||||
>
|
||||
Acompanhar este percurso e preparar um pedido de apoio
|
||||
</Link>
|
||||
{journey.reference ? (
|
||||
<>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user