Consolida rastreabilidade territorial e plano autenticado V2
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Link, router, useForm, usePage } from '@inertiajs/react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import Map from '@/components/interactive-investment-map';
|
||||
import type { InvestmentMapArea } from '@/components/interactive-investment-map';
|
||||
import {
|
||||
TerritoryLevel,
|
||||
type TerritoryOption,
|
||||
@@ -57,6 +58,7 @@ export default function Catalogue({
|
||||
q: String(filters.q ?? ''),
|
||||
dimension: String(filters.dimension ?? ''),
|
||||
view: String(filters.view ?? 'grid'),
|
||||
territory_basis: String(filters.territory_basis ?? 'all'),
|
||||
sector: String(filters.sector ?? ''),
|
||||
province: String(filters.province ?? ''),
|
||||
district: String(filters.district ?? ''),
|
||||
@@ -91,6 +93,7 @@ export default function Catalogue({
|
||||
const [selected, setSelected] = useState<number[]>([]);
|
||||
const [comparison, setComparison] = useState<{ record: Opportunity }[]>([]);
|
||||
const [points, setPoints] = useState<Feature[] | null>(null);
|
||||
const [areas, setAreas] = useState<InvestmentMapArea[]>([]);
|
||||
const [unlocated, setUnlocated] = useState<
|
||||
{ id: number; title: string; location: string; url: string }[]
|
||||
>([]);
|
||||
@@ -147,6 +150,7 @@ export default function Catalogue({
|
||||
);
|
||||
}
|
||||
setPoints(null);
|
||||
setAreas([]);
|
||||
setUnlocated([]);
|
||||
setTruncated(false);
|
||||
setError('');
|
||||
@@ -154,6 +158,7 @@ export default function Catalogue({
|
||||
.then((data) => {
|
||||
if (active) {
|
||||
setPoints(data.features);
|
||||
setAreas(data.areas ?? []);
|
||||
setUnlocated(data.unlocated ?? []);
|
||||
setTruncated(Boolean(data.truncated));
|
||||
}
|
||||
@@ -551,6 +556,26 @@ export default function Catalogue({
|
||||
/>
|
||||
</Field>
|
||||
</section>
|
||||
<Field label="Base da relação territorial">
|
||||
<select
|
||||
className={input}
|
||||
value={form.data.territory_basis}
|
||||
onChange={(e) =>
|
||||
form.setData('territory_basis', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="all">
|
||||
Implantação e contexto associado
|
||||
</option>
|
||||
<option value="direct">
|
||||
Implantação declarada da oportunidade
|
||||
</option>
|
||||
<option value="context">
|
||||
Apenas contexto associado; implantação por
|
||||
documentar
|
||||
</option>
|
||||
</select>
|
||||
</Field>
|
||||
<label className="flex gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -1060,7 +1085,7 @@ export default function Catalogue({
|
||||
</Link>
|
||||
</div>
|
||||
{error && <p role="alert">{error}</p>}
|
||||
{!error && <Map points={points} />}
|
||||
{!error && <Map points={points} areas={areas} />}
|
||||
{truncated && (
|
||||
<p role="alert">
|
||||
O mapa atingiu o limite de 1.000 registos; refine os
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
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 StructureGeographyPanel, {
|
||||
LocationList,
|
||||
} from '@/components/structure-geography';
|
||||
import PartnershipSourceLinks from '@/components/partnership-source-links';
|
||||
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({
|
||||
@@ -48,11 +51,31 @@ export default function Detail({
|
||||
</p>
|
||||
)}
|
||||
<p className="text-xl">{r.summary}</p>
|
||||
<TerritorialSources sources={c.source_evidence} />
|
||||
<section className={card + ' space-y-3'}>
|
||||
<h2 className="text-xl font-bold">
|
||||
Implantação declarada da oportunidade
|
||||
</h2>
|
||||
<p>
|
||||
As relações cadastradas não confirmam disponibilidade ou
|
||||
capacidade. Locais dos projetos associados, áreas de impacto
|
||||
e abrangência dos clusters são apresentados separadamente.
|
||||
</p>
|
||||
<LocationList locations={c.opportunity_locations ?? []} />
|
||||
{!c.opportunity_locations?.length && (
|
||||
<p>
|
||||
Implantação estruturada não documentada. O contexto
|
||||
associado abaixo não confirma onde a oportunidade será
|
||||
implantada.
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
<InvestmentMapPanel filters={{ opportunity_id: r.id }} />
|
||||
{c.primary_territory_path &&
|
||||
c.primary_territory_path.length > 0 && (
|
||||
<p>
|
||||
Localização:{' '}
|
||||
Território principal cadastrado (implantação por
|
||||
confirmar):{' '}
|
||||
{c.primary_territory_path
|
||||
.map((node) => node.name)
|
||||
.join(' → ')}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
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';
|
||||
import type { TerritorialSourceEvidence } from '@/components/territorial-source-evidence';
|
||||
import type {
|
||||
StructureGeography,
|
||||
DocumentedLocation,
|
||||
} from '@/components/structure-geography';
|
||||
|
||||
export type Option = {
|
||||
id: number;
|
||||
@@ -47,6 +51,8 @@ export type Opportunity = {
|
||||
last_validated_at?: string | null;
|
||||
};
|
||||
export type Context = {
|
||||
source_evidence?: TerritorialSourceEvidence[];
|
||||
opportunity_locations?: DocumentedLocation[];
|
||||
primary_territory_path?: {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -8,6 +8,9 @@ import {
|
||||
import { useState } from 'react';
|
||||
import { Frame, Field, input, button, card, api } from './shared';
|
||||
import PartnershipSourceLinks from '@/components/partnership-source-links';
|
||||
import TerritorialSources, {
|
||||
type TerritorialSourceEvidence,
|
||||
} from '@/components/territorial-source-evidence';
|
||||
import ZoneRelations from './zone-relations';
|
||||
import ZoneMap from './zone-map';
|
||||
import ZoneAttachments from './zone-attachments';
|
||||
@@ -124,6 +127,7 @@ type Props = {
|
||||
validation_status: string;
|
||||
}[];
|
||||
record: Zone;
|
||||
territorialSources?: TerritorialSourceEvidence[];
|
||||
management: boolean;
|
||||
zoneExtensionsAvailable?: boolean;
|
||||
source: Source | null;
|
||||
@@ -186,6 +190,7 @@ function Editor({
|
||||
relations,
|
||||
geometries,
|
||||
record: z,
|
||||
territorialSources,
|
||||
management,
|
||||
zoneExtensionsAvailable = false,
|
||||
source,
|
||||
@@ -268,6 +273,7 @@ function Editor({
|
||||
}
|
||||
return (
|
||||
<Frame title={z.name}>
|
||||
<TerritorialSources sources={territorialSources} />
|
||||
{!management && <PartnershipSourceLinks type="zone" id={z.id} />}
|
||||
<p>
|
||||
{z.code} · {z.category.toUpperCase()} · {z.validation_status} ·{' '}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Link, useForm } from '@inertiajs/react';
|
||||
import { Management } from './shared';
|
||||
import TerritorialTraceabilityPlan, {
|
||||
type TraceabilityPlan,
|
||||
} from '@/components/territorial-traceability-plan';
|
||||
|
||||
type Plan = {
|
||||
target: { database: string; port: number };
|
||||
@@ -149,16 +152,21 @@ export default function RelationshipRepair({
|
||||
territorial,
|
||||
history,
|
||||
unproposed,
|
||||
traceability,
|
||||
}: {
|
||||
hash: string;
|
||||
plan: Plan;
|
||||
territorial: Territory[];
|
||||
history: History[];
|
||||
unproposed: Unproposed[];
|
||||
traceability?: TraceabilityPlan | null;
|
||||
}) {
|
||||
const form = useForm({ hash });
|
||||
return (
|
||||
<Management title="Associações documentadas de projectos âncora e clusters">
|
||||
{traceability && (
|
||||
<TerritorialTraceabilityPlan preview={traceability} />
|
||||
)}
|
||||
<p>
|
||||
Pré-visualização para {plan.target.database}:{plan.target.port}.
|
||||
A execução verifica o backup e o restauro, a versão dos dossiers
|
||||
|
||||
Reference in New Issue
Block a user