fix(sector): use effective creation access and preserve corridor presentation contract
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-28 21:35:21 +02:00
parent 502e3ec4d5
commit 789fffd098
12 changed files with 73 additions and 16 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ export type SectorEntryData = {
}[];
start_href: string | null;
register_href: string | null;
register_label?: string;
start_notice: string | null;
register_notice: string | null;
specialization_href: string | null;
@@ -58,7 +59,7 @@ export default function SectorEntry({
className="rounded border px-4 py-3"
href={data.register_href}
>
Cadastrar oportunidade — escolher modalidade
{data.register_label ?? 'Cadastrar oportunidade — escolher modalidade'}
</Link>
) : (
<p role="status">{data.register_notice}</p>
+8
View File
@@ -0,0 +1,8 @@
/** Presentation only. Original taxonomy identifiers remain the form/query values. */
const names:Record<string,string>={
agronegocio:'Agronegócio','bens-de-consumo-e-franquias':'Bens de consumo e franquias',energia:'Energia e mineração (catálogo histórico)',
'energia-especifica':'Energia',fintech:'Fintech',fiscalidade:'Fiscalidade',imobiliario:'Imobiliário',infraestruturas:'Infraestruturas',
iva:'IVA',mineracao:'Mineração','território':'Território',territorio:'Território',turismo:'Turismo','mercado-financeiro':'Mercado financeiro',
education:'Formação e competências',media:'Imagens e conteúdos de apoio',pt:'Português',en:'Inglês',
};
export function documentFacetLabel(value:string):string{return names[value]??value;}
+6 -5
View File
@@ -1,4 +1,5 @@
import { PublicSectorCards } from '@/components/public-sector-cards';
import { documentFacetLabel } from '@/lib/document-facet-label';
import { PORTAL_MORE_LINK } from '@/lib/portal-presentation';
import {
PublicDocumentContent,
@@ -579,7 +580,7 @@ export default function Services(p: Props) {
>
<option value="">Todos</option>
{p.topics?.map((topic) => (
<option key={topic}>{topic}</option>
<option key={topic} value={topic}>{documentFacetLabel(topic)}</option>
))}
</select>
</label>
@@ -606,7 +607,7 @@ export default function Services(p: Props) {
value={category}
>
{documentTypeLabels[category] ??
category}
documentFacetLabel(category)}
</option>
))}
</select>
@@ -809,8 +810,8 @@ export default function Services(p: Props) {
>
<option value="">Todos</option>
{p.languages?.map((language) => (
<option key={language}>
{language}
<option key={language} value={language}>
{documentFacetLabel(language)}
</option>
))}
</select>
@@ -917,7 +918,7 @@ export default function Services(p: Props) {
className="rounded-full border bg-white px-3 py-1 underline"
href={`${p.section === 'documents' ? '/documentos' : '/legislacao'}?${new URLSearchParams({ topic }).toString()}`}
>
{topic}
{documentFacetLabel(topic)}
</Link>
))}
</nav>