fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { Link, useForm, router, usePage } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { catalogueReturnHref } from '@/lib/catalogue-context';
|
||||
import { searchTerritoryHref, portfolioPreparationHref } from '@/lib/search-territory';
|
||||
import {
|
||||
searchTerritoryHref,
|
||||
portfolioPreparationHref,
|
||||
} from '@/lib/search-territory';
|
||||
import InvestmentMapPanel from '@/components/investment-map-panel';
|
||||
import StructureGeographyPanel, {
|
||||
type StructureGeography,
|
||||
@@ -10,8 +13,12 @@ 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';
|
||||
import ClusterCompetitivenessPublic, { type ApprovedCompetitiveness } from '@/components/cluster-competitiveness-public';
|
||||
import InvestmentComplements, {
|
||||
type ComplementOption,
|
||||
} from '@/components/investment-complements';
|
||||
import ClusterCompetitivenessPublic, {
|
||||
type ApprovedCompetitiveness,
|
||||
} from '@/components/cluster-competitiveness-public';
|
||||
export default function Show(props: Props) {
|
||||
return (
|
||||
<Editor
|
||||
@@ -97,13 +104,22 @@ function Editor({
|
||||
{kind(record)} · {record.content.code}
|
||||
</p>
|
||||
<p className="text-sm">Fonte: {record.source}</p>
|
||||
{competitiveness && <ClusterCompetitivenessPublic analysis={competitiveness} />}
|
||||
{competitiveness && (
|
||||
<ClusterCompetitivenessPublic analysis={competitiveness} />
|
||||
)}
|
||||
{!management && (
|
||||
<div className="space-y-2 rounded-xl border p-4">
|
||||
<Link className="underline" href={portfolioPreparationHref(record.id, pageUrl)}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={portfolioPreparationHref(record.id, pageUrl)}
|
||||
>
|
||||
Preparar investimento a partir desta ficha
|
||||
</Link>
|
||||
<p>A ficha acompanha o dossier como origem documental. A localização do investimento e as ofertas associadas são escolhas próprias.</p>
|
||||
<p>
|
||||
A ficha acompanha o dossier como origem documental. A
|
||||
localização do investimento e as ofertas associadas são
|
||||
escolhas próprias.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{(record.project_id || record.cluster_id) && (
|
||||
@@ -206,7 +222,13 @@ function Editor({
|
||||
</h2>
|
||||
{zones.map((z) => (
|
||||
<p key={z.id}>
|
||||
<Link className="underline" href={searchTerritoryHref(`/zonas/${z.id}`, pageUrl)}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(
|
||||
`/zonas/${z.id}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
{z.name}
|
||||
</Link>{' '}
|
||||
· {z.association_type} · Fonte: {z.source_reference}
|
||||
@@ -215,7 +237,7 @@ function Editor({
|
||||
</section>
|
||||
)}
|
||||
{origin && <p>Exploração iniciada em: {origin.title}</p>}
|
||||
{!management && <InvestmentComplements items={complements}/>}
|
||||
{!management && <InvestmentComplements items={complements} />}
|
||||
{!management && auth.user && (
|
||||
<div className="space-y-2 rounded-xl border p-4">
|
||||
<p>
|
||||
@@ -282,7 +304,24 @@ function Editor({
|
||||
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={'/carteira/' + record.id + '/interesse' + (() => { const query = new URL(pageUrl, 'https://portal.invalid').searchParams.get('catalogue_query'); return query ? '?catalogue_query=' + encodeURIComponent(query) : ''; })()}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={
|
||||
'/carteira/' +
|
||||
record.id +
|
||||
'/interesse' +
|
||||
(() => {
|
||||
const query = new URL(
|
||||
pageUrl,
|
||||
'https://portal.invalid',
|
||||
).searchParams.get('catalogue_query');
|
||||
return query
|
||||
? '?catalogue_query=' +
|
||||
encodeURIComponent(query)
|
||||
: '';
|
||||
})()
|
||||
}
|
||||
>
|
||||
Entrar
|
||||
</Link>
|
||||
</p>
|
||||
@@ -314,7 +353,10 @@ function Editor({
|
||||
<article key={opportunity.id}>
|
||||
<Link
|
||||
className="font-semibold underline"
|
||||
href={searchTerritoryHref(`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`, pageUrl)}
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
{opportunity.title}
|
||||
</Link>
|
||||
@@ -502,7 +544,10 @@ function Editor({
|
||||
{kind(r)}:{' '}
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(`${base}/${r.id}${management ? '' : `?from=${record.id}`}`, pageUrl)}
|
||||
href={searchTerritoryHref(
|
||||
`${base}/${r.id}${management ? '' : `?from=${record.id}`}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
{r.title}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user