resolvemos o problema dos ZEE e ZFI
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-07 19:46:35 +02:00
parent 0a086c3fa5
commit bdd766c68a
74 changed files with 6401 additions and 32 deletions
@@ -1,9 +1,10 @@
import { Link } from "@inertiajs/react";
import { Frame, button, card } from "./shared";
import { businessModalities } from "./business-types";
import PartnershipSourceLinks from '@/components/partnership-source-links';
type Business = {
slug: string; title: string; modality: string; objective?: string | null; stage?: string | null; activity_code?: string | null;
id: string; slug: string; title: string; modality: string; objective?: string | null; stage?: string | null; activity_code?: string | null;
amount_min?: string | null; amount_max?: string | null; available_percentage?: string | null; currency?: string | null;
province?: string | null; district?: string | null; locality?: string | null; sector?: { name: string; slug: string } | null;
};
@@ -11,6 +12,7 @@ type Business = {
export default function BusinessOpportunity({ record, returnUrl = "/negocios", interestUrl = `/negocios/${record.slug}/manifestar-interesse` }: { record: Business; returnUrl?: string; interestUrl?: string }) {
return (
<Frame title={record.title}>
<PartnershipSourceLinks type="business" id={record.id}/>
<Link href={returnUrl} className="underline">Voltar às oportunidades</Link>
<section className={`${card} space-y-4`}>
<p>{businessModalities[record.modality] ?? record.modality}</p>
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "react";
import Map from "@/components/interactive-investment-map";
import { TerritoryLevel, type TerritoryOption } from "@/components/investment-territory";
import { MATURITY_LEVELS } from "@/lib/investment-maturity";
import PartnershipSearchResults from '@/components/partnership-search-results';
import { Frame, Field, input, button, card, money, api, groupLabels } from "./shared";
import type { Opportunity, References } from "./shared";
@@ -189,6 +190,7 @@ export default function Catalogue({
<Frame
title={form.data.education ? "Oportunidades na Educação" : "Catálogo de investimento"}
>
<PartnershipSearchResults query={String(filters.q??'')}/>
<nav aria-label="Dimensões do catálogo" className="grid gap-3 sm:grid-cols-4">
<Link className={card} href={dimensionUrl("cluster")}>
Por Cluster
+8
View File
@@ -1,6 +1,8 @@
import { Link, router, usePage } from "@inertiajs/react";
import { useState } from "react";
import InvestmentMapPanel from "@/components/investment-map-panel";
import StructureGeographyPanel from '@/components/structure-geography';
import PartnershipSourceLinks from '@/components/partnership-source-links';
import { Frame, card, button, money, groupLabels } from "./shared";
import type { Opportunity, Context } from "./shared";
export default function Detail({
@@ -8,17 +10,21 @@ export default function Detail({
context: c,
zone_origin,
returnUrl = "/oportunidades",
dossierOrigin,
}: {
record: Opportunity;
context: Context;
zone_origin?: { id: string; name: string } | null;
returnUrl?: string;
dossierOrigin?: { id: string; title: string } | null;
}) {
const { auth } = usePage<{ auth: { user: unknown } }>().props;
const [sharing, setSharing] = useState("");
return (
<Frame title={r.title}>
<PartnershipSourceLinks type="investment" id={r.id}/>
<Link href={returnUrl} className="underline">Voltar à pesquisa</Link>
{dossierOrigin && <p><Link className="underline" href={`/carteira/${dossierOrigin.id}`}>Voltar ao dossier: {dossierOrigin.title}</Link></p>}
<p>
{r.reference} · {r.sector?.name} · {r.province} {r.district}
</p>
@@ -145,6 +151,7 @@ export default function Detail({
</h2>
{c[key].map((entity) => (
<p key={entity.id}>
{entity.dossiers?.map(dossier => <span key={dossier.id}><Link className="underline" href={`/carteira/${dossier.id}`}>Consultar dossier: {dossier.title}</Link><br /></span>)}
<Link
className="underline"
href={
@@ -167,6 +174,7 @@ export default function Detail({
</div>
))}
</section>
{(['projects','clusters'] as const).flatMap(key => c[key].filter(entity => entity.geography && entity.dossiers?.length).map(entity => <StructureGeographyPanel key={`${key}-${entity.id}`} geography={entity.geography!} cluster={key === 'clusters'} dossierId={entity.dossiers![0].id} />))}
<section className={card}>
<h2 className="text-xl font-bold">
Infraestruturas, competências, educação e apoios
@@ -1,5 +1,6 @@
import { Link, router, useForm } from "@inertiajs/react";
import { Frame, Field, input, button, card } from "./shared";
import PartnershipSourceLinks from '@/components/partnership-source-links';
type RecordData = { version: number; payload: Record<string, string> };
type Company = RecordData & { id: string };
@@ -47,6 +48,7 @@ export default function Profile({
</p>
{companies.map((company) => (
<section key={company.id} className={card}>
<PartnershipSourceLinks type="company" id={company.id}/>
<h3 className="text-xl font-bold">{company.payload.name}</h3>
<Editor
key={company.version}
+2 -1
View File
@@ -1,6 +1,7 @@
import { Head, Link, usePage } from "@inertiajs/react";
import type { ReactNode } from "react";
import { PortalMenu } from "@/layouts/portal-navigation";
import type { StructureGeography } from '@/components/structure-geography';
export type Option = {
id: number;
@@ -11,7 +12,7 @@ export type Option = {
requires_description: boolean;
sort_order: number;
};
export type Entity = { id: string; name: string };
export type Entity = { id: string; name: string; dossiers?: { id: string; title: string; source: string }[]; geography?: StructureGeography | null };
export type References = {
zones?: { id: string; name: string; category: string }[];
options: Option[];
+2
View File
@@ -4,6 +4,7 @@ import InvestmentMapPanel from "@/components/investment-map-panel";
import { TerritoryFields, type TerritoryOption } from "@/components/investment-territory";
import { useState } from "react";
import { Frame, Field, input, button, card, api } from "./shared";
import PartnershipSourceLinks from '@/components/partnership-source-links';
import ZoneRelations from "./zone-relations";
import ZoneMap from "./zone-map";
import ZoneAttachments from "./zone-attachments";
@@ -196,6 +197,7 @@ function Editor({
}
return (
<Frame title={z.name}>
{!management&&<PartnershipSourceLinks type="zone" id={z.id}/>}
<p>
{z.code} · {z.category.toUpperCase()} · {z.validation_status} · {z.province}{" "}
{z.district}