fix: harmonizar pesquisa e navegacao dos catalogos em QA
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Link, useForm } from '@inertiajs/react';
|
||||
import { catalogueDetailHref } from '@/lib/catalogue-context';
|
||||
import { Management } from '../management/shared';
|
||||
import type { Paginated } from '../management/shared';
|
||||
import { Layout, Field, control, button, Pagination, kind } from './shared';
|
||||
@@ -102,7 +103,14 @@ export default function Index({
|
||||
<h2 className="text-xl font-semibold">
|
||||
<Link
|
||||
className="underline"
|
||||
href={`${base}/${r.id}`}
|
||||
href={catalogueDetailHref(
|
||||
`${base}/${r.id}`,
|
||||
new URLSearchParams(
|
||||
Object.entries(filters).filter(
|
||||
([, value]) => Boolean(value),
|
||||
) as [string, string][],
|
||||
).toString(),
|
||||
)}
|
||||
>
|
||||
{r.title}
|
||||
</Link>
|
||||
@@ -126,9 +134,28 @@ export default function Index({
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
<Link className="underline" href={`${base}/${r.id}`}>
|
||||
Explorar relações e próximos passos
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${base}/${r.id}`,
|
||||
new URLSearchParams(
|
||||
Object.entries(filters).filter(
|
||||
([, value]) => Boolean(value),
|
||||
) as [string, string][],
|
||||
).toString(),
|
||||
)}
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{!management &&
|
||||
(r.corridor_id || r.cluster_id || r.project_id) && (
|
||||
<Link
|
||||
className="ml-4 underline"
|
||||
href={`/oportunidades?${new URLSearchParams(r.corridor_id ? { corridor_id: r.corridor_id } : r.cluster_id ? { cluster_id: r.cluster_id } : { project_id: r.project_id! })}`}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Head, Link, usePage } from '@inertiajs/react';
|
||||
import { Head, usePage } from '@inertiajs/react';
|
||||
import type { ReactNode } from 'react';
|
||||
export { button, control, Field, Pagination } from '../management/shared';
|
||||
export type Dossier = {
|
||||
@@ -47,16 +47,6 @@ export function Layout({
|
||||
return (
|
||||
<Container className="mx-auto w-full max-w-6xl min-w-0 space-y-6 p-4 break-words md:p-8">
|
||||
<Head title={title} />
|
||||
<nav
|
||||
className="flex flex-wrap gap-5 text-sm underline"
|
||||
aria-label="Investimento"
|
||||
>
|
||||
<Link href="/">InvestMoz</Link>
|
||||
<Link href="/carteira?kind=corridor">Corredores</Link>
|
||||
<Link href="/carteira?kind=cluster">Clusters</Link>
|
||||
<Link href="/carteira?kind=project">Projectos âncora</Link>
|
||||
<Link href="/investidor">O meu painel</Link>
|
||||
</nav>
|
||||
<h1 className="text-3xl font-semibold">{title}</h1>
|
||||
{flash?.success && (
|
||||
<p role="status" className="rounded border p-3">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Link, useForm, router, usePage } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { catalogueReturnHref } from '@/lib/catalogue-context';
|
||||
import InvestmentMapPanel from '@/components/investment-map-panel';
|
||||
import StructureGeographyPanel, {
|
||||
type StructureGeography,
|
||||
@@ -76,8 +77,15 @@ function Editor({
|
||||
const save = useForm({ origin_id: origin?.id ?? null });
|
||||
const Frame = management ? Management : Layout;
|
||||
const base = management ? '/management/portfolio' : '/carteira';
|
||||
const pageUrl = usePage().url;
|
||||
return (
|
||||
<Frame title={record.title}>
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueReturnHref(base, pageUrl)}
|
||||
>
|
||||
Voltar à pesquisa
|
||||
</Link>
|
||||
<p>
|
||||
{kind(record)} · {record.content.code}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user