From f1db53fdbfad06322d2a2021016b99a94382c53b Mon Sep 17 00:00:00 2001 From: Paulo Massingue Date: Wed, 18 Nov 2026 15:19:58 +0200 Subject: [PATCH 1/9] paginacao de 3 em 3 --- app/Http/Controllers/PortalServicesController.php | 2 +- tests/Feature/PortalServicesTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/PortalServicesController.php b/app/Http/Controllers/PortalServicesController.php index 99fa1b3c..136eaebe 100644 --- a/app/Http/Controllers/PortalServicesController.php +++ b/app/Http/Controllers/PortalServicesController.php @@ -126,7 +126,7 @@ class PortalServicesController extends Controller 'r.source_url', 'r.language', 'r.version_label', 'r.document_group_id', 'r.territorial_scope', 'r.territory_id', 'r.source_confirmation', 'r.legal_status', 'r.rights_status', 'r.last_reviewed_at', 'r.last_reviewed_by', 'r.independent_review', 'r.metadata_version', 'r.source_reference', 'r.essential', 'd.file_name', 'd.media_type', 'd.size_bytes', 'd.issuer', 'd.issued_on', 'd.valid_until', 'd.version_no', - ])->paginate(5)->withQueryString(); + ])->paginate(3)->withQueryString(); $pageResult->getCollection()->transform(fn ($resource) => app(PublicDocumentPresentation::class)->resource($resource)); $props['resources'] = $pageResult; app(PublicSearchMetrics::class)->candidate($request, 'documents', $pageResult->total(), $filters); diff --git a/tests/Feature/PortalServicesTest.php b/tests/Feature/PortalServicesTest.php index 1f56cbeb..43943ad8 100644 --- a/tests/Feature/PortalServicesTest.php +++ b/tests/Feature/PortalServicesTest.php @@ -225,7 +225,7 @@ class PortalServicesTest extends TestCase $this->assertDatabaseCount('portal_resource_links', 20); } - public function test_public_document_lists_paginate_five_results_and_preserve_filters(): void + public function test_public_document_lists_paginate_three_results_and_preserve_filters(): void { Storage::fake('local'); $this->withoutMiddleware(\Illuminate\Routing\Middleware\ThrottleRequests::class); @@ -254,14 +254,14 @@ class PortalServicesTest extends TestCase auth()->logout(); foreach (['documentos', 'legislacao'] as $path) { - foreach ([1 => [5, 1, 5], 2 => [5, 6, 10], 3 => [1, 11, 11]] as $number => [$count, $from, $to]) { + foreach ([1 => [3, 1, 3], 2 => [3, 4, 6], 3 => [3, 7, 9], 4 => [2, 10, 11]] as $number => [$count, $from, $to]) { $this->get('/'.$path.'?topic=Investimento&page='.$number)->assertOk()->assertInertia(fn (Assert $page) => $page ->has('resources.data', $count)->where('resources.total', 11) - ->where('resources.current_page', $number)->where('resources.last_page', 3) + ->where('resources.current_page', $number)->where('resources.last_page', 4) ->where('resources.from', $from)->where('resources.to', $to) ->where('resources.data.0.title', sprintf('Pagination QA %02d', $from)) ->where('resources.prev_page_url', fn ($url) => $number === 1 ? $url === null : str_contains($url, 'topic=Investimento') && str_contains($url, 'page='.($number - 1))) - ->where('resources.next_page_url', fn ($url) => $number === 3 ? $url === null : str_contains($url, 'topic=Investimento') && str_contains($url, 'page='.($number + 1)))); + ->where('resources.next_page_url', fn ($url) => $number === 4 ? $url === null : str_contains($url, 'topic=Investimento') && str_contains($url, 'page='.($number + 1)))); } $this->get('/'.$path.'?q=Pagination%20QA%2001')->assertOk()->assertInertia(fn (Assert $page) => $page ->has('resources.data', 1)->where('resources.total', 1)->where('resources.data.0.title', 'Pagination QA 01')); @@ -349,7 +349,7 @@ class PortalServicesTest extends TestCase 'target_key' => 'fiscal.iva.lei_13_2016_rectification_2017', 'review_status' => 'pending', 'applicability' => 'evidence']); $this->assertDatabaseHas('audit_events', ['source_system' => 'portal-services', 'entity_type' => 'portal_resources', 'actor_user_id' => $manager->id, 'action' => 'published_under_user_authorization']); - $this->get('/documentos')->assertInertia(fn (Assert $page) => $page->has('resources.data', 4)); + $this->get('/documentos')->assertInertia(fn (Assert $page) => $page->has('resources.data', 3)->where('resources.total', 4)); $this->get('/documentos?q=22%2F2022')->assertInertia(fn (Assert $page) => $page ->has('resources.data', 1)->where('resources.data.0.id', $resourceIds[0])); $this->get('/documentos?category=Guia&document_type=legislation')->assertInertia(fn (Assert $page) => $page From 40002db40f573dbd0afdf7d66773c68b0afe43c7 Mon Sep 17 00:00:00 2001 From: Paulo Massingue Date: Fri, 20 Nov 2026 11:44:28 +0200 Subject: [PATCH 2/9] ajuste em manifestacao de interesse organizacao --- resources/js/components/country-select.tsx | 3 + resources/js/pages/PortalInvestidor.tsx | 545 ++++++++++++--------- 2 files changed, 308 insertions(+), 240 deletions(-) diff --git a/resources/js/components/country-select.tsx b/resources/js/components/country-select.tsx index 50732e4d..5b0c344b 100644 --- a/resources/js/components/country-select.tsx +++ b/resources/js/components/country-select.tsx @@ -9,6 +9,7 @@ export default function CountrySelect({ label = 'País', required = false, error, + className, }: { countries: Country[]; value: string; @@ -19,6 +20,7 @@ export default function CountrySelect({ required?: boolean; allowLegacyValue?: boolean; error?: string; + className?: string; }) { return ( ); } diff --git a/resources/js/pages/PortalInvestidor.tsx b/resources/js/pages/PortalInvestidor.tsx index 908a138a..f87677c6 100644 --- a/resources/js/pages/PortalInvestidor.tsx +++ b/resources/js/pages/PortalInvestidor.tsx @@ -96,23 +96,31 @@ function QueryStatus({ function TopBar({ onNavigate, requestCount, + hideBrand = false, }: { onNavigate: (view: View) => void; requestCount: number; + hideBrand?: boolean; }) { return ( @@ -528,6 +538,9 @@ function OpportunityDetail({ ); } +const interestControlClass = + 'w-full rounded-xl border border-slate-300 bg-white px-3.5 py-3 text-sm text-slate-900 shadow-sm placeholder:text-slate-400 hover:border-slate-400 focus:border-[#ed1c24] focus:outline-none focus:ring-4 focus:ring-[#ed1c24]/10'; + function InterestForm({ preselected, onSubmitted, @@ -660,217 +673,260 @@ function InterestForm({ } return ( -
-

- Manifestar interesse -

-

- Preencha os dados abaixo para que a equipa do portal possa - analisar o seu interesse e entrar em contacto. -

- - {preselected && ( -
- Oportunidade seleccionada:{' '} - {preselected.title} ( - {preselected.reference}) -
- )} - -
- {submitError && ( -

- {submitError} +

+
+
+

+ Manifestar interesse +

+

+ Preencha os dados abaixo para que a equipa do portal + possa analisar o seu interesse e entrar em contacto.

+
+ + {preselected && ( +
+ Oportunidade seleccionada:{' '} + {preselected.title} ( + {preselected.reference}) +
)} -
- - update('name', e.target.value)} - /> - - - update('email', e.target.value)} - /> - - - - update('phone', e.target.value)} - /> - - - - - - - - update('country', value)} - required - allowLegacyValue - /> - - - - - update('declared_origin_country_code', value) - } - /> -

- País de onde apresenta este pedido. Pode ser - diferente do país do requerente. -

-
- - - - - - - - - - -