diff --git a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html
index e31cf5f6c..df77a622c 100644
--- a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html
+++ b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html
@@ -250,14 +250,14 @@
- @for (check of testConnectionResult.checks; track check.name) {
+ @for (check of testConnectionResult()?.checks; track check.name) {
@switch (check.status) {
@case ('PASS') {
diff --git a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.spec.ts b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.spec.ts
index 302958aac..43dfde3c7 100644
--- a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.spec.ts
+++ b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.spec.ts
@@ -495,12 +495,12 @@ describe('AuthenticationSettingsComponent', () => {
component.testConnection();
- expect(component.isTestingConnection).toBe(false);
- expect(component.testConnectionResult).toEqual({
+ expect(component.isTestingConnection()).toBe(false);
+ expect(component.testConnectionResult()).toEqual({
success: true,
checks: [{name: 'issuer', status: 'PASS', message: 'ok'}],
});
- expect(component.showTestDetails).toBe(true);
+ expect(component.showTestDetails()).toBe(true);
appSettingsService.testOidcConnection.mockReturnValueOnce(
throwError(() => new HttpErrorResponse({status: 500}))
@@ -508,7 +508,7 @@ describe('AuthenticationSettingsComponent', () => {
component.testConnection();
- expect(component.isTestingConnection).toBe(false);
+ expect(component.isTestingConnection()).toBe(false);
expect(messageService.add).toHaveBeenCalledWith(expect.objectContaining({
severity: 'error',
detail: 'settingsAuth.testConnection.error',
diff --git a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts
index a306f559e..abc5e4022 100644
--- a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts
+++ b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts
@@ -1,5 +1,5 @@
import {HttpErrorResponse} from '@angular/common/http';
-import {Component, effect, inject, signal} from '@angular/core';
+import {Component, effect, inject, signal, WritableSignal} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {InputText} from '@openng/optimus-ui/inputtext';
import {Button} from '@openng/optimus-ui/button';
@@ -99,9 +99,9 @@ export class AuthenticationSettingsComponent {
];
// Test connection
- isTestingConnection = false;
- testConnectionResult: OidcTestResult | null = null;
- showTestDetails = false;
+ readonly isTestingConnection = signal(false);
+ readonly testConnectionResult: WritableSignal = signal(null);
+ readonly showTestDetails = signal(false);
// Group mapping
readonly groupSyncMode = signal('DISABLED');
@@ -450,14 +450,18 @@ export class AuthenticationSettingsComponent {
return this.allLibraries.find(l => l.id === id)?.name ?? `#${id}`;
}
+ toggleTestDetails(): void {
+ this.showTestDetails.update(s => !s)
+ }
+
testConnection(): void {
- this.isTestingConnection = true;
- this.testConnectionResult = null;
+ this.isTestingConnection.set(true);
+ this.testConnectionResult.set(null);
this.appSettingsService.testOidcConnection(this.oidcProvider).subscribe({
next: (result) => {
- this.testConnectionResult = result;
- this.showTestDetails = true;
- this.isTestingConnection = false;
+ this.testConnectionResult.set(result);
+ this.showTestDetails.set(true);
+ this.isTestingConnection.set(false);
},
error: () => {
this.messageService.add({
@@ -465,7 +469,7 @@ export class AuthenticationSettingsComponent {
summary: this.t.translate('common.error'),
detail: this.t.translate('settingsAuth.testConnection.error')
});
- this.isTestingConnection = false;
+ this.isTestingConnection.set(false);
}
});
}