diff --git a/app/Domain/Integrations/Models/IntegrationModel.php b/app/Domain/Integrations/Models/IntegrationModel.php index bb4486f33..f9305ab58 100644 --- a/app/Domain/Integrations/Models/IntegrationModel.php +++ b/app/Domain/Integrations/Models/IntegrationModel.php @@ -97,7 +97,7 @@ public function isWidgets(): bool public function isUiTPAS(): bool { - return $this->type === IntegrationType::UiTPAS->value || $this->type === null; + return $this->type === IntegrationType::UiTPAS->value; } protected static function booted(): void diff --git a/app/Nova/Resources/Integration.php b/app/Nova/Resources/Integration.php index 5eab9ff96..6dff79361 100644 --- a/app/Nova/Resources/Integration.php +++ b/app/Nova/Resources/Integration.php @@ -209,11 +209,13 @@ function (Text $field, NovaRequest $request, FormData $formData) { $fields[] = HasMany::make('Keycloak client Credentials', 'keycloakClients', KeycloakClient::class); } - if ($this->isUiTPAS()) { - $fields[] = HasMany::make('UDB3 Organizers', 'organizers', Organizer::class); - } - return array_merge($fields, [ + HasMany::make('UDB3 Organizers', 'organizers', Organizer::class) + ->canSee(function () { + /** @var ?IntegrationModel $model */ + $model = $this->model(); + return $model && $model->isUiTPAS(); + }), HasMany::make('Contacts'), HasMany::make('Urls', 'urls', IntegrationUrl::class), HasMany::make('Activity Log'),