fix: load all clients in my application view
Fetch viewable and editable clients to display also clients that are assigned from the main ui
Closes:
MODIFY
src/app/components/marketplace-client-app/marketplace-client-app.component.ts
src/app/components/marketplace-client-app/marketplace-client-app.component.ts
@@ -129,6 +129,7 @@ export class MarketplaceClientAppComponent implements OnInit {
private loadClients() {
return forkJoin([
this.backend.getClientOrgs(),
+ // we only need clients with clientEdit otherwise you cannot create a contract with that client
this.backend.getEditableClients()
]);
}

MODIFY
src/app/components/my-apps/my-apps.component.ts
src/app/components/my-apps/my-apps.component.ts
@@ -19,7 +19,7 @@ import {
import { IContractExt } from '../../interfaces/IContractExt';
import { PolicyService } from '../../services/policy/policy.service';
import { catchError, map, switchMap } from 'rxjs/operators';
-import { EMPTY, forkJoin } from 'rxjs';
+import { merge, EMPTY, forkJoin } from 'rxjs';
import { flatArray } from '../../shared/utility';
import { SpinnerService } from '../../services/spinner/spinner.service';
import { ApiService } from '../../services/api/api.service';
@@ -73,9 +73,7 @@ export class MyAppsComponent implements OnInit {
this.spinnerService.startWaiting();
this.contractsLoaded = false;
-
- this.backend
- .getEditableClients()
+ merge(this.backend.getEditableClients(), this.backend.getViewableClients())
.pipe(
switchMap((clientSummaries: IClientSummary[]) => {
if (clientSummaries.length === 0) {

MODIFY
src/app/services/backend/backend.service.ts
src/app/services/backend/backend.service.ts
@@ -166,6 +166,15 @@ export class BackendService {
);
}
+ public getViewableClients(): Observable<IClientSummary[]> {
+ const username = this.keycloakHelper.getUsername();
+ const path = `users/${username}/viewable-clients`;
+ return this.http.get<IClientSummary[]>(
+ this.generateUrl(path),
+ this.httpOptions
+ );
+ }
+
public getClientVersions(
organizationId: string,
clientId: string

fix: load all clients in my application view

Fetch viewable and editable clients to display also clients that are assigned from the main ui

Closes: #54