fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,12 +1,48 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useRef, useState } from 'react';
|
||||
import { Frame, input, button, card } from './shared';
|
||||
import { ClassificationEditor, ClassificationSummary, classificationStates, type ClassificationRelation, type ClassificationOptions, type PublicClassification } from '@/components/opportunity-classification';
|
||||
import {
|
||||
ClassificationEditor,
|
||||
ClassificationSummary,
|
||||
classificationStates,
|
||||
type ClassificationRelation,
|
||||
type ClassificationOptions,
|
||||
type PublicClassification,
|
||||
} from '@/components/opportunity-classification';
|
||||
|
||||
type ReviewRow = { hash: string; relation: ClassificationRelation; state: string; dimension: string; can_review: boolean; history: { state: string; at: string; reason: string }[] };
|
||||
type Supplement = { id: string; title: string; status: string; version_no: number; rows: ReviewRow[]; publication: PublicClassification[]; preview: PublicClassification[]; publication_version: number | null; can_prepare: boolean; can_disclose: boolean; options: ClassificationOptions; authorities: { id: string; label_pt_mz: string }[]; documents: { id: string; payload: { title?: string }; file: { file_name: string } }[] };
|
||||
type ReviewRow = {
|
||||
hash: string;
|
||||
relation: ClassificationRelation;
|
||||
state: string;
|
||||
dimension: string;
|
||||
can_review: boolean;
|
||||
history: { state: string; at: string; reason: string }[];
|
||||
};
|
||||
type Supplement = {
|
||||
id: string;
|
||||
title: string;
|
||||
status: string;
|
||||
version_no: number;
|
||||
rows: ReviewRow[];
|
||||
publication: PublicClassification[];
|
||||
preview: PublicClassification[];
|
||||
publication_version: number | null;
|
||||
can_prepare: boolean;
|
||||
can_disclose: boolean;
|
||||
options: ClassificationOptions;
|
||||
authorities: { id: string; label_pt_mz: string }[];
|
||||
documents: {
|
||||
id: string;
|
||||
payload: { title?: string };
|
||||
file: { file_name: string };
|
||||
}[];
|
||||
};
|
||||
|
||||
export default function BusinessClassification({ supplement }: { supplement: Supplement }) {
|
||||
export default function BusinessClassification({
|
||||
supplement,
|
||||
}: {
|
||||
supplement: Supplement;
|
||||
}) {
|
||||
const [current, setCurrent] = useState(supplement);
|
||||
const [rows, setRows] = useState(supplement.rows.map((r) => r.relation));
|
||||
const [reason, setReason] = useState('');
|
||||
@@ -16,64 +52,287 @@ export default function BusinessClassification({ supplement }: { supplement: Sup
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [preview, setPreview] = useState(false);
|
||||
const alert = useRef<HTMLDivElement>(null);
|
||||
const dirty = JSON.stringify(rows) !== JSON.stringify(current.rows.map((r) => r.relation));
|
||||
const dirty =
|
||||
JSON.stringify(rows) !==
|
||||
JSON.stringify(current.rows.map((r) => r.relation));
|
||||
async function act(action: string, fields: Record<string, unknown> = {}) {
|
||||
setBusy(true); setError(''); setErrors({}); setMessage('');
|
||||
setBusy(true);
|
||||
setError('');
|
||||
setErrors({});
|
||||
setMessage('');
|
||||
try {
|
||||
const token = decodeURIComponent(document.cookie.split('; ').find((v) => v.startsWith('XSRF-TOKEN='))?.slice(11) ?? '');
|
||||
const response = await fetch(`/api/v1/existing-business/listings/${current.id}/classification`, { method: 'POST', credentials: 'same-origin', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-XSRF-TOKEN': token }, body: JSON.stringify({ action, version_no: current.version_no, reason, ...fields }) });
|
||||
const token = decodeURIComponent(
|
||||
document.cookie
|
||||
.split('; ')
|
||||
.find((v) => v.startsWith('XSRF-TOKEN='))
|
||||
?.slice(11) ?? '',
|
||||
);
|
||||
const response = await fetch(
|
||||
`/api/v1/existing-business/listings/${current.id}/classification`,
|
||||
{
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'X-XSRF-TOKEN': token,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
action,
|
||||
version_no: current.version_no,
|
||||
reason,
|
||||
...fields,
|
||||
}),
|
||||
},
|
||||
);
|
||||
const result = await response.json();
|
||||
if (!response.ok) {
|
||||
const details = Object.fromEntries(Object.entries(result.errors ?? {}).map(([key, value]) => [key, (value as string[]).join(' ')]));
|
||||
const details = Object.fromEntries(
|
||||
Object.entries(result.errors ?? {}).map(([key, value]) => [
|
||||
key,
|
||||
(value as string[]).join(' '),
|
||||
]),
|
||||
);
|
||||
setErrors(details);
|
||||
throw new Error(Object.values(details)[0] || result.message || 'Não foi possível concluir. Os valores preparados permanecem no formulário.');
|
||||
throw new Error(
|
||||
Object.values(details)[0] ||
|
||||
result.message ||
|
||||
'Não foi possível concluir. Os valores preparados permanecem no formulário.',
|
||||
);
|
||||
}
|
||||
setCurrent(result.supplement); setRows(result.supplement.rows.map((r: ReviewRow) => r.relation)); setPreview(false);
|
||||
setMessage(action === 'prepare' ? 'Classificação guardada e recuperada. A publicação anterior mantém-se.' : action === 'review' ? 'Decisão registada. A divulgação continua separada.' : action === 'withdraw' ? 'Projeção da classificação retirada; anúncio preservado.' : 'Nova fotografia da classificação divulgada; anúncio preservado.');
|
||||
setCurrent(result.supplement);
|
||||
setRows(result.supplement.rows.map((r: ReviewRow) => r.relation));
|
||||
setPreview(false);
|
||||
setMessage(
|
||||
action === 'prepare'
|
||||
? 'Classificação guardada e recuperada. A publicação anterior mantém-se.'
|
||||
: action === 'review'
|
||||
? 'Decisão registada. A divulgação continua separada.'
|
||||
: action === 'withdraw'
|
||||
? 'Projeção da classificação retirada; anúncio preservado.'
|
||||
: 'Nova fotografia da classificação divulgada; anúncio preservado.',
|
||||
);
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : 'Não foi possível concluir. Preserve os valores e atualize a página.');
|
||||
setError(
|
||||
e instanceof Error
|
||||
? e.message
|
||||
: 'Não foi possível concluir. Preserve os valores e atualize a página.',
|
||||
);
|
||||
requestAnimationFrame(() => alert.current?.focus());
|
||||
} finally { setBusy(false); }
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}
|
||||
const previewRows = current.preview;
|
||||
return <Frame title="Classificação do anúncio">
|
||||
<div className="mx-auto max-w-5xl space-y-5">
|
||||
<Link className="underline" href={`/investidor/negocios/${current.id}`}>Voltar ao mesmo anúncio</Link>
|
||||
<h1 className="text-2xl font-bold">{current.title}</h1>
|
||||
<p>Anúncio {current.status === 'published' ? 'publicado' : 'em preparação'} · versão {current.version_no}</p>
|
||||
<p>Este suplemento altera apenas a classificação. Conteúdo, confidencialidade e workflow do anúncio mantêm-se. Guardar ou confirmar uma relação não a divulga.</p>
|
||||
{error && <div ref={alert} tabIndex={-1} role="alert" className="rounded border border-red-600 p-3">{error}</div>}
|
||||
{message && <p role="status">{message}</p>}
|
||||
{current.can_prepare && <section className={card}>
|
||||
<ClassificationEditor rows={rows} onChange={setRows} options={current.options} documents={current.documents} authorities={current.authorities} errors={errors} />
|
||||
</section>}
|
||||
<label className="grid gap-1">Fundamento da ação <textarea className={input} value={reason} onChange={(e) => setReason(e.target.value)} minLength={20} maxLength={1000} /></label>
|
||||
<p className="text-sm">Indique o fundamento da operação, com pelo menos 20 caracteres. A nota permanece privada.</p>
|
||||
{current.can_prepare && <button className={button} disabled={busy} onClick={() => void act('prepare', { rows })}>Guardar classificação privada</button>}
|
||||
<section className="space-y-4" aria-label="Decisões por relação">
|
||||
<h2 className="text-xl font-bold">Relações guardadas e decisões</h2>
|
||||
{!current.rows.length && <p>Ainda não existem relações guardadas.</p>}
|
||||
{current.rows.map((r) => <article key={r.hash} className={card}>
|
||||
<h3 className="font-bold">{current.options.targets[r.relation.classification!.target_type]?.find((t) => String(t.id) === r.relation.related_id)?.label ?? 'Referência indisponível'}</h3>
|
||||
<p>{current.options.dimensions[r.dimension]} · {current.options.purposes[r.relation.classification!.purpose]} · {classificationStates[r.state]}</p>
|
||||
<p>Fonte: {r.relation.classification!.source_reference || 'Por indicar'} · {r.relation.classification!.citation || 'Citação por indicar'}</p>
|
||||
<p>Fundamento: {r.relation.classification!.justification || 'Por indicar'}</p>
|
||||
{r.can_review ? <div className="flex flex-wrap gap-2">{['confirmed', 'in_validation', 'rejected', 'revoked', 'archived'].map((state) => <button key={state} className={button} disabled={busy || dirty} onClick={() => void act('review', { hash: r.hash, state })}>{classificationStates[state]}</button>)}</div> : <p>Decisão indisponível nesta sessão: requer Validador independente, âmbito, responsabilidade e MFA aplicáveis.</p>}
|
||||
{!!r.history.length && <details><summary>Histórico de decisões</summary><ul>{r.history.map((h, i) => <li key={i}>{h.at} · {classificationStates[h.state]} · {h.reason}</li>)}</ul></details>}
|
||||
</article>)}
|
||||
</section>
|
||||
<section className={card} aria-label="Fotografia pública atual">
|
||||
<h2 className="text-xl font-bold">Fotografia pública atual</h2>
|
||||
<p>{current.publication_version ? `Divulgada na versão ${current.publication_version}.` : 'Sem classificação divulgada; o teaser anterior mantém-se.'}</p>
|
||||
<ClassificationSummary rows={current.publication} />
|
||||
</section>
|
||||
{current.can_disclose && <section className={`${card} space-y-3`}>
|
||||
<h2 className="text-xl font-bold">Divulgação expressa da classificação</h2>
|
||||
<p>Apenas as relações guardadas com intenção de divulgação pública integram a fotografia. Notas, contactos, critérios privados e ficheiros de suporte permanecem privados.</p>
|
||||
<button className={button} disabled={busy || dirty} onClick={() => setPreview(!preview)}>Conferir nova fotografia pública</button>
|
||||
{preview && <div><ClassificationSummary rows={previewRows} /><button className={button} disabled={busy || dirty} onClick={() => void act('disclose')}>Divulgar esta classificação</button></div>}
|
||||
<button className={button} disabled={busy} onClick={() => void act('withdraw')}>Retirar apenas a classificação pública</button>
|
||||
</section>}
|
||||
</div>
|
||||
</Frame>;
|
||||
return (
|
||||
<Frame title="Classificação do anúncio">
|
||||
<div className="mx-auto max-w-5xl space-y-5">
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/investidor/negocios/${current.id}`}
|
||||
>
|
||||
Voltar ao mesmo anúncio
|
||||
</Link>
|
||||
<h1 className="text-2xl font-bold">{current.title}</h1>
|
||||
<p>
|
||||
Anúncio{' '}
|
||||
{current.status === 'published'
|
||||
? 'publicado'
|
||||
: 'em preparação'}{' '}
|
||||
· versão {current.version_no}
|
||||
</p>
|
||||
<p>
|
||||
Este suplemento altera apenas a classificação. Conteúdo,
|
||||
confidencialidade e workflow do anúncio mantêm-se. Guardar
|
||||
ou confirmar uma relação não a divulga.
|
||||
</p>
|
||||
{error && (
|
||||
<div
|
||||
ref={alert}
|
||||
tabIndex={-1}
|
||||
role="alert"
|
||||
className="rounded border border-red-600 p-3"
|
||||
>
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
{message && <p role="status">{message}</p>}
|
||||
{current.can_prepare && (
|
||||
<section className={card}>
|
||||
<ClassificationEditor
|
||||
rows={rows}
|
||||
onChange={setRows}
|
||||
options={current.options}
|
||||
documents={current.documents}
|
||||
authorities={current.authorities}
|
||||
errors={errors}
|
||||
/>
|
||||
</section>
|
||||
)}
|
||||
<label className="grid gap-1">
|
||||
Fundamento da ação{' '}
|
||||
<textarea
|
||||
className={input}
|
||||
value={reason}
|
||||
onChange={(e) => setReason(e.target.value)}
|
||||
minLength={20}
|
||||
maxLength={1000}
|
||||
/>
|
||||
</label>
|
||||
<p className="text-sm">
|
||||
Indique o fundamento da operação, com pelo menos 20
|
||||
caracteres. A nota permanece privada.
|
||||
</p>
|
||||
{current.can_prepare && (
|
||||
<button
|
||||
className={button}
|
||||
disabled={busy}
|
||||
onClick={() => void act('prepare', { rows })}
|
||||
>
|
||||
Guardar classificação privada
|
||||
</button>
|
||||
)}
|
||||
<section
|
||||
className="space-y-4"
|
||||
aria-label="Decisões por relação"
|
||||
>
|
||||
<h2 className="text-xl font-bold">
|
||||
Relações guardadas e decisões
|
||||
</h2>
|
||||
{!current.rows.length && (
|
||||
<p>Ainda não existem relações guardadas.</p>
|
||||
)}
|
||||
{current.rows.map((r) => (
|
||||
<article key={r.hash} className={card}>
|
||||
<h3 className="font-bold">
|
||||
{current.options.targets[
|
||||
r.relation.classification!.target_type
|
||||
]?.find(
|
||||
(t) =>
|
||||
String(t.id) === r.relation.related_id,
|
||||
)?.label ?? 'Referência indisponível'}
|
||||
</h3>
|
||||
<p>
|
||||
{current.options.dimensions[r.dimension]} ·{' '}
|
||||
{
|
||||
current.options.purposes[
|
||||
r.relation.classification!.purpose
|
||||
]
|
||||
}{' '}
|
||||
· {classificationStates[r.state]}
|
||||
</p>
|
||||
<p>
|
||||
Fonte:{' '}
|
||||
{r.relation.classification!.source_reference ||
|
||||
'Por indicar'}{' '}
|
||||
·{' '}
|
||||
{r.relation.classification!.citation ||
|
||||
'Citação por indicar'}
|
||||
</p>
|
||||
<p>
|
||||
Fundamento:{' '}
|
||||
{r.relation.classification!.justification ||
|
||||
'Por indicar'}
|
||||
</p>
|
||||
{r.can_review ? (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{[
|
||||
'confirmed',
|
||||
'in_validation',
|
||||
'rejected',
|
||||
'revoked',
|
||||
'archived',
|
||||
].map((state) => (
|
||||
<button
|
||||
key={state}
|
||||
className={button}
|
||||
disabled={busy || dirty}
|
||||
onClick={() =>
|
||||
void act('review', {
|
||||
hash: r.hash,
|
||||
state,
|
||||
})
|
||||
}
|
||||
>
|
||||
{classificationStates[state]}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p>
|
||||
Decisão indisponível nesta sessão: requer
|
||||
Validador independente, âmbito,
|
||||
responsabilidade e MFA aplicáveis.
|
||||
</p>
|
||||
)}
|
||||
{!!r.history.length && (
|
||||
<details>
|
||||
<summary>Histórico de decisões</summary>
|
||||
<ul>
|
||||
{r.history.map((h, i) => (
|
||||
<li key={i}>
|
||||
{h.at} ·{' '}
|
||||
{classificationStates[h.state]}{' '}
|
||||
· {h.reason}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
<section className={card} aria-label="Fotografia pública atual">
|
||||
<h2 className="text-xl font-bold">
|
||||
Fotografia pública atual
|
||||
</h2>
|
||||
<p>
|
||||
{current.publication_version
|
||||
? `Divulgada na versão ${current.publication_version}.`
|
||||
: 'Sem classificação divulgada; o teaser anterior mantém-se.'}
|
||||
</p>
|
||||
<ClassificationSummary rows={current.publication} />
|
||||
</section>
|
||||
{current.can_disclose && (
|
||||
<section className={`${card} space-y-3`}>
|
||||
<h2 className="text-xl font-bold">
|
||||
Divulgação expressa da classificação
|
||||
</h2>
|
||||
<p>
|
||||
Apenas as relações guardadas com intenção de
|
||||
divulgação pública integram a fotografia. Notas,
|
||||
contactos, critérios privados e ficheiros de suporte
|
||||
permanecem privados.
|
||||
</p>
|
||||
<button
|
||||
className={button}
|
||||
disabled={busy || dirty}
|
||||
onClick={() => setPreview(!preview)}
|
||||
>
|
||||
Conferir nova fotografia pública
|
||||
</button>
|
||||
{preview && (
|
||||
<div>
|
||||
<ClassificationSummary rows={previewRows} />
|
||||
<button
|
||||
className={button}
|
||||
disabled={busy || dirty}
|
||||
onClick={() => void act('disclose')}
|
||||
>
|
||||
Divulgar esta classificação
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
className={button}
|
||||
disabled={busy}
|
||||
onClick={() => void act('withdraw')}
|
||||
>
|
||||
Retirar apenas a classificação pública
|
||||
</button>
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,12 @@ export default function BusinessInterest({
|
||||
privacyConsent: false,
|
||||
shareWithProponent: false,
|
||||
});
|
||||
const {form, setForm} = draft;
|
||||
const { form, setForm } = draft;
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const [fieldErrors, setFieldErrors] = useState<Partial<Record<keyof Form, string>>>({});
|
||||
const [fieldErrors, setFieldErrors] = useState<
|
||||
Partial<Record<keyof Form, string>>
|
||||
>({});
|
||||
const [receipt, setReceipt] = useState('');
|
||||
const key = useRef(draft.key);
|
||||
const update = <K extends keyof Form>(field: K, value: Form[K]) => {
|
||||
@@ -68,13 +70,20 @@ export default function BusinessInterest({
|
||||
id: fieldId(field),
|
||||
name: field,
|
||||
'aria-invalid': !!fieldErrors[field],
|
||||
'aria-describedby': fieldErrors[field] ? `${fieldId(field)}-error` : undefined,
|
||||
'aria-describedby': fieldErrors[field]
|
||||
? `${fieldId(field)}-error`
|
||||
: undefined,
|
||||
});
|
||||
const fieldError = (field: keyof Form) => fieldErrors[field] ? (
|
||||
<p id={`${fieldId(field)}-error`} role="alert" className="text-sm text-red-700">
|
||||
{fieldErrors[field]}
|
||||
</p>
|
||||
) : null;
|
||||
const fieldError = (field: keyof Form) =>
|
||||
fieldErrors[field] ? (
|
||||
<p
|
||||
id={`${fieldId(field)}-error`}
|
||||
role="alert"
|
||||
className="text-sm text-red-700"
|
||||
>
|
||||
{fieldErrors[field]}
|
||||
</p>
|
||||
) : null;
|
||||
const submit = async (event: FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
if (!form.privacyConsent) {
|
||||
@@ -104,19 +113,41 @@ export default function BusinessInterest({
|
||||
existingBusinessId: record.id,
|
||||
}),
|
||||
});
|
||||
if (response.status === 401) { draft.authenticate(); return; }
|
||||
if (response.status === 401) {
|
||||
draft.authenticate();
|
||||
return;
|
||||
}
|
||||
const data = await response.json();
|
||||
if (!response.ok) {
|
||||
const errors: Partial<Record<keyof Form, string>> = {};
|
||||
for (const [field, messages] of Object.entries(data.errors ?? {})) {
|
||||
for (const [field, messages] of Object.entries(
|
||||
data.errors ?? {},
|
||||
)) {
|
||||
if (field in form && Array.isArray(messages)) {
|
||||
errors[field as keyof Form] = messages.filter((message): message is string => typeof message === 'string').join(' ');
|
||||
errors[field as keyof Form] = messages
|
||||
.filter(
|
||||
(message): message is string =>
|
||||
typeof message === 'string',
|
||||
)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
setFieldErrors(errors);
|
||||
setError(data.message ?? 'Não foi possível enviar a manifestação.');
|
||||
setError(
|
||||
data.message ?? 'Não foi possível enviar a manifestação.',
|
||||
);
|
||||
const first = Object.keys(errors)[0] as keyof Form | undefined;
|
||||
window.setTimeout(() => document.getElementById(first ? fieldId(first) : 'business-interest-feedback')?.focus(), 0);
|
||||
window.setTimeout(
|
||||
() =>
|
||||
document
|
||||
.getElementById(
|
||||
first
|
||||
? fieldId(first)
|
||||
: 'business-interest-feedback',
|
||||
)
|
||||
?.focus(),
|
||||
0,
|
||||
);
|
||||
return;
|
||||
}
|
||||
setFieldErrors({});
|
||||
@@ -144,7 +175,13 @@ export default function BusinessInterest({
|
||||
{receipt ? (
|
||||
<section className={card} role="status">
|
||||
<h2 className="text-xl font-bold">Pedido recebido</h2>
|
||||
<p>Referência: {receipt}</p><Link href="/investidor/manifestacoes" className="underline">Acompanhar manifestações</Link>
|
||||
<p>Referência: {receipt}</p>
|
||||
<Link
|
||||
href="/investidor/manifestacoes"
|
||||
className="underline"
|
||||
>
|
||||
Acompanhar manifestações
|
||||
</Link>
|
||||
<p>
|
||||
A equipa fará a triagem antes de qualquer partilha com o
|
||||
proponente.
|
||||
@@ -152,7 +189,8 @@ export default function BusinessInterest({
|
||||
</section>
|
||||
) : (
|
||||
<form className={`${card} space-y-4`} onSubmit={submit}>
|
||||
<div className="space-y-1 text-sm font-medium"><span>País de origem declarado desta solicitação</span>
|
||||
<div className="space-y-1 text-sm font-medium">
|
||||
<span>País de origem declarado desta solicitação</span>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
id={fieldId('declared_origin_country_code')}
|
||||
@@ -222,7 +260,8 @@ export default function BusinessInterest({
|
||||
</select>
|
||||
{fieldError('investorType')}
|
||||
</Field>
|
||||
<div className="space-y-1 text-sm font-medium"><span>País</span>
|
||||
<div className="space-y-1 text-sm font-medium">
|
||||
<span>País</span>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
required
|
||||
@@ -322,7 +361,15 @@ export default function BusinessInterest({
|
||||
</span>
|
||||
</label>
|
||||
{fieldError('privacyConsent')}
|
||||
{error && <p id="business-interest-feedback" tabIndex={-1} role="alert">{error}</p>}
|
||||
{error && (
|
||||
<p
|
||||
id="business-interest-feedback"
|
||||
tabIndex={-1}
|
||||
role="alert"
|
||||
>
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
<button className={button} disabled={busy}>
|
||||
{busy ? 'A enviar…' : 'Enviar manifestação'}
|
||||
</button>
|
||||
|
||||
@@ -192,8 +192,7 @@ export default function BusinessWizard({
|
||||
const initial: Business['payload'] = {
|
||||
...record.payload,
|
||||
opportunity_type:
|
||||
record.payload.opportunity_type ??
|
||||
modalityFormType ?? '',
|
||||
record.payload.opportunity_type ?? modalityFormType ?? '',
|
||||
wizard_version: '2',
|
||||
};
|
||||
if (
|
||||
@@ -500,9 +499,27 @@ export default function BusinessWizard({
|
||||
)}
|
||||
>
|
||||
<div lang={english ? 'en' : 'pt'} className="space-y-5">
|
||||
<p>{t('Modalidade registada', 'Registered modality')}: {businessModalities[record.modality] ?? record.modality}</p>
|
||||
{!modalityFormType && <p role="status">{t('Pode guardar e recuperar esta preparação. O formulário específico de submissão desta modalidade ainda não está disponível; os dados e a modalidade original serão preservados.', 'You can save and recover this draft. Its specific submission form is not available yet; the original modality and data are preserved.')}</p>}
|
||||
<a className="underline" href={`/investidor/negocios/${record.id}/classificacao`}>{t('Classificação multidimensional deste anúncio', 'Multidimensional classification of this listing')}</a>
|
||||
<p>
|
||||
{t('Modalidade registada', 'Registered modality')}:{' '}
|
||||
{businessModalities[record.modality] ?? record.modality}
|
||||
</p>
|
||||
{!modalityFormType && (
|
||||
<p role="status">
|
||||
{t(
|
||||
'Pode guardar e recuperar esta preparação. O formulário específico de submissão desta modalidade ainda não está disponível; os dados e a modalidade original serão preservados.',
|
||||
'You can save and recover this draft. Its specific submission form is not available yet; the original modality and data are preserved.',
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
<a
|
||||
className="underline"
|
||||
href={`/investidor/negocios/${record.id}/classificacao`}
|
||||
>
|
||||
{t(
|
||||
'Classificação multidimensional deste anúncio',
|
||||
'Multidimensional classification of this listing',
|
||||
)}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
className="underline"
|
||||
|
||||
@@ -113,7 +113,14 @@ function Editor({
|
||||
};
|
||||
return (
|
||||
<Frame title={record.payload.title}>
|
||||
<p><Link className="underline" href={`/investidor/negocios/${record.id}/classificacao`}>Classificação multidimensional deste anúncio</Link></p>
|
||||
<p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/investidor/negocios/${record.id}/classificacao`}
|
||||
>
|
||||
Classificação multidimensional deste anúncio
|
||||
</Link>
|
||||
</p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={owner ? '/investidor/negocios' : '/management/negocios'}
|
||||
@@ -260,7 +267,11 @@ function Editor({
|
||||
designados. Esta autorização não permite publicação.
|
||||
</label>
|
||||
)}
|
||||
{(canTriage || canReview || canApproveLevelOne || canApproveLevelTwo || canPublish) && (
|
||||
{(canTriage ||
|
||||
canReview ||
|
||||
canApproveLevelOne ||
|
||||
canApproveLevelTwo ||
|
||||
canPublish) && (
|
||||
<p id="business-transition-help" role="status" className="my-3">
|
||||
{busy
|
||||
? 'Aguarde a conclusão da ação em curso.'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import CatalogueGuideLinks from '@/components/catalogue-guide-links';
|
||||
import OpportunityCorridorGroups, { type CorridorGroup } from '@/components/opportunity-corridor-groups';
|
||||
import OpportunityCorridorGroups, {
|
||||
type CorridorGroup,
|
||||
} from '@/components/opportunity-corridor-groups';
|
||||
import { searchTerritoryHref } from '@/lib/search-territory';
|
||||
import type { EducationalArticle } from '@/components/educational-article-card';
|
||||
import OpportunitySearchFilters from '@/components/opportunity-search-filters';
|
||||
@@ -10,7 +12,7 @@ import Map from '@/components/interactive-investment-map';
|
||||
import TerritoryGeometryPreview from '@/components/territory-geometry-preview';
|
||||
import type { InvestmentMapArea } from '@/components/interactive-investment-map';
|
||||
import { type TerritoryOption } from '@/components/investment-territory';
|
||||
import { Frame, button, card, money, api, groupLabels } from './shared';
|
||||
import { Frame, button, card, money, api } from './shared';
|
||||
import type { Opportunity, References } from './shared';
|
||||
|
||||
type Feature = {
|
||||
@@ -52,12 +54,28 @@ export default function Catalogue({
|
||||
}) {
|
||||
const page = usePage<{ auth: { user: unknown } }>();
|
||||
const { auth } = page.props;
|
||||
const [investmentSelection, setInvestmentSelection] = useState<number[]>(() => {
|
||||
try { return JSON.parse(sessionStorage.getItem('investment-opportunity-selection') ?? '[]'); } catch { return []; }
|
||||
});
|
||||
const [investmentSelection, setInvestmentSelection] = useState<number[]>(
|
||||
() => {
|
||||
try {
|
||||
return JSON.parse(
|
||||
sessionStorage.getItem(
|
||||
'investment-opportunity-selection',
|
||||
) ?? '[]',
|
||||
);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
);
|
||||
function selectInvestment(id: number, checked: boolean) {
|
||||
const next = checked ? [...new Set([...investmentSelection, id])] : investmentSelection.filter(x => x !== id);
|
||||
setInvestmentSelection(next); sessionStorage.setItem('investment-opportunity-selection', JSON.stringify(next));
|
||||
const next = checked
|
||||
? [...new Set([...investmentSelection, id])]
|
||||
: investmentSelection.filter((x) => x !== id);
|
||||
setInvestmentSelection(next);
|
||||
sessionStorage.setItem(
|
||||
'investment-opportunity-selection',
|
||||
JSON.stringify(next),
|
||||
);
|
||||
}
|
||||
const form = useForm({
|
||||
perspective: String(filters.perspective ?? ''),
|
||||
@@ -103,7 +121,7 @@ export default function Catalogue({
|
||||
: Number(filters.maturity_level) === 8
|
||||
? 'stage:operational'
|
||||
: filters.maturity_level
|
||||
? `historical:${filters.maturity_level}`
|
||||
? `historical:${inputText(filters.maturity_level)}`
|
||||
: ''),
|
||||
),
|
||||
before: String(filters.before ?? ''),
|
||||
@@ -114,13 +132,24 @@ export default function Catalogue({
|
||||
});
|
||||
const view = String(filters.view ?? 'grid');
|
||||
const selectedStructures = [
|
||||
...(references.zones ?? []).filter((zone) =>
|
||||
['park_id', 'zee_id', 'zfi_id'].some((key) => filters[key] === zone.id),
|
||||
).map((zone) => ({ ...zone, url: `/zonas/${zone.id}` })),
|
||||
...(references.zones ?? [])
|
||||
.filter((zone) =>
|
||||
['park_id', 'zee_id', 'zfi_id'].some(
|
||||
(key) => filters[key] === zone.id,
|
||||
),
|
||||
)
|
||||
.map((zone) => ({ ...zone, url: `/zonas/${zone.id}` })),
|
||||
...(['clusters', 'corridors', 'projects'] as const).flatMap((group) =>
|
||||
references[group].filter((record) => filters[
|
||||
{ clusters: 'cluster_id', corridors: 'corridor_id', projects: 'project_id' }[group]
|
||||
] === record.id),
|
||||
references[group].filter(
|
||||
(record) =>
|
||||
filters[
|
||||
{
|
||||
clusters: 'cluster_id',
|
||||
corridors: 'corridor_id',
|
||||
projects: 'project_id',
|
||||
}[group]
|
||||
] === record.id,
|
||||
),
|
||||
),
|
||||
];
|
||||
const [territoryPath, setTerritoryPath] = useState(territorySelection);
|
||||
@@ -129,7 +158,11 @@ export default function Catalogue({
|
||||
const [comparison, setComparison] = useState<{ record: Opportunity }[]>([]);
|
||||
const comparisonRef = useRef<HTMLDivElement>(null);
|
||||
useEffect(() => {
|
||||
if (view === 'corridors' && comparison.length) comparisonRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
if (view === 'corridors' && comparison.length)
|
||||
comparisonRef.current?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start',
|
||||
});
|
||||
}, [comparison, view]);
|
||||
const [points, setPoints] = useState<Feature[] | null>(null);
|
||||
const [areas, setAreas] = useState<InvestmentMapArea[]>([]);
|
||||
@@ -383,8 +416,10 @@ export default function Catalogue({
|
||||
/>
|
||||
<h2 className="text-xl font-semibold">
|
||||
Oportunidades publicadas
|
||||
{filters.sector && ` · ${references.sectors.find((sector) => sector.slug === filters.sector)?.name ?? filters.sector}`}
|
||||
{territorySelection.length > 0 && ` · ${territorySelection.map((territory) => territory.name).join(' / ')}`}
|
||||
{filters.sector &&
|
||||
` · ${inputText(references.sectors.find((sector) => sector.slug === filters.sector)?.name ?? filters.sector)}`}
|
||||
{territorySelection.length > 0 &&
|
||||
` · ${territorySelection.map((territory) => territory.name).join(' / ')}`}
|
||||
</h2>
|
||||
<SearchState
|
||||
loading={searchLoading}
|
||||
@@ -392,15 +427,42 @@ export default function Catalogue({
|
||||
total={results.total}
|
||||
retry={() => runSearch()}
|
||||
/>
|
||||
{!searchLoading && !searchError && results.total === 0 && selectedStructures.length > 0 && (
|
||||
<section className={card} aria-label="Estrutura seleccionada">
|
||||
<p className="font-semibold">Sem oportunidades publicadas associadas com estes filtros.</p>
|
||||
<p>A estrutura continua disponível para consulta. A sua selecção não confirma benefícios nem disponibilidade para investimento.</p>
|
||||
{selectedStructures.map((record) => (
|
||||
record.url ? <Link key={record.id} className="block underline" href={searchTerritoryHref(record.url, page.url)}>
|
||||
Consultar ficha: {record.name}
|
||||
</Link> : <p key={record.id}>{record.name} — sem ficha pública detalhada disponível.</p>
|
||||
))}
|
||||
{!searchLoading &&
|
||||
!searchError &&
|
||||
results.total === 0 &&
|
||||
selectedStructures.length > 0 && (
|
||||
<section
|
||||
className={card}
|
||||
aria-label="Estrutura seleccionada"
|
||||
>
|
||||
<p className="font-semibold">
|
||||
Sem oportunidades publicadas associadas com estes
|
||||
filtros.
|
||||
</p>
|
||||
<p>
|
||||
A estrutura continua disponível para consulta. A sua
|
||||
selecção não confirma benefícios nem disponibilidade
|
||||
para investimento.
|
||||
</p>
|
||||
{selectedStructures.map((record) =>
|
||||
record.url ? (
|
||||
<Link
|
||||
key={record.id}
|
||||
className="block underline"
|
||||
href={searchTerritoryHref(
|
||||
record.url,
|
||||
page.url,
|
||||
)}
|
||||
>
|
||||
Consultar ficha: {record.name}
|
||||
</Link>
|
||||
) : (
|
||||
<p key={record.id}>
|
||||
{record.name} — sem ficha pública detalhada
|
||||
disponível.
|
||||
</p>
|
||||
),
|
||||
)}
|
||||
</section>
|
||||
)}
|
||||
<div className="flex flex-wrap items-center gap-4">
|
||||
@@ -431,25 +493,35 @@ export default function Catalogue({
|
||||
Pesquisar noutras províncias (remover localização)
|
||||
</button>
|
||||
)}
|
||||
{['grid', 'list', 'map', 'combined', 'corridors'].map((value, i) => (
|
||||
<button
|
||||
key={value}
|
||||
disabled={searchLoading || !!searchError}
|
||||
aria-pressed={view === value}
|
||||
className="rounded border px-4 py-2"
|
||||
onClick={() => {
|
||||
const params = new URLSearchParams(query());
|
||||
params.set('view', value);
|
||||
router.get(
|
||||
`${catalogueUrl}?${params}`,
|
||||
{},
|
||||
{ preserveScroll: true },
|
||||
);
|
||||
}}
|
||||
>
|
||||
{['Grelha', 'Lista', 'Mapa', 'Lista e mapa', 'Por corredor'][i]}
|
||||
</button>
|
||||
))}
|
||||
{['grid', 'list', 'map', 'combined', 'corridors'].map(
|
||||
(value, i) => (
|
||||
<button
|
||||
key={value}
|
||||
disabled={searchLoading || !!searchError}
|
||||
aria-pressed={view === value}
|
||||
className="rounded border px-4 py-2"
|
||||
onClick={() => {
|
||||
const params = new URLSearchParams(query());
|
||||
params.set('view', value);
|
||||
router.get(
|
||||
`${catalogueUrl}?${params}`,
|
||||
{},
|
||||
{ preserveScroll: true },
|
||||
);
|
||||
}}
|
||||
>
|
||||
{
|
||||
[
|
||||
'Grelha',
|
||||
'Lista',
|
||||
'Mapa',
|
||||
'Lista e mapa',
|
||||
'Por corredor',
|
||||
][i]
|
||||
}
|
||||
</button>
|
||||
),
|
||||
)}
|
||||
<a
|
||||
className="underline"
|
||||
aria-disabled={searchLoading || !!searchError}
|
||||
@@ -581,8 +653,29 @@ export default function Catalogue({
|
||||
</ul>
|
||||
</section>
|
||||
)}
|
||||
{view === 'corridors' && !searchLoading && !searchError && <OpportunityCorridorGroups groups={corridorGroups} selected={investmentSelection} onSelect={selectInvestment} onClear={()=>{setInvestmentSelection([]);sessionStorage.removeItem('investment-opportunity-selection');}} onCompare={ids=>void api('/api/v1/investment/compare?'+ids.map(id=>'ids[]='+id).join('&')).then(data=>setComparison(data.records)).catch(e=>setError(e.message))}/>}
|
||||
{view !== 'corridors' && !searchLoading &&
|
||||
{view === 'corridors' && !searchLoading && !searchError && (
|
||||
<OpportunityCorridorGroups
|
||||
groups={corridorGroups}
|
||||
selected={investmentSelection}
|
||||
onSelect={selectInvestment}
|
||||
onClear={() => {
|
||||
setInvestmentSelection([]);
|
||||
sessionStorage.removeItem(
|
||||
'investment-opportunity-selection',
|
||||
);
|
||||
}}
|
||||
onCompare={(ids) =>
|
||||
void api(
|
||||
'/api/v1/investment/compare?' +
|
||||
ids.map((id) => 'ids[]=' + id).join('&'),
|
||||
)
|
||||
.then((data) => setComparison(data.records))
|
||||
.catch((e) => setError(e.message))
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{view !== 'corridors' &&
|
||||
!searchLoading &&
|
||||
!searchError &&
|
||||
(view !== 'map' || error || points?.length === 0) && (
|
||||
<div
|
||||
@@ -596,7 +689,11 @@ export default function Catalogue({
|
||||
<article key={r.id} className={card + ' space-y-3'}>
|
||||
<p className="text-sm">
|
||||
{r.sector?.name} ·{' '}
|
||||
{r.territorial_summary || [r.province, r.district].filter(Boolean).join(' / ') || 'Localização não indicada'}
|
||||
{r.territorial_summary ||
|
||||
[r.province, r.district]
|
||||
.filter(Boolean)
|
||||
.join(' / ') ||
|
||||
'Localização não indicada'}
|
||||
</p>
|
||||
<h2 className="text-xl font-bold">
|
||||
<Link
|
||||
@@ -607,7 +704,15 @@ export default function Catalogue({
|
||||
</h2>
|
||||
<p>{r.summary}</p>
|
||||
<p className="font-semibold">{money(r)}</p>
|
||||
<p>{r.proactive?(r.proactive.group==='ideas'?'Ideia em preparação':r.proactive.group==='needs'?'Necessidade identificada':'O que existe'):r.maturity_label}</p>
|
||||
<p>
|
||||
{r.proactive
|
||||
? r.proactive.group === 'ideas'
|
||||
? 'Ideia em preparação'
|
||||
: r.proactive.group === 'needs'
|
||||
? 'Necessidade identificada'
|
||||
: 'O que existe'
|
||||
: r.maturity_label}
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-4">
|
||||
<Link
|
||||
className="underline"
|
||||
@@ -624,7 +729,21 @@ export default function Catalogue({
|
||||
? 'Retirar favorito'
|
||||
: 'Guardar favorito'}
|
||||
</button>
|
||||
<label className="flex gap-2"><input type="checkbox" checked={investmentSelection.includes(r.id)} onChange={e => selectInvestment(r.id,e.target.checked)} />Escolher para preparar investimento</label>
|
||||
<label className="flex gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={investmentSelection.includes(
|
||||
r.id,
|
||||
)}
|
||||
onChange={(e) =>
|
||||
selectInvestment(
|
||||
r.id,
|
||||
e.target.checked,
|
||||
)
|
||||
}
|
||||
/>
|
||||
Escolher para preparar investimento
|
||||
</label>
|
||||
<label className="flex gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -653,15 +772,19 @@ export default function Catalogue({
|
||||
)}
|
||||
{!searchLoading && !searchError && !results.total && (
|
||||
<p className={card}>
|
||||
Não há oportunidades publicadas com estes filtros no cadastro consultado.
|
||||
A informação disponível pode ser incompleta. Pode{' '}
|
||||
Não há oportunidades publicadas com estes filtros no
|
||||
cadastro consultado. A informação disponível pode ser
|
||||
incompleta. Pode{' '}
|
||||
<Link href="/apoio" className="underline">
|
||||
peça apoio
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
)}
|
||||
<nav aria-label="Paginação" className={view === 'corridors' ? 'hidden' : 'flex gap-6'}>
|
||||
<nav
|
||||
aria-label="Paginação"
|
||||
className={view === 'corridors' ? 'hidden' : 'flex gap-6'}
|
||||
>
|
||||
{results.prev_page_url && (
|
||||
<Link href={results.prev_page_url}>Anterior</Link>
|
||||
)}
|
||||
@@ -684,7 +807,36 @@ export default function Catalogue({
|
||||
Comparar {selected.length} oportunidades
|
||||
</button>
|
||||
)}
|
||||
{view !== 'corridors' && !!investmentSelection.length && <section className={card}><p>{investmentSelection.length} oportunidades escolhidas, conservadas ao mudar de página.</p><Link className={button} href={'/investimentos/iniciar?' + investmentSelection.map(id => 'opportunities[]='+id).join('&')}>Preparar investimento com as oportunidades escolhidas</Link><button className="ml-4 underline" onClick={() => {setInvestmentSelection([]);sessionStorage.removeItem('investment-opportunity-selection');}}>Limpar escolha</button></section>}
|
||||
{view !== 'corridors' && !!investmentSelection.length && (
|
||||
<section className={card}>
|
||||
<p>
|
||||
{investmentSelection.length} oportunidades escolhidas,
|
||||
conservadas ao mudar de página.
|
||||
</p>
|
||||
<Link
|
||||
className={button}
|
||||
href={
|
||||
'/investimentos/iniciar?' +
|
||||
investmentSelection
|
||||
.map((id) => 'opportunities[]=' + id)
|
||||
.join('&')
|
||||
}
|
||||
>
|
||||
Preparar investimento com as oportunidades escolhidas
|
||||
</Link>
|
||||
<button
|
||||
className="ml-4 underline"
|
||||
onClick={() => {
|
||||
setInvestmentSelection([]);
|
||||
sessionStorage.removeItem(
|
||||
'investment-opportunity-selection',
|
||||
);
|
||||
}}
|
||||
>
|
||||
Limpar escolha
|
||||
</button>
|
||||
</section>
|
||||
)}
|
||||
{comparison.length > 0 && (
|
||||
<div ref={comparisonRef} className="overflow-x-auto">
|
||||
<table className="w-full border-collapse text-left">
|
||||
@@ -742,7 +894,10 @@ export default function Catalogue({
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
{territorial.map((d) => (
|
||||
<Link
|
||||
href={searchTerritoryHref(`/carteira/${d.id}`, page.url)}
|
||||
href={searchTerritoryHref(
|
||||
`/carteira/${d.id}`,
|
||||
page.url,
|
||||
)}
|
||||
key={d.id}
|
||||
className={card}
|
||||
>
|
||||
@@ -766,3 +921,4 @@ export default function Catalogue({
|
||||
</Frame>
|
||||
);
|
||||
}
|
||||
import { inputText } from '@/lib/input-text';
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import {ProactiveSummary} from '@/components/proactive-investment';
|
||||
import { ProactiveSummary } from '@/components/proactive-investment';
|
||||
import EducationalGuides from '@/components/educational-guides';
|
||||
import InvestmentComplements, { type ComplementOption } from '@/components/investment-complements';
|
||||
import { searchTerritoryHref, investmentPreparationHref } from '@/lib/search-territory';
|
||||
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';
|
||||
import { Link, router, usePage } from '@inertiajs/react';
|
||||
@@ -33,33 +38,73 @@ export default function Detail({
|
||||
}) {
|
||||
const page = usePage<{ auth: { user: unknown } }>();
|
||||
const { auth } = page.props;
|
||||
const dossierContext = new URLSearchParams(page.url.split('?')[1] ?? '').get('context');
|
||||
const dossierContext = new URLSearchParams(
|
||||
page.url.split('?')[1] ?? '',
|
||||
).get('context');
|
||||
const [sharing, setSharing] = useState('');
|
||||
return (
|
||||
<Frame title={r.title}>
|
||||
{r.maturity_label === 'Em preparação' && <p className="rounded border border-amber-700 bg-amber-50 p-4"><strong>Em preparação.</strong> Consulte a oportunidade e prepare o seu investimento. A execução depende das condições e autorizações aplicáveis ao projecto.</p>}
|
||||
{r.maturity_label === 'Em preparação' && (
|
||||
<p className="rounded border border-amber-700 bg-amber-50 p-4">
|
||||
<strong>Em preparação.</strong> Consulte a oportunidade e
|
||||
prepare o seu investimento. A execução depende das condições
|
||||
e autorizações aplicáveis ao projecto.
|
||||
</p>
|
||||
)}
|
||||
<Link
|
||||
className={button}
|
||||
href={investmentPreparationHref(r.id, page.url, dossierOrigin?.id)}
|
||||
href={investmentPreparationHref(
|
||||
r.id,
|
||||
page.url,
|
||||
dossierOrigin?.id,
|
||||
)}
|
||||
>
|
||||
Iniciar ou continuar investimento com esta oportunidade
|
||||
</Link>
|
||||
<PartnershipSourceLinks type="investment" id={r.id} />
|
||||
{auth.user&&dossierContext&&<nav aria-label="Preparar esta oportunidade" className="flex flex-wrap gap-4">
|
||||
<Link className="underline" href={`/simulador-fiscal?context=${encodeURIComponent(dossierContext)}&opportunity=opportunity%3A${r.id}`}>Simular esta oportunidade</Link>
|
||||
<Link className="underline" href={`/investimentos/${encodeURIComponent(dossierContext)}?opportunity=opportunity%3A${r.id}`}>Etapas e pedidos desta oportunidade</Link>
|
||||
<Link className="underline" href={`/investidor/terra-duat/novo?context=${encodeURIComponent(dossierContext)}&opportunity=opportunity%3A${r.id}`}>Terra/DUAT desta oportunidade</Link>
|
||||
<Link className="underline" href={`/balcao-virtual/dossiers/${encodeURIComponent(dossierContext)}?opportunity=opportunity%3A${r.id}`}>Balcão desta oportunidade</Link>
|
||||
</nav>}
|
||||
{auth.user && dossierContext && (
|
||||
<nav
|
||||
aria-label="Preparar esta oportunidade"
|
||||
className="flex flex-wrap gap-4"
|
||||
>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/simulador-fiscal?context=${encodeURIComponent(dossierContext)}&opportunity=opportunity%3A${r.id}`}
|
||||
>
|
||||
Simular esta oportunidade
|
||||
</Link>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/investimentos/${encodeURIComponent(dossierContext)}?opportunity=opportunity%3A${r.id}`}
|
||||
>
|
||||
Etapas e pedidos desta oportunidade
|
||||
</Link>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/investidor/terra-duat/novo?context=${encodeURIComponent(dossierContext)}&opportunity=opportunity%3A${r.id}`}
|
||||
>
|
||||
Terra/DUAT desta oportunidade
|
||||
</Link>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/balcao-virtual/dossiers/${encodeURIComponent(dossierContext)}?opportunity=opportunity%3A${r.id}`}
|
||||
>
|
||||
Balcão desta oportunidade
|
||||
</Link>
|
||||
</nav>
|
||||
)}
|
||||
<Link href={returnUrl} className="underline">
|
||||
Voltar à pesquisa
|
||||
</Link>
|
||||
<ProactiveSummary value={r.proactive}/>
|
||||
<ProactiveSummary value={r.proactive} />
|
||||
{dossierOrigin && (
|
||||
<p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(`/carteira/${dossierOrigin.id}`, page.url)}
|
||||
href={searchTerritoryHref(
|
||||
`/carteira/${dossierOrigin.id}`,
|
||||
page.url,
|
||||
)}
|
||||
>
|
||||
Voltar ao dossier: {dossierOrigin.title}
|
||||
</Link>
|
||||
@@ -69,7 +114,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}/>
|
||||
<InvestmentComplements items={complements} />
|
||||
<ClassificationSummary rows={c.classification ?? []} />
|
||||
<TerritorialSources sources={c.source_evidence} />
|
||||
<section className={card + ' space-y-3'}>
|
||||
@@ -103,7 +148,14 @@ export default function Detail({
|
||||
</p>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-4">
|
||||
<Link className={button} href={investmentPreparationHref(r.id, page.url, dossierOrigin?.id)}>
|
||||
<Link
|
||||
className={button}
|
||||
href={investmentPreparationHref(
|
||||
r.id,
|
||||
page.url,
|
||||
dossierOrigin?.id,
|
||||
)}
|
||||
>
|
||||
Iniciar ou continuar o roteiro deste investimento
|
||||
</Link>
|
||||
{auth.user ? (
|
||||
@@ -263,7 +315,10 @@ export default function Detail({
|
||||
<span key={dossier.id}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(`/carteira/${dossier.id}`, page.url)}
|
||||
href={searchTerritoryHref(
|
||||
`/carteira/${dossier.id}`,
|
||||
page.url,
|
||||
)}
|
||||
>
|
||||
Consultar dossier: {dossier.title}
|
||||
</Link>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1773,7 +1773,10 @@ function Editor({
|
||||
<p key={o.id}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(`/oportunidades/${o.slug}?zone_id=${z.id}`, pageUrl)}
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades/${o.slug}?zone_id=${z.id}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
{o.title}
|
||||
</Link>
|
||||
@@ -1830,7 +1833,10 @@ function Editor({
|
||||
<p key={r.id}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(`/carteira/${r.id}`, pageUrl)}
|
||||
href={searchTerritoryHref(
|
||||
`/carteira/${r.id}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
{r.title}
|
||||
</Link>
|
||||
|
||||
@@ -100,34 +100,80 @@ export default function Zones({
|
||||
const pageUrl = usePage().url;
|
||||
const [error, setError] = useState('');
|
||||
const [busy, setBusy] = useState(false);
|
||||
const searchForm=useRef<HTMLFormElement|null>(null);
|
||||
const searchTimer=useRef<ReturnType<typeof setTimeout>|undefined>(undefined);
|
||||
const cancelSearch=useRef<(()=>void)|undefined>(undefined);
|
||||
const searchSequence=useRef(0);
|
||||
const [searching,setSearching]=useState(false);
|
||||
const [searchError,setSearchError]=useState('');
|
||||
const appliedKey=JSON.stringify([filters,territorySelection]);
|
||||
useEffect(()=>{searchForm.current?.reset();},[appliedKey]);
|
||||
useEffect(()=>()=>{clearTimeout(searchTimer.current);cancelSearch.current?.();},[]);
|
||||
const runSearch=(path?:TerritoryOption[])=>{
|
||||
clearTimeout(searchTimer.current);cancelSearch.current?.();
|
||||
if(!searchForm.current)return;
|
||||
const sequence=++searchSequence.current;
|
||||
const params=territorialSearchParams(new FormData(searchForm.current),path);
|
||||
setSearching(true);setSearchError('');
|
||||
router.get(`${management?'/management/investment/zones':'/zonas'}?${params}`,{}, {
|
||||
preserveState:true,preserveScroll:true,replace:true,
|
||||
onCancelToken:token=>{cancelSearch.current=()=>token.cancel();},
|
||||
onError:()=>{if(sequence===searchSequence.current)setSearchError('A pesquisa não foi concluída. Confira os filtros e tente novamente.');},
|
||||
onNetworkError:()=>{if(sequence===searchSequence.current)setSearchError('Ligação indisponível. Os filtros escolhidos foram preservados.');return false;},
|
||||
onHttpException:()=>{if(sequence===searchSequence.current)setSearchError('Não foi possível consultar esta selecção.');return false;},
|
||||
onFinish:()=>{if(sequence===searchSequence.current)setSearching(false);},
|
||||
});
|
||||
const searchForm = useRef<HTMLFormElement | null>(null);
|
||||
const searchTimer = useRef<ReturnType<typeof setTimeout> | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const cancelSearch = useRef<(() => void) | undefined>(undefined);
|
||||
const searchSequence = useRef(0);
|
||||
const [searching, setSearching] = useState(false);
|
||||
const [searchError, setSearchError] = useState('');
|
||||
const appliedKey = JSON.stringify([filters, territorySelection]);
|
||||
useEffect(() => {
|
||||
searchForm.current?.reset();
|
||||
}, [appliedKey]);
|
||||
useEffect(
|
||||
() => () => {
|
||||
clearTimeout(searchTimer.current);
|
||||
cancelSearch.current?.();
|
||||
},
|
||||
[],
|
||||
);
|
||||
const runSearch = (path?: TerritoryOption[]) => {
|
||||
clearTimeout(searchTimer.current);
|
||||
cancelSearch.current?.();
|
||||
if (!searchForm.current) return;
|
||||
const sequence = ++searchSequence.current;
|
||||
const params = territorialSearchParams(
|
||||
new FormData(searchForm.current),
|
||||
path,
|
||||
);
|
||||
setSearching(true);
|
||||
setSearchError('');
|
||||
router.get(
|
||||
`${management ? '/management/investment/zones' : '/zonas'}?${params}`,
|
||||
{},
|
||||
{
|
||||
preserveState: true,
|
||||
preserveScroll: true,
|
||||
replace: true,
|
||||
onCancelToken: (token) => {
|
||||
cancelSearch.current = () => token.cancel();
|
||||
},
|
||||
onError: () => {
|
||||
if (sequence === searchSequence.current)
|
||||
setSearchError(
|
||||
'A pesquisa não foi concluída. Confira os filtros e tente novamente.',
|
||||
);
|
||||
},
|
||||
onNetworkError: () => {
|
||||
if (sequence === searchSequence.current)
|
||||
setSearchError(
|
||||
'Ligação indisponível. Os filtros escolhidos foram preservados.',
|
||||
);
|
||||
return false;
|
||||
},
|
||||
onHttpException: () => {
|
||||
if (sequence === searchSequence.current)
|
||||
setSearchError(
|
||||
'Não foi possível consultar esta selecção.',
|
||||
);
|
||||
return false;
|
||||
},
|
||||
onFinish: () => {
|
||||
if (sequence === searchSequence.current)
|
||||
setSearching(false);
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
const exportParams = new URLSearchParams();
|
||||
['province_id', 'district_id', 'admin_post_id', 'locality_id'].forEach((field, index) => {
|
||||
if (territorySelection[index]) exportParams.set(field, territorySelection[index].id);
|
||||
});
|
||||
['province_id', 'district_id', 'admin_post_id', 'locality_id'].forEach(
|
||||
(field, index) => {
|
||||
if (territorySelection[index])
|
||||
exportParams.set(field, territorySelection[index].id);
|
||||
},
|
||||
);
|
||||
for (const key of [
|
||||
'q',
|
||||
'category',
|
||||
@@ -183,9 +229,28 @@ export default function Zones({
|
||||
>
|
||||
<Link href="/clusters">Por Cluster</Link>
|
||||
<Link href="/corredores">Por Corredor</Link>
|
||||
<Link href={searchTerritoryHref('/zonas?category=zee', pageUrl)}>Por ZEE</Link>
|
||||
<Link href={searchTerritoryHref('/zonas?category=zfi', pageUrl)}>Por ZFI</Link>
|
||||
<Link href={searchTerritoryHref('/zonas?category=industrial_park', pageUrl)}>
|
||||
<Link
|
||||
href={searchTerritoryHref(
|
||||
'/zonas?category=zee',
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Por ZEE
|
||||
</Link>
|
||||
<Link
|
||||
href={searchTerritoryHref(
|
||||
'/zonas?category=zfi',
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Por ZFI
|
||||
</Link>
|
||||
<Link
|
||||
href={searchTerritoryHref(
|
||||
'/zonas?category=industrial_park',
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Parques industriais
|
||||
</Link>
|
||||
</nav>
|
||||
@@ -194,10 +259,14 @@ export default function Zones({
|
||||
<form
|
||||
ref={searchForm}
|
||||
method="get"
|
||||
onChange={(event)=>{
|
||||
if(!event.target.getAttribute('name'))return;
|
||||
clearTimeout(searchTimer.current);cancelSearch.current?.();searchSequence.current++;
|
||||
setSearching(true);setSearchError('');searchTimer.current=setTimeout(()=>runSearch(),350);
|
||||
onChange={(event) => {
|
||||
if (!event.target.getAttribute('name')) return;
|
||||
clearTimeout(searchTimer.current);
|
||||
cancelSearch.current?.();
|
||||
searchSequence.current++;
|
||||
setSearching(true);
|
||||
setSearchError('');
|
||||
searchTimer.current = setTimeout(() => runSearch(), 350);
|
||||
}}
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
@@ -333,13 +402,35 @@ export default function Zones({
|
||||
)}
|
||||
</div>
|
||||
</details>
|
||||
<TerritoryFields initial={territorySelection} onChange={path=>runSearch(path)} />
|
||||
<button type="button" className="underline" onClick={()=>runSearch([])}>Todo o território (remover localização)</button>
|
||||
<TerritoryFields
|
||||
initial={territorySelection}
|
||||
onChange={(path) => runSearch(path)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="underline"
|
||||
onClick={() => runSearch([])}
|
||||
>
|
||||
Todo o território (remover localização)
|
||||
</button>
|
||||
<button className={button}>Pesquisar</button>
|
||||
</form>
|
||||
<h2 className="text-xl font-semibold">{searching?'A pesquisar a selecção…':searchError?'Pesquisa por concluir':`${records.total} registos disponíveis · ${territorySelection.length?territorySelection.map(node=>node.name).join(' / '):'Todo o território'}`}</h2>
|
||||
{!searching&&!searchError&&records.total>0&&<p>A mostrar {records.from??1} a {records.to??records.data.length} de {records.total}. Página {records.current_page??1} de {records.last_page??1}.</p>}
|
||||
{searchError&&<p role="alert">{searchError}</p>}
|
||||
<h2 className="text-xl font-semibold">
|
||||
{searching
|
||||
? 'A pesquisar a selecção…'
|
||||
: searchError
|
||||
? 'Pesquisa por concluir'
|
||||
: `${records.total} registos disponíveis · ${territorySelection.length ? territorySelection.map((node) => node.name).join(' / ') : 'Todo o território'}`}
|
||||
</h2>
|
||||
{!searching && !searchError && records.total > 0 && (
|
||||
<p>
|
||||
A mostrar {records.from ?? 1} a{' '}
|
||||
{records.to ?? records.data.length} de {records.total}.
|
||||
Página {records.current_page ?? 1} de{' '}
|
||||
{records.last_page ?? 1}.
|
||||
</p>
|
||||
)}
|
||||
{searchError && <p role="alert">{searchError}</p>}
|
||||
{!management && !searching && !searchError && (
|
||||
<a
|
||||
className="underline"
|
||||
@@ -353,9 +444,21 @@ export default function Zones({
|
||||
Não foram encontrados resultados para esta pesquisa.
|
||||
</p>
|
||||
)}
|
||||
{!searching && !searchError && records.data.map((zone) => (
|
||||
<article className={card} key={zone.id}>
|
||||
<h2 className="text-xl font-bold">
|
||||
{!searching &&
|
||||
!searchError &&
|
||||
records.data.map((zone) => (
|
||||
<article className={card} key={zone.id}>
|
||||
<h2 className="text-xl font-bold">
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
||||
exportParams.toString(),
|
||||
)}
|
||||
>
|
||||
{zone.name}
|
||||
</Link>
|
||||
</h2>
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
@@ -363,123 +466,121 @@ export default function Zones({
|
||||
exportParams.toString(),
|
||||
)}
|
||||
>
|
||||
{zone.name}
|
||||
Consultar ficha
|
||||
</Link>
|
||||
</h2>
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
||||
exportParams.toString(),
|
||||
{!management && (
|
||||
<Link
|
||||
className="ml-4 underline"
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{!management && (
|
||||
<Link
|
||||
className="ml-4 underline"
|
||||
href={searchTerritoryHref(`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`, pageUrl)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
<p>
|
||||
{zone.code} ·{' '}
|
||||
{zone.category === 'industrial_park'
|
||||
? 'Parque industrial'
|
||||
: zone.category.toUpperCase()}{' '}
|
||||
·{' '}
|
||||
{[zone.district, zone.province]
|
||||
.filter(Boolean)
|
||||
.join(', ') || 'Localização por confirmar'}
|
||||
</p>
|
||||
{zone.legal_regime && (
|
||||
<p>
|
||||
Regime jurídico:{' '}
|
||||
{parkLabels[zone.legal_regime] ??
|
||||
(['zee', 'zfi'].includes(zone.legal_regime)
|
||||
? zone.legal_regime.toUpperCase()
|
||||
: 'Por confirmar')}
|
||||
{zone.code} ·{' '}
|
||||
{zone.category === 'industrial_park'
|
||||
? 'Parque industrial'
|
||||
: zone.category.toUpperCase()}{' '}
|
||||
·{' '}
|
||||
{[zone.district, zone.province]
|
||||
.filter(Boolean)
|
||||
.join(', ') || 'Localização por confirmar'}
|
||||
</p>
|
||||
)}
|
||||
{zoneExtensionsAvailable && zone.development_status && (
|
||||
<p>
|
||||
Desenvolvimento:{' '}
|
||||
{parkLabels[zone.development_status] ??
|
||||
'Por confirmar'}
|
||||
</p>
|
||||
)}
|
||||
{zoneExtensionsAvailable && zone.availability_status && (
|
||||
<p>
|
||||
Disponibilidade para instalação:{' '}
|
||||
{parkLabels[zone.availability_status] ??
|
||||
'Não informada'}
|
||||
</p>
|
||||
)}
|
||||
{zone.area_value && (
|
||||
<p>
|
||||
Área indicada: {zone.area_value} {zone.area_unit}
|
||||
</p>
|
||||
)}
|
||||
{zone.locations?.length ? (
|
||||
<p>
|
||||
Abrangência:{' '}
|
||||
{zone.locations
|
||||
.map((location) => location.name)
|
||||
.join(' · ')}
|
||||
</p>
|
||||
) : null}
|
||||
{zone.activities?.length ? (
|
||||
<p>
|
||||
Actividades:{' '}
|
||||
{zone.activities
|
||||
.map(
|
||||
(activity) =>
|
||||
`${activity.name} (${({ potential: 'Potencial referido pela fonte', proposed: 'Proposta', authorized: 'Autorizada por documento', conditional: 'Condicionada', excluded: 'Excluída' } as Record<string, string>)[activity.status] ?? 'Por confirmar'})`,
|
||||
)
|
||||
.join(' · ')}
|
||||
</p>
|
||||
) : null}
|
||||
{!!zone.source_evidence?.length && (
|
||||
<p>
|
||||
Fonte:{' '}
|
||||
{zone.source_evidence.map((source, index) => (
|
||||
<span key={source.url}>
|
||||
{index > 0 ? ' · ' : ''}
|
||||
<a
|
||||
className="underline"
|
||||
href={source.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{source.title}
|
||||
</a>
|
||||
{source.source_date
|
||||
? ` (${source.source_date})`
|
||||
: ' (data da fonte não informada)'}{' '}
|
||||
— {source.supports}
|
||||
</span>
|
||||
))}
|
||||
</p>
|
||||
)}
|
||||
{zone.category === 'industrial_park' && (
|
||||
<p>
|
||||
{zone.resources?.length
|
||||
? `${zone.resources.length} recursos descritos; consulte o âmbito e a fonte na ficha.`
|
||||
: 'Infraestruturas, serviços, acessos e capacidades: não informados.'}{' '}
|
||||
{!zone.activities?.length &&
|
||||
'Atividades: não informadas.'}
|
||||
</p>
|
||||
)}
|
||||
<p>{zone.description}</p>
|
||||
{management && <p>Validação: {zone.validation_status}</p>}
|
||||
{management && (
|
||||
<p>
|
||||
Versão {zone.version_no} · {zone.publication_status}
|
||||
</p>
|
||||
)}
|
||||
</article>
|
||||
))}
|
||||
{zone.legal_regime && (
|
||||
<p>
|
||||
Regime jurídico:{' '}
|
||||
{parkLabels[zone.legal_regime] ??
|
||||
(['zee', 'zfi'].includes(zone.legal_regime)
|
||||
? zone.legal_regime.toUpperCase()
|
||||
: 'Por confirmar')}
|
||||
</p>
|
||||
)}
|
||||
{zoneExtensionsAvailable && zone.development_status && (
|
||||
<p>
|
||||
Desenvolvimento:{' '}
|
||||
{parkLabels[zone.development_status] ??
|
||||
'Por confirmar'}
|
||||
</p>
|
||||
)}
|
||||
{zoneExtensionsAvailable &&
|
||||
zone.availability_status && (
|
||||
<p>
|
||||
Disponibilidade para instalação:{' '}
|
||||
{parkLabels[zone.availability_status] ??
|
||||
'Não informada'}
|
||||
</p>
|
||||
)}
|
||||
{zone.area_value && (
|
||||
<p>
|
||||
Área indicada: {zone.area_value}{' '}
|
||||
{zone.area_unit}
|
||||
</p>
|
||||
)}
|
||||
{zone.locations?.length ? (
|
||||
<p>
|
||||
Abrangência:{' '}
|
||||
{zone.locations
|
||||
.map((location) => location.name)
|
||||
.join(' · ')}
|
||||
</p>
|
||||
) : null}
|
||||
{zone.activities?.length ? (
|
||||
<p>
|
||||
Actividades:{' '}
|
||||
{zone.activities
|
||||
.map(
|
||||
(activity) =>
|
||||
`${activity.name} (${({ potential: 'Potencial referido pela fonte', proposed: 'Proposta', authorized: 'Autorizada por documento', conditional: 'Condicionada', excluded: 'Excluída' } as Record<string, string>)[activity.status] ?? 'Por confirmar'})`,
|
||||
)
|
||||
.join(' · ')}
|
||||
</p>
|
||||
) : null}
|
||||
{!!zone.source_evidence?.length && (
|
||||
<p>
|
||||
Fonte:{' '}
|
||||
{zone.source_evidence.map((source, index) => (
|
||||
<span key={source.url}>
|
||||
{index > 0 ? ' · ' : ''}
|
||||
<a
|
||||
className="underline"
|
||||
href={source.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{source.title}
|
||||
</a>
|
||||
{source.source_date
|
||||
? ` (${source.source_date})`
|
||||
: ' (data da fonte não informada)'}{' '}
|
||||
— {source.supports}
|
||||
</span>
|
||||
))}
|
||||
</p>
|
||||
)}
|
||||
{zone.category === 'industrial_park' && (
|
||||
<p>
|
||||
{zone.resources?.length
|
||||
? `${zone.resources.length} recursos descritos; consulte o âmbito e a fonte na ficha.`
|
||||
: 'Infraestruturas, serviços, acessos e capacidades: não informados.'}{' '}
|
||||
{!zone.activities?.length &&
|
||||
'Atividades: não informadas.'}
|
||||
</p>
|
||||
)}
|
||||
<p>{zone.description}</p>
|
||||
{management && (
|
||||
<p>Validação: {zone.validation_status}</p>
|
||||
)}
|
||||
{management && (
|
||||
<p>
|
||||
Versão {zone.version_no} ·{' '}
|
||||
{zone.publication_status}
|
||||
</p>
|
||||
)}
|
||||
</article>
|
||||
))}
|
||||
<nav aria-label="Paginação" className="flex gap-4 underline">
|
||||
{!searching && !searchError && records.prev_page_url && (
|
||||
<Link href={records.prev_page_url}>Anterior</Link>
|
||||
|
||||
Reference in New Issue
Block a user