oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
+23 -23
View File
@@ -1,9 +1,9 @@
import { Link, router } from "@inertiajs/react";
import { useState } from "react";
import TerritoryGeometryPreview from "@/components/territory-geometry-preview";
import { Link, router } from '@inertiajs/react';
import { useState } from 'react';
import TerritoryGeometryPreview from '@/components/territory-geometry-preview';
import InteractiveInvestmentMap, {
type InvestmentMapFeature,
} from "@/components/interactive-investment-map";
} from '@/components/interactive-investment-map';
import {
Frame,
Field,
@@ -11,10 +11,10 @@ import {
button,
type Catalogues,
type Partnership,
} from "./shared";
} from './shared';
type Result = Pick<
Partnership,
"id" | "title" | "kind" | "partnership_type" | "deadline"
'id' | 'title' | 'kind' | 'partnership_type' | 'deadline'
> & { summary: string | null; province: string; sector: string };
export default function Catalogue(
p: Catalogues & {
@@ -42,22 +42,22 @@ export default function Catalogue(
className="grid gap-4 rounded border p-5 md:grid-cols-3"
onSubmit={(e) => {
e.preventDefault();
router.get("/parcerias", filters);
router.get('/parcerias', filters);
}}
>
<Field label="Pesquisar">
<input
className={control}
value={filters.q ?? ""}
onChange={(e) => set("q", e.target.value)}
value={filters.q ?? ''}
onChange={(e) => set('q', e.target.value)}
/>
</Field>
<Field label="Tipo de parceria">
<select
className={control}
value={filters.partnership_type ?? ""}
value={filters.partnership_type ?? ''}
onChange={(e) =>
set("partnership_type", e.target.value)
set('partnership_type', e.target.value)
}
>
<option value="">Todos</option>
@@ -71,8 +71,8 @@ export default function Catalogue(
<Field label="Oferta ou procura">
<select
className={control}
value={filters.kind ?? ""}
onChange={(e) => set("kind", e.target.value)}
value={filters.kind ?? ''}
onChange={(e) => set('kind', e.target.value)}
>
<option value="">Ambas</option>
<option value="offering">Oferta</option>
@@ -82,8 +82,8 @@ export default function Catalogue(
<Field label="Setor">
<select
className={control}
value={filters.sector_id ?? ""}
onChange={(e) => set("sector_id", e.target.value)}
value={filters.sector_id ?? ''}
onChange={(e) => set('sector_id', e.target.value)}
>
<option value="">Todos</option>
{p.sectors.map((x) => (
@@ -96,8 +96,8 @@ export default function Catalogue(
<Field label="Território">
<select
className={control}
value={filters.territory_id ?? ""}
onChange={(e) => set("territory_id", e.target.value)}
value={filters.territory_id ?? ''}
onChange={(e) => set('territory_id', e.target.value)}
>
<option value="">Todos</option>
{p.territories.map((x) => (
@@ -119,24 +119,24 @@ export default function Catalogue(
className="space-y-3 rounded border p-5"
>
<h2 className="text-xl font-bold">
<Link href={"/parcerias/" + item.id}>
<Link href={'/parcerias/' + item.id}>
{item.title}
</Link>
</h2>
<p>
{item.partnership_type
? p.types[item.partnership_type]
: "Tipo por completar"}{" "}
· {item.kind === "offering" ? "Oferta" : "Procura"}
: 'Tipo por completar'}{' '}
· {item.kind === 'offering' ? 'Oferta' : 'Procura'}
</p>
<p>{item.summary}</p>
<p>
{item.sector || "Setor por completar"} ·{" "}
{item.province || "Território na ficha"}
{item.sector || 'Setor por completar'} ·{' '}
{item.province || 'Território na ficha'}
</p>
{item.deadline && <p>Prazo: {item.deadline}</p>}
<Link
href={"/parcerias/" + item.id}
href={'/parcerias/' + item.id}
className="underline"
>
Consultar parceria
+2 -1
View File
@@ -1,3 +1,4 @@
import { createOperationKey } from '@/lib/operation-key';
import { Link, useForm } from '@inertiajs/react';
import { useState } from 'react';
import {
@@ -22,7 +23,7 @@ type Props = Catalogues & {
};
function Editor(p: Props) {
const form = useForm({
client_key: crypto.randomUUID(),
client_key: createOperationKey(),
version: p.record?.version ?? null,
title: p.record?.title ?? '',
offer: p.record?.offer ?? '',
+13 -2
View File
@@ -1,3 +1,4 @@
import { createOperationKey } from '@/lib/operation-key';
import { useForm, usePage, Link, router } from '@inertiajs/react';
import {
Frame,
@@ -137,7 +138,7 @@ export default function Page(p: Props) {
}
function RoomPage(p: Props) {
const { auth } = usePage<{ auth: { user: { id: number } } }>().props;
const message = useForm({ body: '', client_key: crypto.randomUUID() });
const message = useForm({ body: '', client_key: createOperationKey() });
const agreement = useForm({
version: p.room.version,
action: 'record',
@@ -195,7 +196,7 @@ function RoomPage(p: Props) {
onSuccess: () => {
message.setData({
body: '',
client_key: crypto.randomUUID(),
client_key: createOperationKey(),
});
},
},
@@ -205,6 +206,7 @@ function RoomPage(p: Props) {
<Field label="Mensagem privada">
<textarea
className={control}
disabled={message.processing}
value={message.data.body}
onChange={(e) =>
message.setData('body', e.target.value)
@@ -231,6 +233,15 @@ function RoomPage(p: Props) {
antimalware limpa e hash correspondente. Anexar não
confirma autenticidade nem vigência.
</p>
<p
role="status"
aria-live="polite"
aria-label="Documentos disponíveis nesta sala"
>
{p.documents.length
? `${p.documents.length} documento(s) disponível(is) para esta conta.`
: 'Nenhum documento está autorizado para consulta por esta conta nesta sala.'}
</p>
{p.documents.map((d) => (
<article key={d.id}>
<p>
+1 -1
View File
@@ -113,7 +113,7 @@ export function Frame({
children: ReactNode;
}) {
return (
<Layout title={title}>
<Layout title={title} mainLandmark={false}>
<nav className="mb-6 flex flex-wrap gap-5 underline">
<Link href="/parcerias">Catálogo</Link>
<Link href="/parcerias/painel">O meu painel</Link>