From 78217a820302af5052c28b60e0abd0159337cb04 Mon Sep 17 00:00:00 2001 From: vhande Date: Wed, 26 Jun 2024 15:11:19 +0200 Subject: [PATCH 1/5] Add uitpas agreement --- resources/ts/Pages/Integrations/New.tsx | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/resources/ts/Pages/Integrations/New.tsx b/resources/ts/Pages/Integrations/New.tsx index ebd96ae7a..334528fc6 100644 --- a/resources/ts/Pages/Integrations/New.tsx +++ b/resources/ts/Pages/Integrations/New.tsx @@ -59,6 +59,7 @@ const New = ({ subscriptions }: Props) => { lastNameTechnicalContact: "", emailTechnicalContact: "", agreement: "", + uitpasAgreement: "", coupon: "", }; @@ -379,6 +380,42 @@ const New = ({ subscriptions }: Props) => { } error={errors.agreement} /> + {activeType === IntegrationType.UiTPAS && ( + + ), + }} + /> + } + labelPosition="right" + labelSize="base" + labelWeight="normal" + component={ + + setData( + "uitpasAgreement", + data.uitpasAgreement === "true" ? "" : "true" + ) + } + /> + } + error={errors.uitpasAgreement} + /> + )} {isCouponFieldVisible && ( <> Date: Wed, 26 Jun 2024 15:11:32 +0200 Subject: [PATCH 2/5] Add translations --- resources/translations/en.json | 4 ++++ resources/translations/nl.json | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/resources/translations/en.json b/resources/translations/en.json index 6cf490257..17779aef8 100644 --- a/resources/translations/en.json +++ b/resources/translations/en.json @@ -133,6 +133,10 @@ }, "error": "Not all mandatory fields were filled in correctly. Check your input.", "agree": "I agree to the <1>terms of use and the <2>privacy policy", + "uitpasAgreement": { + "label": "I agree with the <1>processing conditions of UiTPAS<1>", + "link": "https://www.publiq.be/en/projects/publiq-platform/processing-conditions" + }, "terms_of_use_link": "https://docs.publiq.be/docs/uitdatabank/terms-of-use/terms-of-use", "privacy_link": "https://www.publiq.be/en/privacy", "coupon": "I have a coupon", diff --git a/resources/translations/nl.json b/resources/translations/nl.json index 2e1ee65a0..c98c45c1b 100644 --- a/resources/translations/nl.json +++ b/resources/translations/nl.json @@ -133,6 +133,10 @@ }, "error": "Niet alle verplichte velden werden correct ingevuld. Controleer je invoer.", "agree": "Ik ga akkoord met de <1>gebruiksvoorwaarden en de <2>privacyverklaring", + "uitpasAgreement": { + "label": "Ik ga akkoord met de <1>verwerkingsvoorwaarden van UiTPAS<1>", + "link": "https://www.publiq.be/nl/projecten/publiq-platform/algemene-verwerkingsvoorwaarden" + }, "terms_of_use_link": "https://docs.publiq.be/docs/uitdatabank/terms-of-use/terms-of-use", "privacy_link": "https://www.publiq.be/nl/privacy", "coupon": "Ik heb een coupon", From a0eb56385f1b043e0dcbecaa70d3979d23d689c3 Mon Sep 17 00:00:00 2001 From: vhande Date: Wed, 26 Jun 2024 15:11:40 +0200 Subject: [PATCH 3/5] Add validation --- lang/nl/validation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/nl/validation.php b/lang/nl/validation.php index 53eaa9c61..d2b720c4c 100644 --- a/lang/nl/validation.php +++ b/lang/nl/validation.php @@ -199,6 +199,7 @@ 'lastName' => 'achternaam', 'email' => 'email', 'agreement' => 'gebruikersvoorwaarden', + 'uitpasAgreement' => 'verwerkingsvoorwaarden van UiTPAS', 'functional.email' => 'email', 'functional.lastName' => 'achternaam', 'functional.firstName' => 'voornaam', From 46de828c4001e9da6357ab130a499de9b8e66a96 Mon Sep 17 00:00:00 2001 From: vhande Date: Wed, 26 Jun 2024 15:12:20 +0200 Subject: [PATCH 4/5] Add rule uitpas agreement --- .../Integrations/FormRequests/StoreIntegrationRequest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php b/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php index 75bd9c3f1..b36b879fa 100644 --- a/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php +++ b/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php @@ -5,6 +5,7 @@ namespace App\Domain\Integrations\FormRequests; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Rule; final class StoreIntegrationRequest extends FormRequest { @@ -26,6 +27,7 @@ public function rules(): array 'lastNameTechnicalContact' => ['required', 'string', 'max:255'], 'emailTechnicalContact' => ['required', 'string', 'email', 'max:255'], 'agreement' => ['required', 'string'], + 'uitpasAgreement' => [Rule::requiredIf($this->input('integrationType') === 'uitpas'), 'nullable', 'string'], 'coupon' => ['nullable', 'string'], ]; } From de6579e9b3dd7aadb4aa07e5d4ecd9b7384e786d Mon Sep 17 00:00:00 2001 From: vhande Date: Thu, 27 Jun 2024 15:32:01 +0200 Subject: [PATCH 5/5] Use enum IntegrationType --- .../Integrations/FormRequests/StoreIntegrationRequest.php | 3 ++- .../Integrations/FormRequests/UpdateIntegrationRequest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php b/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php index b36b879fa..950d89bae 100644 --- a/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php +++ b/app/Domain/Integrations/FormRequests/StoreIntegrationRequest.php @@ -4,6 +4,7 @@ namespace App\Domain\Integrations\FormRequests; +use App\Domain\Integrations\IntegrationType; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; @@ -27,7 +28,7 @@ public function rules(): array 'lastNameTechnicalContact' => ['required', 'string', 'max:255'], 'emailTechnicalContact' => ['required', 'string', 'email', 'max:255'], 'agreement' => ['required', 'string'], - 'uitpasAgreement' => [Rule::requiredIf($this->input('integrationType') === 'uitpas'), 'nullable', 'string'], + 'uitpasAgreement' => [Rule::requiredIf($this->input('integrationType') === IntegrationType::UiTPAS->value), 'nullable', 'string'], 'coupon' => ['nullable', 'string'], ]; } diff --git a/app/Domain/Integrations/FormRequests/UpdateIntegrationRequest.php b/app/Domain/Integrations/FormRequests/UpdateIntegrationRequest.php index 8a181134f..267aae0c3 100644 --- a/app/Domain/Integrations/FormRequests/UpdateIntegrationRequest.php +++ b/app/Domain/Integrations/FormRequests/UpdateIntegrationRequest.php @@ -4,6 +4,7 @@ namespace App\Domain\Integrations\FormRequests; +use App\Domain\Integrations\IntegrationType; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; @@ -18,7 +19,7 @@ public function rules(): array 'integrationName' => ['required_without:description', 'string', 'max:255'], 'description' => ['required_without:integrationName', 'string', 'max:255'], 'website' => [ - Rule::requiredIf($this->input('integrationType') === 'uitpas'), + Rule::requiredIf($this->input('integrationType') === IntegrationType::UiTPAS->value), 'nullable', 'url:http,https', 'max:255',