diff --git a/resources/ts/Pages/Integrations/New.tsx b/resources/ts/Pages/Integrations/New.tsx
index 3bde64454..627e05507 100644
--- a/resources/ts/Pages/Integrations/New.tsx
+++ b/resources/ts/Pages/Integrations/New.tsx
@@ -1,6 +1,5 @@
import type { FormEvent, ReactNode } from "react";
-import React from "react";
-import { useState } from "react";
+import React, { useEffect, useState } from "react";
import { router, useForm } from "@inertiajs/react";
import Layout from "../../layouts/Layout";
import { Heading } from "../../Components/Heading";
@@ -33,12 +32,6 @@ const New = ({ subscriptions }: Props) => {
const { t } = useTranslation();
const { i18n } = useTranslation();
- const freeSubscriptionId = subscriptions.find(
- (subscription) =>
- subscription.integrationType === IntegrationType.EntryApi &&
- subscription.price === 0
- )?.id;
-
const basicSubscriptionIds = subscriptions
.filter(
(subscription) => subscription.category === SubscriptionCategory.Basic
@@ -55,10 +48,7 @@ const New = ({ subscriptions }: Props) => {
const initialFormValues = {
integrationType: activeType,
- subscriptionId:
- activeType === IntegrationType.EntryApi && !!freeSubscriptionId
- ? freeSubscriptionId
- : "",
+ subscriptionId: "",
integrationName: "",
description: "",
website: "",
@@ -71,6 +61,7 @@ const New = ({ subscriptions }: Props) => {
lastNameTechnicalContact: "",
emailTechnicalContact: "",
agreement: "",
+ uitpasAgreement: "",
coupon: "",
};
@@ -79,6 +70,17 @@ const New = ({ subscriptions }: Props) => {
const { data, setData, errors, hasErrors, post, processing } =
useForm(initialFormValues);
+ useEffect(() => {
+ const freeSubscriptionId = subscriptions.find(
+ (subscription) =>
+ subscription.integrationType === activeType &&
+ subscription.category === SubscriptionCategory.Free
+ )?.id;
+
+ setData("subscriptionId", freeSubscriptionId ?? "");
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [activeType, subscriptions]);
+
function handleSubmit(e: FormEvent) {
e.preventDefault();
post("/integrations", {
@@ -379,6 +381,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 && (
<>
;
@@ -32,4 +37,5 @@ export type Integration = {
authClients: AuthClient[];
legacyAuthConsumers: LegacyAuthConsumer[];
keyVisibility: KeyVisibility;
+ keyVisibilityUpgrade: KeyVisibilityUpgrade | null;
};
diff --git a/resources/ts/types/UiTPASOrganizer.ts b/resources/ts/types/UiTPASOrganizer.ts
new file mode 100644
index 000000000..449366547
--- /dev/null
+++ b/resources/ts/types/UiTPASOrganizer.ts
@@ -0,0 +1,4 @@
+export type UiTPASOrganizer = {
+ name: string;
+ id: string;
+};
diff --git a/routes/web.php b/routes/web.php
index b831e7478..582cec288 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -6,6 +6,7 @@
use App\Domain\Auth\Controllers\LoginController;
use App\Domain\Auth\Controllers\LogoutController;
use App\Domain\Integrations\Controllers\IntegrationController;
+use App\Domain\Integrations\Controllers\OrganizerController;
use App\Domain\Newsletter\Controllers\NewsletterController;
use Illuminate\Support\Facades\Route;
use App\Router\TranslatedRoute;
@@ -71,6 +72,8 @@
Route::post('/integrations', [IntegrationController::class, 'store']);
+ Route::get('/organizers', [OrganizerController::class, 'index']);
+
Route::group(['middleware' => 'can:access-integration,id'], static function () {
TranslatedRoute::get(
[
diff --git a/tests/Keycloak/Converters/IntegrationToKeycloakClientConverterTest.php b/tests/Keycloak/Converters/IntegrationToKeycloakClientConverterTest.php
index b3948b906..67e2a3dd2 100644
--- a/tests/Keycloak/Converters/IntegrationToKeycloakClientConverterTest.php
+++ b/tests/Keycloak/Converters/IntegrationToKeycloakClientConverterTest.php
@@ -83,7 +83,7 @@ public function test_combining_keycloak_convert_with_configured_uris(): void
$this->assertEquals([
'origin' => 'publiq-platform',
'use.refresh.tokens' => true,
- 'post.logout.redirect.uris' => 'https://example.com/logout1#https://example.com/logout2',
+ 'post.logout.redirect.uris' => 'https://example.com/logout1##https://example.com/logout2',
], $convertedData['attributes']);
$this->assertEquals('https://example.com/login1', $convertedData['baseUrl']);
$this->assertEquals(['https://example.com/callback1', 'https://example.com/callback2'], $convertedData['redirectUris']);
diff --git a/tests/Keycloak/Converters/IntegrationUrlConverterTest.php b/tests/Keycloak/Converters/IntegrationUrlConverterTest.php
index ba92aabb5..d4843b632 100644
--- a/tests/Keycloak/Converters/IntegrationUrlConverterTest.php
+++ b/tests/Keycloak/Converters/IntegrationUrlConverterTest.php
@@ -99,7 +99,7 @@ public function test_convert_for_first_party_logout_urls(): void
new IntegrationUrl(Uuid::uuid4(), $integration->id, Environment::Production, IntegrationUrlType::Logout, 'https://wrong.com/'),
);
$this->assertSame(
- 'https://example.com/logout1#https://example.com/logout2',
+ 'https://example.com/logout1##https://example.com/logout2',
IntegrationUrlConverter::buildLogoutUrls($integration, $this->client->environment)
);
}