fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { inputText } from '../../lib/input-text.ts';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export type Lot = { code: string; description: string; quantities: string };
|
||||
@@ -108,10 +109,12 @@ export function NoticeContent({ p }: { p: Payload }) {
|
||||
};
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
<h2 className="text-2xl font-semibold">{String(p.title ?? '')}</h2>
|
||||
<h2 className="text-2xl font-semibold">
|
||||
{inputText(p.title ?? '')}
|
||||
</h2>
|
||||
<p>
|
||||
<strong>Entidade:</strong>{' '}
|
||||
{String(p.organization_name ?? 'Por indicar')}
|
||||
{inputText(p.organization_name ?? 'Por indicar')}
|
||||
</p>
|
||||
<p>
|
||||
Regime:{' '}
|
||||
@@ -122,28 +125,30 @@ export function NoticeContent({ p }: { p: Payload }) {
|
||||
private: 'Concurso privado',
|
||||
other: 'Outro regime documentado',
|
||||
} as Record<string, string>
|
||||
)[String(p.regime)] ?? 'Por indicar'}
|
||||
)[inputText(p.regime)] ?? 'Por indicar'}
|
||||
</p>
|
||||
<section>
|
||||
<h3 className="text-lg font-semibold">
|
||||
Objecto e como participar
|
||||
</h3>
|
||||
<p className="whitespace-pre-wrap">{String(p.object ?? '')}</p>
|
||||
<p className="whitespace-pre-wrap">
|
||||
{inputText(p.object ?? '')}
|
||||
</p>
|
||||
<p className="my-2 rounded border p-3">
|
||||
<strong>Entrega:</strong>{' '}
|
||||
{String(p.deadline ?? 'Por indicar').replace('T', ' ')} ·{' '}
|
||||
{String(p.timezone ?? '')}
|
||||
{inputText(p.deadline ?? 'Por indicar').replace('T', ' ')} ·{' '}
|
||||
{inputText(p.timezone ?? '')}
|
||||
<br />
|
||||
{String(p.delivery_channel ?? '')} ·{' '}
|
||||
{String(p.delivery_address ?? '')}
|
||||
{inputText(p.delivery_channel ?? '')} ·{' '}
|
||||
{inputText(p.delivery_address ?? '')}
|
||||
</p>
|
||||
<p>
|
||||
Sector: {String(p.sector_name ?? 'Por indicar')} ·
|
||||
Localização: {String(p.territory_name ?? 'Por indicar')}
|
||||
Sector: {inputText(p.sector_name ?? 'Por indicar')} ·
|
||||
Localização: {inputText(p.territory_name ?? 'Por indicar')}
|
||||
</p>
|
||||
{p.project_name && (
|
||||
<p>
|
||||
Projecto relacionado: {String(p.project_name)}. Esta
|
||||
Projecto relacionado: {inputText(p.project_name)}. Esta
|
||||
relação não confirma execução ou contratação.
|
||||
</p>
|
||||
)}
|
||||
@@ -156,9 +161,10 @@ export function NoticeContent({ p }: { p: Payload }) {
|
||||
{p.deadline_previous && (
|
||||
<p className="rounded border p-3">
|
||||
<strong>Prorrogação:</strong> prazo anterior{' '}
|
||||
{String(p.deadline_previous).replace('T', ' ')} (
|
||||
{String(p.timezone_previous)}) → novo prazo{' '}
|
||||
{String(p.deadline).replace('T', ' ')} ({String(p.timezone)}
|
||||
{inputText(p.deadline_previous).replace('T', ' ')} (
|
||||
{inputText(p.timezone_previous)}) → novo prazo{' '}
|
||||
{inputText(p.deadline).replace('T', ' ')} (
|
||||
{inputText(p.timezone)}
|
||||
).
|
||||
</p>
|
||||
)}
|
||||
@@ -180,14 +186,15 @@ export function NoticeContent({ p }: { p: Payload }) {
|
||||
{links.includes(key) ? (
|
||||
<a
|
||||
className="underline"
|
||||
href={String(p[key])}
|
||||
href={inputText(p[key])}
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{String(p[key])}
|
||||
{inputText(p[key])}
|
||||
</a>
|
||||
) : (
|
||||
(
|
||||
names[String(p[key])] ?? String(p[key])
|
||||
names[inputText(p[key])] ??
|
||||
inputText(p[key])
|
||||
).replace(/^(\d{4}-\d{2}-\d{2})T/, '$1 ')
|
||||
)}
|
||||
</dd>
|
||||
@@ -244,8 +251,8 @@ export function NoticeContent({ p }: { p: Payload }) {
|
||||
<p className="rounded border p-3">
|
||||
O InvesteMoz divulga este acto e não recebe propostas nesta
|
||||
secção. Apresente a proposta no canal indicado nos documentos.
|
||||
Esta divulgação não substitui os meios oficiais exigidos,
|
||||
não comprova envio à UFSA ou ao financiador e não equivale à
|
||||
Esta divulgação não substitui os meios oficiais exigidos, não
|
||||
comprova envio à UFSA ou ao financiador e não equivale à
|
||||
execução do investimento.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user