Fix for endless spinner on create developer view
MODIFY
src/app/components/admin/create-developer/client-mapping.component.ts
src/app/components/admin/create-developer/client-mapping.component.ts
@@ -36,7 +36,8 @@ export class ClientMappingComponent implements OnInit {
this.loadingSpinnerService.startWaiting();
const loadedAvailableClients = [];
this.adminService.getAllClients().pipe(map(client => {
- if (this.assignedClients
+ if (client !== null
+ && this.assignedClients
&& !this.assignedClients.find((c => c.organizationId === client.organizationId && c.clientId === client.id))) {
loadedAvailableClients.push({
clientId: client.id,

MODIFY
src/app/components/admin/services/admin.service.ts
src/app/components/admin/services/admin.service.ts
import {Inject, Injectable} from '@angular/core';
-import {forkJoin, Observable} from 'rxjs';
+import {forkJoin, Observable, of} from 'rxjs';
import {map, mergeMap, share} from 'rxjs/operators';
import UserRepresentation from 'keycloak-admin/lib/defs/userRepresentation';
import {ClientSearchResult, Developer, KeycloakUser} from '../../../services/api-data.service';
@@ -145,6 +145,6 @@ export class AdminService {
}
};
return (this.http.post(url, searchQuery) as Observable<ClientSearchResult>)
- .pipe(mergeMap(searchResult => searchResult.beans));
+ .pipe(mergeMap(searchResult => searchResult.beans.length > 0 ? searchResult.beans : of(null)));
}
}

GW-298: Fix for endless spinner on create developer view