Reconciliar fontes instaladas 423bd512d8c5 com main
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import SearchState from '@/components/search-state';
|
||||
import { useInterestDraft } from '@/hooks/use-interest-draft';
|
||||
import { createContext, useContext, useRef, useState } from 'react';
|
||||
import { router } from '@inertiajs/react';
|
||||
import { PortalMenu } from '@/layouts/portal-navigation';
|
||||
import { useTempoUi } from '@/components/tempo-brand';
|
||||
import { ProvinceSelect } from '@/components/investment-territory';
|
||||
import { MATURITY_LEVELS } from '@/lib/investment-maturity';
|
||||
import CountrySelect, { type Country } from '@/components/country-select';
|
||||
@@ -12,7 +13,6 @@ import {
|
||||
PortalApiError,
|
||||
fieldErrors,
|
||||
interestPayload,
|
||||
newSubmissionKey,
|
||||
money,
|
||||
portalRequest,
|
||||
searchUrl,
|
||||
@@ -95,6 +95,48 @@ function QueryStatus({
|
||||
/* Componentes */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
function TopBar({
|
||||
onNavigate,
|
||||
requestCount,
|
||||
}: {
|
||||
onNavigate: (view: View) => void;
|
||||
requestCount: number;
|
||||
}) {
|
||||
return (
|
||||
<nav
|
||||
aria-label="Navegação das manifestações"
|
||||
className="sticky top-0 z-30 border-b border-slate-200 bg-white/95 backdrop-blur"
|
||||
>
|
||||
<div className="mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-3 px-5 py-4">
|
||||
<button
|
||||
onClick={() => onNavigate('home')}
|
||||
className="flex items-baseline gap-1 font-black tracking-tight text-slate-900"
|
||||
>
|
||||
<span className="text-lg">INVESTE</span>
|
||||
<span className="text-lg text-emerald-700">Moçambique</span>
|
||||
</button>
|
||||
|
||||
<div className="flex items-center gap-3 text-xs text-slate-500">
|
||||
<a href="/investidor/manifestacoes" className="underline">
|
||||
O meu painel
|
||||
</a>
|
||||
<span className="hidden sm:inline">
|
||||
{requestCount} pedido{requestCount === 1 ? '' : 's'}{' '}
|
||||
recebido
|
||||
{requestCount === 1 ? '' : 's'}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => onNavigate('interest')}
|
||||
className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700"
|
||||
>
|
||||
Manifestar interesse
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
function Hero({
|
||||
query,
|
||||
setQuery,
|
||||
@@ -140,12 +182,6 @@ function Hero({
|
||||
>
|
||||
Explorar oportunidades <ArrowRight size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => onNavigate('interest')}
|
||||
className="rounded-lg border border-white/30 px-5 py-3 font-semibold text-white hover:bg-white/10"
|
||||
>
|
||||
Manifestar interesse
|
||||
</button>
|
||||
<a
|
||||
href="/simulador-fiscal"
|
||||
className="rounded-lg border border-emerald-300 px-5 py-3 font-semibold text-emerald-100 hover:bg-emerald-900"
|
||||
@@ -356,10 +392,11 @@ function OpportunitiesView({
|
||||
|
||||
return (
|
||||
<section className="mx-auto max-w-6xl px-5 py-12">
|
||||
<SearchState loading={query.loading} error={query.error} total={total} retry={query.retry} />
|
||||
<h1 className="text-3xl font-black text-slate-900">
|
||||
Oportunidades de investimento
|
||||
</h1>
|
||||
<p className="mt-2 text-slate-600">
|
||||
<p role="status" aria-live="polite" className="mt-2 text-slate-600">
|
||||
{query.loading ? (
|
||||
'A pesquisar oportunidades...'
|
||||
) : query.error ? (
|
||||
@@ -668,7 +705,7 @@ function InterestForm({
|
||||
const pending = useRef(false);
|
||||
const submission = useRef<{ body: string; key: string } | null>(null);
|
||||
const [submitError, setSubmitError] = useState<string | null>(null);
|
||||
const [form, setForm] = useState<InterestFormData>({
|
||||
const draft = useInterestDraft<InterestFormData>('opportunity:' + (preselected?.reference ?? 'general'), {
|
||||
name: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
@@ -681,6 +718,7 @@ function InterestForm({
|
||||
message: '',
|
||||
privacyConsent: false,
|
||||
});
|
||||
const { form, setForm } = draft;
|
||||
const [errors, setErrors] = useState<FormErrors>({});
|
||||
const [result, setResult] = useState<{ reference: string } | null>(null);
|
||||
|
||||
@@ -719,7 +757,7 @@ function InterestForm({
|
||||
try {
|
||||
const body = JSON.stringify(interestPayload(form));
|
||||
if (submission.current?.body !== body) {
|
||||
submission.current = { body, key: newSubmissionKey() };
|
||||
submission.current = { body, key: draft.key };
|
||||
}
|
||||
const response = await portalRequest<{
|
||||
success: boolean;
|
||||
@@ -737,9 +775,11 @@ function InterestForm({
|
||||
typeof response.data?.reference !== 'string'
|
||||
)
|
||||
throw new Error('Invalid confirmation');
|
||||
draft.clear();
|
||||
setResult({ reference: response.data.reference });
|
||||
onSubmitted();
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof PortalApiError && error.status === 401) { draft.authenticate(); return; }
|
||||
if (error instanceof PortalApiError) {
|
||||
setErrors(fieldErrors(error));
|
||||
setSubmitError(error.message);
|
||||
@@ -765,7 +805,7 @@ function InterestForm({
|
||||
A sua referência é <strong>{result.reference}</strong>. A
|
||||
equipa do portal irá analisar o pedido e poderá solicitar
|
||||
informação adicional.
|
||||
</p>
|
||||
</p><a href="/investidor/manifestacoes" className="mt-4 inline-block underline">Acompanhar manifestações</a>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1011,6 +1051,23 @@ function Field({
|
||||
);
|
||||
}
|
||||
|
||||
function Footer() {
|
||||
return (
|
||||
<footer className="border-t border-slate-200 bg-slate-950 py-10 text-slate-400">
|
||||
<div className="mx-auto max-w-6xl px-5 text-sm">
|
||||
<p className="font-bold text-white">INVESTE Moçambique</p>
|
||||
<p className="mt-2 max-w-md">
|
||||
Portal do Investidor — conheça as oportunidades de
|
||||
investimento em Moçambique e manifeste o seu interesse.{' '}
|
||||
<a href="/acesso-gestao" className="underline">
|
||||
Acesso à gestão
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* App */
|
||||
/* ------------------------------------------------------------------ */
|
||||
@@ -1038,7 +1095,7 @@ export default function PortalInvestidorApp({
|
||||
const selected = initialOpportunity
|
||||
? toOpportunity(initialOpportunity)
|
||||
: null;
|
||||
const { registerSubmittedInterest } = useTempoUi();
|
||||
const [requestCount, setRequestCount] = useState(0);
|
||||
const [heroQuery, setHeroQuery] = useState('');
|
||||
const [filters, setFilters] = useState<Filters>({
|
||||
query: initialQuery,
|
||||
@@ -1083,6 +1140,7 @@ export default function PortalInvestidorApp({
|
||||
return (
|
||||
<SectorContext.Provider value={sectors}>
|
||||
<div className="min-h-screen bg-slate-50 font-sans text-slate-900">
|
||||
{view !== 'home' && <TopBar onNavigate={navigate} requestCount={requestCount} />}
|
||||
<PortalMenu />
|
||||
<main>
|
||||
{view === 'home' && (
|
||||
@@ -1321,10 +1379,11 @@ export default function PortalInvestidorApp({
|
||||
key={selected?.reference ?? 'general'}
|
||||
preselected={selected}
|
||||
countries={countries}
|
||||
onSubmitted={registerSubmittedInterest}
|
||||
onSubmitted={() => setRequestCount((c) => c + 1)}
|
||||
/>
|
||||
)}
|
||||
</main>
|
||||
<Footer />
|
||||
|
||||
<style>{`
|
||||
.input {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { participationIdentity } from '@/lib/participation-identity';
|
||||
import { Form, Head, usePage } from '@inertiajs/react';
|
||||
import InputError from '@/components/input-error';
|
||||
import PasswordInput from '@/components/password-input';
|
||||
@@ -27,7 +28,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
const pageErrors = usePage<{ errors: { email?: string } }>().props.errors;
|
||||
return (
|
||||
<>
|
||||
<Head title="Log in" />
|
||||
<Head title="Entrar" />
|
||||
|
||||
{qaAccount && (
|
||||
<aside
|
||||
@@ -46,7 +47,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
)}
|
||||
|
||||
{/* @chisel-passkeys */}
|
||||
<PasskeyVerify />
|
||||
<PasskeyVerify label="Entrar com chave de acesso" loadingLabel="A autenticar…" separator="Ou continuar com email" />
|
||||
{/* @end-chisel-passkeys */}
|
||||
|
||||
<Form
|
||||
@@ -58,17 +59,16 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
<>
|
||||
<div className="grid gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">Email address</Label>
|
||||
<Label htmlFor="email">Email</Label>
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
name="email"
|
||||
required
|
||||
autoFocus
|
||||
tabIndex={1}
|
||||
autoComplete="email"
|
||||
placeholder="email@example.com"
|
||||
defaultValue={qaAccount?.email}
|
||||
defaultValue={qaAccount?.email ?? participationIdentity().email}
|
||||
/>
|
||||
<InputError
|
||||
message={errors.email ?? pageErrors.email}
|
||||
@@ -77,14 +77,14 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Label htmlFor="password">Palavra-passe</Label>
|
||||
{canResetPassword && (
|
||||
<TextLink
|
||||
href={request()}
|
||||
className="ml-auto text-sm"
|
||||
tabIndex={5}
|
||||
>
|
||||
Forgot your password?
|
||||
Esqueceu a palavra-passe?
|
||||
</TextLink>
|
||||
)}
|
||||
</div>
|
||||
@@ -94,7 +94,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
required
|
||||
tabIndex={2}
|
||||
autoComplete="current-password"
|
||||
placeholder="Password"
|
||||
placeholder="Palavra-passe"
|
||||
/>
|
||||
<InputError message={errors.password} />
|
||||
</div>
|
||||
@@ -105,7 +105,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
name="remember"
|
||||
tabIndex={3}
|
||||
/>
|
||||
<Label htmlFor="remember">Remember me</Label>
|
||||
<Label htmlFor="remember">Manter sessão iniciada</Label>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
@@ -116,15 +116,15 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
data-test="login-button"
|
||||
>
|
||||
{processing && <Spinner />}
|
||||
Log in
|
||||
Entrar
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* @chisel-registration */}
|
||||
<div className="text-muted-foreground text-center text-sm">
|
||||
Don't have an account?{' '}
|
||||
Ainda não tem conta?{' '}
|
||||
<TextLink href={register()} tabIndex={5}>
|
||||
Sign up
|
||||
Criar conta
|
||||
</TextLink>
|
||||
</div>
|
||||
{/* @end-chisel-registration */}
|
||||
@@ -142,6 +142,6 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
}
|
||||
|
||||
Login.layout = {
|
||||
title: 'Log in to your account',
|
||||
description: 'Enter your email and password below to log in',
|
||||
title: 'Entrar na sua conta',
|
||||
description: 'Entre para continuar a operação que escolheu. Os dados preenchidos permanecem guardados neste navegador.',
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { participationIdentity } from '@/lib/participation-identity';
|
||||
import { Form, Head } from '@inertiajs/react';
|
||||
import InputError from '@/components/input-error';
|
||||
import PasswordInput from '@/components/password-input';
|
||||
@@ -16,7 +17,7 @@ type Props = {
|
||||
export default function Register({ passwordRules }: Props) {
|
||||
return (
|
||||
<>
|
||||
<Head title="Register" />
|
||||
<Head title="Criar conta" />
|
||||
<Form
|
||||
{...store.form()}
|
||||
resetOnSuccess={['password', 'password_confirmation']}
|
||||
@@ -27,16 +28,16 @@ export default function Register({ passwordRules }: Props) {
|
||||
<>
|
||||
<div className="grid gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="name">Name</Label>
|
||||
<Label htmlFor="name">Nome</Label>
|
||||
<Input
|
||||
id="name"
|
||||
defaultValue={participationIdentity().name}
|
||||
type="text"
|
||||
required
|
||||
autoFocus
|
||||
tabIndex={1}
|
||||
autoComplete="name"
|
||||
name="name"
|
||||
placeholder="Full name"
|
||||
placeholder="Nome completo"
|
||||
/>
|
||||
<InputError
|
||||
message={errors.name}
|
||||
@@ -45,9 +46,10 @@ export default function Register({ passwordRules }: Props) {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">Email address</Label>
|
||||
<Label htmlFor="email">Email</Label>
|
||||
<Input
|
||||
id="email"
|
||||
defaultValue={participationIdentity().email}
|
||||
type="email"
|
||||
required
|
||||
tabIndex={2}
|
||||
@@ -59,14 +61,14 @@ export default function Register({ passwordRules }: Props) {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Label htmlFor="password">Palavra-passe</Label>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
required
|
||||
tabIndex={3}
|
||||
autoComplete="new-password"
|
||||
name="password"
|
||||
placeholder="Password"
|
||||
placeholder="Palavra-passe"
|
||||
passwordrules={passwordRules}
|
||||
/>
|
||||
<InputError message={errors.password} />
|
||||
@@ -74,7 +76,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="password_confirmation">
|
||||
Confirm password
|
||||
Confirmar palavra-passe
|
||||
</Label>
|
||||
<PasswordInput
|
||||
id="password_confirmation"
|
||||
@@ -82,7 +84,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
tabIndex={4}
|
||||
autoComplete="new-password"
|
||||
name="password_confirmation"
|
||||
placeholder="Confirm password"
|
||||
placeholder="Confirmar palavra-passe"
|
||||
passwordrules={passwordRules}
|
||||
/>
|
||||
<InputError
|
||||
@@ -97,14 +99,14 @@ export default function Register({ passwordRules }: Props) {
|
||||
data-test="register-user-button"
|
||||
>
|
||||
{processing && <Spinner />}
|
||||
Create account
|
||||
Criar conta
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="text-muted-foreground text-center text-sm">
|
||||
Already have an account?{' '}
|
||||
Já tem conta?{' '}
|
||||
<TextLink href={login()} tabIndex={6}>
|
||||
Log in
|
||||
Entrar
|
||||
</TextLink>
|
||||
</div>
|
||||
</>
|
||||
@@ -115,6 +117,6 @@ export default function Register({ passwordRules }: Props) {
|
||||
}
|
||||
|
||||
Register.layout = {
|
||||
title: 'Create an account',
|
||||
description: 'Enter your details below to create your account',
|
||||
title: 'Criar conta',
|
||||
description: 'Crie uma conta simples para continuar e acompanhar a sua operação. Não é necessário configurar MFA para participar.',
|
||||
};
|
||||
|
||||
@@ -190,9 +190,9 @@ export default function RequestPage({
|
||||
{request.protocol && (
|
||||
<a
|
||||
className="underline"
|
||||
href={`/balcao-virtual/pedidos/${request.id}/recibo`}
|
||||
href={`/balcao-virtual/pedidos/${request.id}/recibo?format=html`}
|
||||
>
|
||||
Descarregar recibo interno e snapshot
|
||||
Consultar e imprimir recibo interno
|
||||
</a>
|
||||
)}
|
||||
</section>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useInterestDraft } from '@/hooks/use-interest-draft';
|
||||
import { useRef, useState } from 'react';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import type { FormEvent } from 'react';
|
||||
@@ -38,7 +39,7 @@ export default function BusinessInterest({
|
||||
returnUrl = '/negocios',
|
||||
countries,
|
||||
}: Props) {
|
||||
const [form, setForm] = useState<Form>({
|
||||
const draft = useInterestDraft<Form>('business:' + record.id, {
|
||||
declared_origin_country_code: '',
|
||||
fullName: '',
|
||||
email: '',
|
||||
@@ -52,11 +53,12 @@ export default function BusinessInterest({
|
||||
privacyConsent: false,
|
||||
shareWithProponent: false,
|
||||
});
|
||||
const {form, setForm} = draft;
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const [fieldErrors, setFieldErrors] = useState<Partial<Record<keyof Form, string>>>({});
|
||||
const [receipt, setReceipt] = useState('');
|
||||
const key = useRef(newSubmissionKey());
|
||||
const key = useRef(draft.key);
|
||||
const update = <K extends keyof Form>(field: K, value: Form[K]) => {
|
||||
setForm((current) => ({ ...current, [field]: value }));
|
||||
setFieldErrors((current) => ({ ...current, [field]: undefined }));
|
||||
@@ -102,6 +104,7 @@ export default function BusinessInterest({
|
||||
existingBusinessId: record.id,
|
||||
}),
|
||||
});
|
||||
if (response.status === 401) { draft.authenticate(); return; }
|
||||
const data = await response.json();
|
||||
if (!response.ok) {
|
||||
const errors: Partial<Record<keyof Form, string>> = {};
|
||||
@@ -117,6 +120,7 @@ export default function BusinessInterest({
|
||||
return;
|
||||
}
|
||||
setFieldErrors({});
|
||||
draft.clear();
|
||||
setReceipt(data.data.reference);
|
||||
key.current = newSubmissionKey();
|
||||
} catch (cause) {
|
||||
@@ -140,7 +144,7 @@ export default function BusinessInterest({
|
||||
{receipt ? (
|
||||
<section className={card} role="status">
|
||||
<h2 className="text-xl font-bold">Pedido recebido</h2>
|
||||
<p>Referência: {receipt}</p>
|
||||
<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.
|
||||
|
||||
@@ -32,6 +32,7 @@ type Props = {
|
||||
record: Business;
|
||||
modalities: string[];
|
||||
formSchema: FormSchema;
|
||||
modalityFormType?: string | null;
|
||||
objects: BusinessObject[];
|
||||
objectKinds: string[];
|
||||
sectors: { id: number; name: string }[];
|
||||
@@ -176,42 +177,11 @@ function TerritoryField({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function opportunityTypeFor(modality: string): string {
|
||||
if (
|
||||
[
|
||||
'investment_project',
|
||||
'company_sale',
|
||||
'asset_sale',
|
||||
'business_partnership',
|
||||
'financing_request',
|
||||
'concession_opportunity',
|
||||
'supply_opportunity',
|
||||
].includes(modality)
|
||||
)
|
||||
return modality;
|
||||
if (['participation_sale'].includes(modality)) return 'company_sale';
|
||||
if (['asset_lease'].includes(modality)) return 'asset_sale';
|
||||
if (['capital_increase', 'financial_investor'].includes(modality))
|
||||
return 'financing_request';
|
||||
if (['strategic_partner', 'joint_venture'].includes(modality))
|
||||
return 'business_partnership';
|
||||
if (
|
||||
[
|
||||
'expansion',
|
||||
'agricultural_investment',
|
||||
'internationalization',
|
||||
].includes(modality)
|
||||
)
|
||||
return 'investment_project';
|
||||
if (['buyer_search', 'position_assignment'].includes(modality))
|
||||
return 'company_sale';
|
||||
return 'investment_project';
|
||||
}
|
||||
|
||||
export default function BusinessWizard({
|
||||
countries,
|
||||
record,
|
||||
formSchema,
|
||||
modalityFormType,
|
||||
objects,
|
||||
objectKinds,
|
||||
sectors,
|
||||
@@ -223,7 +193,7 @@ export default function BusinessWizard({
|
||||
...record.payload,
|
||||
opportunity_type:
|
||||
record.payload.opportunity_type ??
|
||||
opportunityTypeFor(record.modality),
|
||||
modalityFormType ?? '',
|
||||
wizard_version: '2',
|
||||
};
|
||||
if (
|
||||
@@ -236,9 +206,7 @@ export default function BusinessWizard({
|
||||
}
|
||||
return initial;
|
||||
});
|
||||
const [modality, setModality] = useState(
|
||||
record.payload.opportunity_type ?? opportunityTypeFor(record.modality),
|
||||
);
|
||||
const modality = record.modality;
|
||||
const [sectorId, setSectorId] = useState(record.sector_id ?? null);
|
||||
const [sectorSearch, setSectorSearch] = useState('');
|
||||
const [publicTitle, setPublicTitle] = useState(record.public_title ?? '');
|
||||
@@ -397,7 +365,6 @@ export default function BusinessWizard({
|
||||
);
|
||||
const update = (key: string, value: string) => {
|
||||
setError('');
|
||||
if (key === 'opportunity_type') setModality(value);
|
||||
setPayload((current) => {
|
||||
const next = { ...current, [key]: value };
|
||||
if (key === 'geography_scope' && value === 'multiple') {
|
||||
@@ -533,6 +500,8 @@ 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>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -14,6 +14,7 @@ import type { Country } from '@/components/country-select';
|
||||
type Props = {
|
||||
countries: Country[];
|
||||
formSchema: FormSchema;
|
||||
modalityFormType?: string | null;
|
||||
sectors: { id: number; name: string }[];
|
||||
record: Business;
|
||||
canEdit: boolean;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { usePortalQuery } from '@/hooks/use-portal-query';
|
||||
import SearchState from '@/components/search-state';
|
||||
import CatalogueNavigation from '@/components/catalogue-navigation';
|
||||
import { ClassificationFilters } from '@/components/opportunity-classification';
|
||||
import { Link, router, useForm, usePage } from '@inertiajs/react';
|
||||
@@ -114,9 +116,7 @@ export default function Catalogue({
|
||||
{ id: string; title: string; kind: string; url: string }[]
|
||||
>([]);
|
||||
const [error, setError] = useState('');
|
||||
const [suggestions, setSuggestions] = useState<
|
||||
{ title: string; slug: string }[]
|
||||
>([]);
|
||||
const [mapAttempt, setMapAttempt] = useState(0);
|
||||
const filterKey = JSON.stringify(filters);
|
||||
const draftFilterKey = JSON.stringify(form.data);
|
||||
const lastRequest = useRef(draftFilterKey);
|
||||
@@ -189,29 +189,9 @@ export default function Catalogue({
|
||||
return () => {
|
||||
active = false;
|
||||
};
|
||||
}, [view, filterKey]);
|
||||
useEffect(() => {
|
||||
if (form.data.q.length < 2) {
|
||||
setSuggestions([]);
|
||||
return;
|
||||
}
|
||||
let active = true;
|
||||
const timer = setTimeout(() => {
|
||||
api(
|
||||
`/api/v1/investment/suggest?q=${encodeURIComponent(form.data.q)}`,
|
||||
)
|
||||
.then((data) => {
|
||||
if (active) setSuggestions(data.opportunities);
|
||||
})
|
||||
.catch(() => {
|
||||
if (active) setSuggestions([]);
|
||||
});
|
||||
}, 300);
|
||||
return () => {
|
||||
active = false;
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, [form.data.q]);
|
||||
}, [view, filterKey, mapAttempt]);
|
||||
const suggestionQuery = usePortalQuery<{opportunities:{title:string;slug:string}[]}>(`/api/v1/investment/suggest?q=${encodeURIComponent(form.data.q)}`, 300);
|
||||
const currentSuggestions = form.data.q.length >= 2 ? suggestionQuery.data?.opportunities ?? [] : [];
|
||||
const query = () => {
|
||||
const params = new URLSearchParams();
|
||||
for (const [key, value] of Object.entries(filters)) {
|
||||
@@ -369,13 +349,14 @@ export default function Catalogue({
|
||||
aria-describedby="search-suggestions"
|
||||
/>
|
||||
</Field>
|
||||
{suggestions.length > 0 && (
|
||||
{form.data.q.length >= 2 && <SearchState loading={suggestionQuery.loading} error={suggestionQuery.error} total={currentSuggestions.length} retry={suggestionQuery.retry} />}
|
||||
{currentSuggestions.length > 0 && (
|
||||
<ul
|
||||
id="search-suggestions"
|
||||
aria-label="Sugestões de pesquisa"
|
||||
className="space-y-2"
|
||||
>
|
||||
{suggestions.map((s) => (
|
||||
{currentSuggestions.map((s) => (
|
||||
<li key={s.slug}>
|
||||
<Link
|
||||
href={`/oportunidades/${s.slug}`}
|
||||
@@ -1130,7 +1111,7 @@ export default function Catalogue({
|
||||
Favoritos e pedidos
|
||||
</Link>
|
||||
</div>
|
||||
{error && <p role="alert">{error}</p>}
|
||||
<SearchState loading={points === null && !error} error={error} total={(points?.length ?? 0) + unlocated.length} retry={() => setMapAttempt(value => value + 1)} />
|
||||
{!error && <Map points={points} areas={areas} />}
|
||||
{['map', 'combined'].includes(view) && (
|
||||
<TerritoryGeometryPreview
|
||||
|
||||
@@ -28,8 +28,10 @@ export default function EditContext({
|
||||
return (
|
||||
<Management title={'Contexto: ' + record.title}>
|
||||
<p>
|
||||
As relações e características são parte da ficha publicada.
|
||||
Guardar devolve-a a rascunho para revisão.
|
||||
Associações territoriais e produtivas ligam esta oportunidade a
|
||||
corredores, clusters e projectos; não substituem o registo de
|
||||
onde se localiza. As relações e características são parte da
|
||||
ficha publicada. Guardar devolve-a a rascunho para revisão.
|
||||
</p>
|
||||
<Link
|
||||
href={`/management/opportunities/${record.id}/edit`}
|
||||
@@ -37,6 +39,18 @@ export default function EditContext({
|
||||
>
|
||||
Editar e publicar a ficha principal
|
||||
</Link>
|
||||
<p>
|
||||
As localizações documentadas são preparadas nos recursos da
|
||||
ficha, reutilizando a hierarquia existente. As referências
|
||||
anteriores abaixo são preservadas; não constituem confirmação de
|
||||
implantação ou de regime especial.
|
||||
</p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/management/opportunities/${record.id}/resources`}
|
||||
>
|
||||
Onde se localiza — consultar ou documentar locais
|
||||
</Link>
|
||||
<form
|
||||
className="space-y-6"
|
||||
onSubmit={(e) => {
|
||||
@@ -78,7 +92,7 @@ export default function EditContext({
|
||||
'Clusters',
|
||||
'Corredores',
|
||||
'Projectos âncora',
|
||||
'Localizações',
|
||||
'Referências territoriais anteriores',
|
||||
][i]
|
||||
}
|
||||
</legend>
|
||||
|
||||
@@ -22,7 +22,8 @@ export default function Detail({
|
||||
returnUrl?: string;
|
||||
dossierOrigin?: { id: string; title: string } | null;
|
||||
}) {
|
||||
const { auth } = usePage<{ auth: { user: unknown } }>().props;
|
||||
const page = usePage<{ auth: { user: unknown } }>();
|
||||
const { auth } = page.props;
|
||||
const [sharing, setSharing] = useState('');
|
||||
return (
|
||||
<Frame title={r.title}>
|
||||
@@ -61,9 +62,7 @@ export default function Detail({
|
||||
<ClassificationSummary rows={c.classification ?? []} />
|
||||
<TerritorialSources sources={c.source_evidence} />
|
||||
<section className={card + ' space-y-3'}>
|
||||
<h2 className="text-xl font-bold">
|
||||
Implantação declarada da oportunidade
|
||||
</h2>
|
||||
<h2 className="text-xl font-bold">Onde se localiza</h2>
|
||||
<p>
|
||||
As relações cadastradas não confirmam disponibilidade ou
|
||||
capacidade. Locais dos projetos associados, áreas de impacto
|
||||
@@ -111,7 +110,7 @@ export default function Detail({
|
||||
Preparar manifestação de interesse
|
||||
</button>
|
||||
) : (
|
||||
<Link className={button} href="/login">
|
||||
<Link className={button} href={`/participar/entrar?return=${encodeURIComponent(page.url)}`}>
|
||||
Entrar para preparar manifestação
|
||||
</Link>
|
||||
)}
|
||||
@@ -237,7 +236,7 @@ export default function Detail({
|
||||
'Clusters',
|
||||
'Corredores',
|
||||
'Projectos âncora',
|
||||
'Territórios',
|
||||
'Referências territoriais anteriores',
|
||||
][i]
|
||||
}
|
||||
</h2>
|
||||
|
||||
@@ -9,6 +9,9 @@ import { Conversation } from './conversation';
|
||||
import type { Message } from './conversation';
|
||||
import CountrySelect, { type Country } from '@/components/country-select';
|
||||
type Payload = {
|
||||
simple_participation?: boolean;
|
||||
opportunity_title?: string;
|
||||
opportunity_reference?: string;
|
||||
full_name: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
@@ -82,7 +85,7 @@ type Props = {
|
||||
needs: Need[];
|
||||
attachments: { id: string; file_name: string }[];
|
||||
events: { action: string; version: number; created_at: string }[];
|
||||
receipt: { reference: string; status: string } | null;
|
||||
receipt: { reference: string; status: string; next_action?: string | null; next_action_due_at?: string | null } | null;
|
||||
target: string | null;
|
||||
management: boolean;
|
||||
messages: Message[];
|
||||
@@ -338,6 +341,16 @@ function Editor({
|
||||
)[receipt.status] ?? receipt.status}
|
||||
</p>
|
||||
)}
|
||||
{receipt?.next_action && <p role="status">Próxima acção: {receipt.next_action} {receipt.next_action_due_at && new Date(receipt.next_action_due_at).toLocaleDateString("pt-MZ")}</p>}
|
||||
{s.status === 'submitted' && s.payload.simple_participation ? <section className={card}>
|
||||
<h2 className="text-xl font-bold">Dados da manifestação</h2>
|
||||
<dl className="mt-3 space-y-3">{[
|
||||
['Nome', s.payload.full_name], ['Email', s.payload.email],
|
||||
['Telefone', s.payload.phone], ['País declarado', s.payload.country],
|
||||
['Sector', s.payload.sector], ['Oportunidade', target],
|
||||
['Mensagem', s.payload.objective],
|
||||
].filter(([,value]) => value).map(([label,value]) => <div key={label}><dt className="font-semibold">{label}</dt><dd className="whitespace-pre-wrap">{value}</dd></div>)}</dl>
|
||||
</section> : <>
|
||||
<nav
|
||||
aria-label="Etapas da manifestação"
|
||||
className="flex flex-wrap gap-2"
|
||||
@@ -1117,6 +1130,7 @@ function Editor({
|
||||
)}
|
||||
</section>
|
||||
)}
|
||||
</>}
|
||||
<details className={card}>
|
||||
<summary className="cursor-pointer font-bold">
|
||||
Histórico do pedido
|
||||
@@ -1130,7 +1144,7 @@ function Editor({
|
||||
draft_created: 'Rascunho criado',
|
||||
draft_saved: 'Rascunho guardado',
|
||||
attachment_added: 'Anexo acrescentado',
|
||||
submitted: 'Submetido',
|
||||
submitted: 'Submetido', received: 'Recebido', in_review: 'Em análise', contacted: 'Contactado', closed: 'Encerrado',
|
||||
} as Record<string, string>
|
||||
)[e.action] ?? e.action}{' '}
|
||||
· versão {e.version}
|
||||
|
||||
@@ -123,7 +123,15 @@ export default function Zones({
|
||||
Parques industriais
|
||||
</Link>
|
||||
</nav>
|
||||
<form method="get" className={card + ' grid gap-4 md:grid-cols-3'}>
|
||||
<form method="get" onSubmit={event => {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const url = new URL(form.action);
|
||||
const params = new URLSearchParams();
|
||||
for (const [name, value] of new FormData(form)) if (typeof value === 'string') params.append(name, value);
|
||||
url.search = params.toString();
|
||||
router.get(url.toString(), {}, {preserveState: true, preserveScroll: true});
|
||||
}} className={card + ' grid gap-4 md:grid-cols-3'}>
|
||||
<Field label="Pesquisar por nome ou código">
|
||||
<input
|
||||
className={input}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { Frame, card, input, button } from '@/pages/investment/shared';
|
||||
@@ -26,6 +27,7 @@ export default function ContextStart({
|
||||
dossier. A referência é para preparação e não confirma direitos
|
||||
ou benefícios.
|
||||
</p>
|
||||
<ContextDocuments source={source ?? undefined} />
|
||||
{source && (
|
||||
<section className={card}>
|
||||
<h2 className="font-bold">Origem consultada</h2>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { Frame, button, card, input } from '@/pages/investment/shared';
|
||||
@@ -130,6 +131,7 @@ export default function ContextEditor({
|
||||
}
|
||||
return (
|
||||
<Frame title="Contexto do investimento">
|
||||
<ContextDocuments source={view.context.selection.opportunity} />
|
||||
<div className="space-y-5 [overflow-wrap:anywhere]">
|
||||
<Link
|
||||
className="underline"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import ContextDocuments from '@/components/context-documents';
|
||||
import type { DossierContext } from '@/lib/investor-context';
|
||||
import FintechInvestment, {
|
||||
type FintechView,
|
||||
@@ -411,6 +412,9 @@ export default function InvestmentPath(path: Path) {
|
||||
Os meus investimentos
|
||||
</Link>
|
||||
<h1 className="text-2xl font-semibold">{path.case.title}</h1>
|
||||
<ContextDocuments
|
||||
source={path.investment_context?.selection.opportunity}
|
||||
/>
|
||||
{path.investment_context && (
|
||||
<section className="space-y-2 rounded border border-emerald-300 bg-emerald-50 p-4">
|
||||
<h2 className="font-semibold">
|
||||
|
||||
@@ -22,13 +22,13 @@ export default function PrintCase({
|
||||
const p = record.payload ?? {};
|
||||
const text = (value: unknown): string =>
|
||||
value === null || value === undefined || value === ''
|
||||
? '—'
|
||||
? 'Não informado'
|
||||
: Array.isArray(value)
|
||||
? value.map(text).join(', ')
|
||||
: typeof value === 'object'
|
||||
? Object.values(value as Record<string, unknown>)
|
||||
.map(text)
|
||||
.filter((x) => x !== '—')
|
||||
.filter((x) => x !== 'Não informado')
|
||||
.join(' · ')
|
||||
: displayValue(value);
|
||||
return (
|
||||
@@ -45,7 +45,7 @@ export default function PrintCase({
|
||||
</button>
|
||||
</div>
|
||||
<header className="space-y-2 border-b pb-4">
|
||||
<p>InvestMoz · modelo de preparação · {modelVersion}</p>
|
||||
<p>InvesteMoz · modelo de preparação · {modelVersion}</p>
|
||||
<h1 className="text-2xl font-bold">
|
||||
Terra e DUAT — dados preenchidos pelo requerente
|
||||
</h1>
|
||||
@@ -56,7 +56,7 @@ export default function PrintCase({
|
||||
</p>
|
||||
<p className="font-semibold">{disclaimer}</p>
|
||||
<p>
|
||||
Esta cópia reflecte os dados guardados no InvestMoz e não é
|
||||
Esta cópia reflecte os dados guardados no InvesteMoz e não é
|
||||
requerimento oficialmente recebido, título, parecer, prova
|
||||
de consulta ou decisão.
|
||||
</p>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Head, router, usePage } from '@inertiajs/react';
|
||||
import { useRef, useState } from 'react';
|
||||
type Row={id:string;protocol:string;status:string;version:number;analyst_id:number|null;due_at:string|null;etag?:string};
|
||||
export default function DeskAssignments(){
|
||||
const {requests,analysts,kind,flash}=usePage<{requests:Row[];analysts:{id:number;name:string}[];kind?:'interest';flash?:{success?:string}}>().props;
|
||||
const alertRef=useRef<HTMLDivElement>(null);
|
||||
const stateNames:Record<string,string>={received:'Recebido',submitted:'Submetido',in_review:'Em revisão',reviewed:'Revisto',qualification:'Em qualificação',qualified:'Qualificado',contacted:'Contactado',contact_accepted:'Contacto aceite',referred:'Encaminhado',due_diligence:'Em diligência',negotiation:'Em negociação',pending:'Pendente',accepted:'Aceite',rejected:'Recusado',returned:'Devolvido',processing:'Em tratamento',draft:'Rascunho'};
|
||||
const title=kind==='interest'?'Atribuições de interesses':'Atribuições do Balcão';
|
||||
const [selected,setSelected]=useState<Record<string,string>>({});
|
||||
const [reason,setReason]=useState<Record<string,string>>({});
|
||||
const [errors,setErrors]=useState<Record<string,string>>({});
|
||||
const [busy,setBusy]=useState<string|null>(null);
|
||||
function assign(row:Row){setBusy(row.id);setErrors({});router.post(kind==='interest'?`/management/interests/${row.id}/responsavel`:`/balcao-virtual/pedidos/${row.id}/responsavel`,{...(kind==='interest'?{etag:row.etag}:{version:row.version}),analyst_id:selected[row.id]??String(row.analyst_id??''),reason:reason[row.id]??''},{preserveScroll:true,onError:e=>{setErrors(e);queueMicrotask(()=>alertRef.current?.focus());},onFinish:()=>setBusy(null)});}
|
||||
return <main className="mx-auto max-w-5xl space-y-6 p-6"><Head title={title}/><h1 className="text-2xl font-semibold">{title}</h1><p>Atribua o acompanhamento de um pedido. Esta lista não dá acesso ao conteúdo privado do dossier. O proponente não pode ser designado como analista do seu pedido.</p><a href={kind==='interest'?'/management/interests':'/balcao-virtual/painel'} className="underline">{kind==='interest'?'Interesses atribuídos':'Voltar ao Balcão'}</a><div ref={alertRef} role="alert" tabIndex={-1}>{Object.values(errors).join(' ')}</div>{flash?.success&&<p role="status">{flash.success}</p>}{requests.length===0?<p>Não há pedidos para atribuir.</p>:requests.map(row=><section key={row.id} className="space-y-3 rounded border p-4"><h2 className="font-semibold">{row.protocol||row.id}</h2><p>Estado: {stateNames[row.status]??'Por esclarecer'}</p><label className="block">Responsável<select className="ml-2 border p-2" value={selected[row.id]??String(row.analyst_id??'')} onChange={e=>setSelected({...selected,[row.id]:e.target.value})}><option value="">Seleccione</option>{analysts.map(a=><option key={a.id} value={a.id}>{a.name}</option>)}</select></label><label className="block">Fundamento<textarea className="block w-full border p-2" value={reason[row.id]??''} onChange={e=>setReason({...reason,[row.id]:e.target.value})}/></label><button className="rounded bg-emerald-900 px-4 py-2 text-white" disabled={busy!==null} onClick={()=>assign(row)}>{busy===row.id?'A guardar…':'Guardar atribuição'}</button></section>)}</main>;
|
||||
}
|
||||
@@ -245,6 +245,14 @@ export default function OpportunityDraft({
|
||||
<Link href={basePath}>
|
||||
{profileMode ? 'Minhas oportunidades' : 'Voltar à gestão'}
|
||||
</Link>
|
||||
{record && (
|
||||
<Link
|
||||
href={`/investimentos/iniciar?source=opportunity:${record.id}`}
|
||||
className={button}
|
||||
>
|
||||
Preparar ou continuar investimento com esta ficha
|
||||
</Link>
|
||||
)}
|
||||
{profileMode && (
|
||||
<section
|
||||
aria-label="Âmbito desta entrega"
|
||||
@@ -459,7 +467,18 @@ export default function OpportunityDraft({
|
||||
disabled={busy || readOnly || unavailable}
|
||||
className="space-y-4"
|
||||
>
|
||||
<section aria-label="Localização registada">
|
||||
<section aria-label="Onde se localiza — referência principal">
|
||||
<h2 className="font-semibold">
|
||||
Onde se localiza — referência principal
|
||||
</h2>
|
||||
<p>
|
||||
Seleccione o território conhecido. Endereço,
|
||||
geometria e locais adicionais documentados podem
|
||||
ser preparados em Localizações, reutilizando
|
||||
esta hierarquia. Uma referência provincial não
|
||||
determina distrito, coordenadas ou pertença a
|
||||
uma associação.
|
||||
</p>
|
||||
<TerritoryGeometryPreview
|
||||
territoryId={path.at(-1)?.id}
|
||||
management
|
||||
@@ -863,7 +882,7 @@ export default function OpportunityDraft({
|
||||
)}
|
||||
{record && !profileMode && (
|
||||
<Link href={`${basePath}/${record.id}/context`}>
|
||||
Consultar projetos, clusters e relações existentes
|
||||
Associações territoriais e produtivas existentes
|
||||
</Link>
|
||||
)}
|
||||
{profileMode && canonicalOptions && (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import OpportunityLibraryReuse, {
|
||||
type LibrarySource,
|
||||
} from '@/components/opportunity-library-reuse';
|
||||
import { createOperationKey } from '@/lib/operation-key';
|
||||
import { valueText } from '@/lib/value-text';
|
||||
import { Link, router, usePage } from '@inertiajs/react';
|
||||
@@ -69,7 +72,7 @@ const fields: Record<Kind, string[]> = {
|
||||
const labels: Record<string, string> = {
|
||||
role: 'Papel da localização',
|
||||
imageRole: 'Tipo de imagem',
|
||||
territorial_purpose: 'Natureza da relação territorial',
|
||||
territorial_purpose: 'Finalidade deste local',
|
||||
rights_status: 'Direitos de utilização',
|
||||
visibility: 'Âmbito de consulta',
|
||||
classification: 'Classificação documental',
|
||||
@@ -98,6 +101,20 @@ const labels: Record<string, string> = {
|
||||
section: 'Página / secção',
|
||||
supported_statement: 'Afirmação fundamentada',
|
||||
};
|
||||
const localLabels: Record<string, string> = {
|
||||
implementation: 'Implantação',
|
||||
context: 'Contexto',
|
||||
impact: 'Impacto',
|
||||
coverage: 'Abrangência',
|
||||
headquarters: 'Sede',
|
||||
production: 'Produção',
|
||||
raw_material: 'Matéria-prima',
|
||||
storage: 'Armazenagem',
|
||||
logistics: 'Logística',
|
||||
market: 'Mercado',
|
||||
support: 'Apoio',
|
||||
other: 'Outro',
|
||||
};
|
||||
const choices: Record<string, string[]> = {
|
||||
role: [
|
||||
'headquarters',
|
||||
@@ -133,6 +150,8 @@ export default function OpportunityResources({
|
||||
existingLocations,
|
||||
assessment,
|
||||
imageProcessingAvailable,
|
||||
librarySources = [],
|
||||
locationReference = { path: [], differences: [] },
|
||||
}: {
|
||||
opportunity: {
|
||||
id: number;
|
||||
@@ -145,6 +164,11 @@ export default function OpportunityResources({
|
||||
existingLocations: { id: string; name: string; location_type: string }[];
|
||||
assessment: string[];
|
||||
imageProcessingAvailable: boolean;
|
||||
librarySources?: LibrarySource[];
|
||||
locationReference?: {
|
||||
path: TerritoryOption[];
|
||||
differences: { resource_id: string; title: string; message: string }[];
|
||||
};
|
||||
}) {
|
||||
const {
|
||||
basePath = '/management/opportunities',
|
||||
@@ -322,11 +346,79 @@ export default function OpportunityResources({
|
||||
</p>
|
||||
)}
|
||||
{kind !== 'locations' && (
|
||||
<section aria-label="Privacidade dos anexos" className="rounded border p-3">
|
||||
<section
|
||||
aria-label="Privacidade dos anexos"
|
||||
className="rounded border p-3"
|
||||
>
|
||||
<h2>Privacidade dos anexos</h2>
|
||||
<p>Os anexos pertencem à oportunidade. Podem ser consultados pelos Promotores autorizados da organização, pelos Validadores e Publicadores com acesso ao tipo e âmbito e pelos Auditores autorizados. O Superutilizador precisa também de perfil operacional no âmbito e de elevação temporária para consulta, aprovada por outro titular. O gestor da biblioteca, por si só, não obtém esse acesso.</p>
|
||||
<p>Classificação e âmbito de consulta são metadados; escolher «public» ou «authenticated» não divulga o ficheiro. Publicar o anúncio não publica os anexos. A retirada lógica impede a entrega do ficheiro; a revogação do perfil impede acessos futuros.</p>
|
||||
<p>Partilhar um anexo com um destinatário individual ou restringi-lo a alguns membros da organização permanece indisponível. Não guarde neste fluxo um ficheiro que exija essa restrição individual. Não é possível retirar cópias já descarregadas.</p>
|
||||
<p>
|
||||
Os anexos pertencem à oportunidade. Podem ser
|
||||
consultados pelos Promotores autorizados da organização,
|
||||
pelos Validadores e Publicadores com acesso ao tipo e
|
||||
âmbito e pelos Auditores autorizados. O Superutilizador
|
||||
precisa também de perfil operacional no âmbito e de
|
||||
elevação temporária para consulta, aprovada por outro
|
||||
titular. O gestor da biblioteca, por si só, não obtém
|
||||
esse acesso.
|
||||
</p>
|
||||
<p>
|
||||
Classificação e âmbito de consulta são metadados;
|
||||
escolher «public» ou «authenticated» não divulga o
|
||||
ficheiro. Publicar o anúncio não publica os anexos. A
|
||||
retirada lógica impede a entrega do ficheiro; a
|
||||
revogação do perfil impede acessos futuros.
|
||||
</p>
|
||||
<p>
|
||||
Partilhar um anexo com um destinatário individual ou
|
||||
restringi-lo a alguns membros da organização permanece
|
||||
indisponível. Não guarde neste fluxo um ficheiro que
|
||||
exija essa restrição individual. Não é possível retirar
|
||||
cópias já descarregadas.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
{kind === 'locations' && (
|
||||
<section
|
||||
aria-label="Onde se localiza"
|
||||
className="space-y-3 rounded border p-4"
|
||||
>
|
||||
<h2 className="text-xl font-semibold">Onde se localiza</h2>
|
||||
<p>
|
||||
Registe o local principal e os locais adicionais
|
||||
documentados: país, hierarquia territorial, endereço e
|
||||
geometria ou parcela quando conhecidos. Indique a
|
||||
finalidade de cada local: implantação, abrangência,
|
||||
impacto ou contexto. Uma área de contexto não comprova
|
||||
implantação.
|
||||
</p>
|
||||
<p>
|
||||
Referência principal já guardada:{' '}
|
||||
{locationReference.path.length
|
||||
? locationReference.path
|
||||
.map((item) => item.name)
|
||||
.join(' → ')
|
||||
: 'Não indicada'}
|
||||
. Os níveis em falta continuam desconhecidos.
|
||||
</p>
|
||||
<p>
|
||||
Pode guardar a preparação incompleta. No percurso de
|
||||
submissão existente são conferidos distrito, papel,
|
||||
indicação de principal e uma única localização principal
|
||||
seleccionada; área e unidade devem ser coerentes quando
|
||||
preenchidas. Não se acrescentam obrigatoriedades ao
|
||||
guardar este recurso.
|
||||
</p>
|
||||
{locationReference.differences.map((item) => (
|
||||
<p role="status" key={item.resource_id}>
|
||||
{item.title}: {item.message}
|
||||
</p>
|
||||
))}
|
||||
<p>
|
||||
Corredores, clusters, ZEE, ZFI, parques e projectos
|
||||
associados são descritos nas associações da ficha, com
|
||||
finalidade, fonte e estado próprios. Estar num distrito
|
||||
não confirma pertença a nenhum deles.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
<section>
|
||||
@@ -339,7 +431,11 @@ export default function OpportunityResources({
|
||||
</section>
|
||||
{existingLocations.length > 0 && (
|
||||
<section>
|
||||
<h2>Ligações territoriais existentes preservadas</h2>
|
||||
<h2>Referências territoriais anteriores — preservadas</h2>
|
||||
<p>
|
||||
Estas referências não são novas associações confirmadas
|
||||
nem obrigam a repetir o preenchimento.
|
||||
</p>
|
||||
{existingLocations.map((r) => (
|
||||
<p key={r.id}>
|
||||
{r.name} · {r.location_type}
|
||||
@@ -347,6 +443,13 @@ export default function OpportunityResources({
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
{!readOnly && kind === 'documents' && (
|
||||
<OpportunityLibraryReuse
|
||||
sources={librarySources}
|
||||
action={`${basePath}/${opportunity.id}/library-support`}
|
||||
etag={etag}
|
||||
/>
|
||||
)}
|
||||
<nav className="flex flex-wrap gap-3">
|
||||
{(['locations', 'images', 'documents'] as Kind[]).map((k) => (
|
||||
<button
|
||||
@@ -377,6 +480,12 @@ export default function OpportunityResources({
|
||||
? 'eliminado logicamente'
|
||||
: 'rascunho'}
|
||||
</p>
|
||||
{!!r.payload.library_source && (
|
||||
<p>
|
||||
Original da biblioteca reutilizado; edição e
|
||||
hash preservados, sem cópia dos bytes.
|
||||
</p>
|
||||
)}
|
||||
{r.file && (
|
||||
<p className="break-all">
|
||||
Scan: {r.file.malware_scan_status} · motor:{' '}
|
||||
@@ -437,6 +546,39 @@ export default function OpportunityResources({
|
||||
</h2>
|
||||
{kind === 'locations' && (
|
||||
<div>
|
||||
{locationReference.path.length > 0 && (
|
||||
<div className="my-3 rounded border p-3">
|
||||
<button
|
||||
type="button"
|
||||
className={button}
|
||||
disabled={
|
||||
readOnly ||
|
||||
Boolean(editing) ||
|
||||
path.length > 0 ||
|
||||
foreignCountry
|
||||
}
|
||||
onClick={() => {
|
||||
setPath(locationReference.path);
|
||||
setPayload((previous) => ({
|
||||
...previous,
|
||||
country_code: 'MZ',
|
||||
}));
|
||||
setMessage(
|
||||
'Hierarquia principal reutilizada no preenchimento. Só foi reutilizada a hierarquia: coordenadas e parcela não foram copiadas. Papel, finalidade, fonte e indicação de principal continuam sob a sua escolha; nada foi guardado automaticamente.',
|
||||
);
|
||||
}}
|
||||
>
|
||||
Reutilizar hierarquia principal guardada
|
||||
</button>
|
||||
<p>
|
||||
Use-a quando documentar o mesmo território.
|
||||
Para um local diferente, escolha outra
|
||||
hierarquia. A reutilização não substitui um
|
||||
local em edição, um país estrangeiro ou uma
|
||||
selecção já preenchida.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<Field
|
||||
label="País da localização"
|
||||
error={errors.country_code}
|
||||
@@ -549,6 +691,7 @@ export default function OpportunityResources({
|
||||
key={key}
|
||||
aria-label="Original / substituir por nova versão"
|
||||
type="file"
|
||||
disabled={!!editing?.payload.library_source}
|
||||
accept={
|
||||
kind === 'images'
|
||||
? '.jpg,.jpeg,.png,.webp'
|
||||
@@ -619,7 +762,11 @@ export default function OpportunityResources({
|
||||
>
|
||||
<option value="">Pendente</option>
|
||||
{choices[name].map((option) => (
|
||||
<option key={option}>{option}</option>
|
||||
<option key={option} value={option}>
|
||||
{kind === 'locations'
|
||||
? (localLabels[option] ?? option)
|
||||
: option}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</Field>
|
||||
@@ -679,30 +826,53 @@ export default function OpportunityResources({
|
||||
</Field>
|
||||
),
|
||||
)}
|
||||
{kind !== 'documents' && (
|
||||
{kind === 'locations' && (
|
||||
<Field
|
||||
label="Local principal ou adicional"
|
||||
error={errors.is_primary}
|
||||
>
|
||||
<select
|
||||
aria-label="Local principal ou adicional"
|
||||
className={control}
|
||||
disabled={readOnly}
|
||||
value={
|
||||
typeof payload.is_primary === 'boolean'
|
||||
? payload.is_primary
|
||||
? 'primary'
|
||||
: 'additional'
|
||||
: ''
|
||||
}
|
||||
onChange={(event) =>
|
||||
set(
|
||||
'is_primary',
|
||||
event.target.value === ''
|
||||
? null
|
||||
: event.target.value === 'primary',
|
||||
)
|
||||
}
|
||||
>
|
||||
<option value="">Por indicar</option>
|
||||
<option value="primary">Principal</option>
|
||||
<option value="additional">Adicional</option>
|
||||
</select>
|
||||
<p>
|
||||
A escolha identifica o papel do local nesta ficha;
|
||||
não confirma a sua implantação nem uma associação
|
||||
territorial.
|
||||
</p>
|
||||
</Field>
|
||||
)}
|
||||
{kind === 'images' && (
|
||||
<label>
|
||||
<input
|
||||
key={key}
|
||||
type="checkbox"
|
||||
checked={
|
||||
!!payload[
|
||||
kind === 'images'
|
||||
? 'is_cover'
|
||||
: 'is_primary'
|
||||
]
|
||||
}
|
||||
checked={!!payload.is_cover}
|
||||
onChange={(event) =>
|
||||
set(
|
||||
kind === 'images'
|
||||
? 'is_cover'
|
||||
: 'is_primary',
|
||||
event.target.checked,
|
||||
)
|
||||
set('is_cover', event.target.checked)
|
||||
}
|
||||
/>
|
||||
{kind === 'images'
|
||||
? 'Selecionar capa de preparação'
|
||||
: 'Localização principal'}
|
||||
Selecionar capa de preparação
|
||||
</label>
|
||||
)}
|
||||
<Field
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import SearchState from '@/components/search-state';
|
||||
import { useEffect, useState } from 'react';
|
||||
import InvestmentTerritory from '@/components/investment-territory';
|
||||
import { Management, Field, control } from './shared';
|
||||
@@ -10,8 +11,11 @@ export default function TerritoryAssociations() {
|
||||
const [rows, setRows] = useState<{ id: string; name: string }[]>([]);
|
||||
const [more, setMore] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [retry, setRetry] = useState(0);
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
setLoading(true); setError(''); setRows([]);
|
||||
const timer = setTimeout(async () => {
|
||||
try {
|
||||
const params = new URLSearchParams({
|
||||
@@ -31,21 +35,22 @@ export default function TerritoryAssociations() {
|
||||
'Não foi possível carregar os investimentos.',
|
||||
);
|
||||
const data = await response.json();
|
||||
if (controller.signal.aborted) return;
|
||||
setRows(data.data);
|
||||
setMore(Boolean(data.next_page_url));
|
||||
setError('');
|
||||
} catch (e) {
|
||||
} catch {
|
||||
if (!controller.signal.aborted)
|
||||
setError(
|
||||
e instanceof Error ? e.message : 'Erro de ligação.',
|
||||
'Não foi possível concluir a pesquisa.',
|
||||
);
|
||||
}
|
||||
} finally { if (!controller.signal.aborted) setLoading(false); }
|
||||
}, 250);
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
controller.abort();
|
||||
};
|
||||
}, [kind, q, page]);
|
||||
}, [kind, q, page, retry]);
|
||||
return (
|
||||
<Management title="Localizações dos investimentos">
|
||||
<Field label="Tipo de investimento">
|
||||
@@ -71,6 +76,7 @@ export default function TerritoryAssociations() {
|
||||
<option value="opportunities">Oportunidades</option>
|
||||
</select>
|
||||
</Field>
|
||||
<SearchState loading={loading} error={error} total={rows.length} retry={() => setRetry(value => value + 1)} />
|
||||
<Field label="Pesquisar investimento">
|
||||
<input
|
||||
className={control}
|
||||
|
||||
@@ -162,8 +162,12 @@ export default function Manage({
|
||||
requirementAssociationsEnabled,
|
||||
disclosureAuthorization,
|
||||
legacyContentEnabled = false,
|
||||
documentAccessOnly = false,
|
||||
editorialScopeOnly = false,
|
||||
}: {
|
||||
legacyContentEnabled?: boolean;
|
||||
documentAccessOnly?: boolean;
|
||||
editorialScopeOnly?: boolean;
|
||||
documents: DocumentFile[];
|
||||
resources: Resource[];
|
||||
requirementCatalogue: { key: string; label: string; tax: string }[];
|
||||
@@ -221,10 +225,14 @@ export default function Manage({
|
||||
);
|
||||
|
||||
return (
|
||||
<Management title="Biblioteca documental e Bolsa de Parcerias">
|
||||
<Management title={documentAccessOnly ? "Os meus ficheiros privados" : editorialScopeOnly ? "Gestão editorial do acervo autorizado" : "Biblioteca documental e Bolsa de Parcerias"}>
|
||||
{documentAccessOnly && <p>Carregue e consulte os seus ficheiros. Este acesso não permite publicar nem consultar ficheiros privados de outras contas.</p>}
|
||||
{!documentAccessOnly && <>
|
||||
{!editorialScopeOnly && <>
|
||||
<a className="underline" href="/management/editorial-installation">
|
||||
Estado da gestão editorial
|
||||
</a>
|
||||
</>}
|
||||
<section
|
||||
className="rounded border border-amber-700 bg-amber-50 p-4"
|
||||
aria-live="polite"
|
||||
@@ -236,6 +244,7 @@ export default function Manage({
|
||||
para revisão. A contagem não é certificação documental.
|
||||
</p>
|
||||
</section>
|
||||
</>}
|
||||
<section
|
||||
className="space-y-3 rounded border p-5"
|
||||
aria-label="Estado antimalware"
|
||||
@@ -410,6 +419,7 @@ export default function Manage({
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{!documentAccessOnly && <>
|
||||
<form
|
||||
className="space-y-4 rounded border p-5"
|
||||
onSubmit={(e) => {
|
||||
@@ -1398,6 +1408,7 @@ export default function Manage({
|
||||
</button>
|
||||
</article>
|
||||
))}
|
||||
</>}
|
||||
</Management>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1307,6 +1307,16 @@ export default function Services(p: Props) {
|
||||
</>
|
||||
)}
|
||||
</main>
|
||||
<footer className="border-t px-5 py-8 text-center text-sm">
|
||||
Investe Moçambique ·{' '}
|
||||
<Link href="/apoio" className="underline">
|
||||
Apoio ao Investidor
|
||||
</Link>{' '}
|
||||
·{' '}
|
||||
<Link href="/documentos" className="underline">
|
||||
Documentos e Formulários
|
||||
</Link>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user