diff --git a/AMW_angular/io/src/app/apps/apps.component.ts b/AMW_angular/io/src/app/apps/apps.component.ts
index 831686b3c..88dc877a1 100644
--- a/AMW_angular/io/src/app/apps/apps.component.ts
+++ b/AMW_angular/io/src/app/apps/apps.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectionStrategy, Component, computed, inject, OnDestroy, OnInit, Signal } from '@angular/core';
+import { ChangeDetectionStrategy, Component, computed, inject, OnDestroy, OnInit, signal, Signal } from '@angular/core';
import { BehaviorSubject, skip, Subject, take } from 'rxjs';
import { LoadingIndicatorComponent } from '../shared/elements/loading-indicator.component';
import { AsyncPipe } from '@angular/common';
@@ -22,7 +22,6 @@ import { ResourceService } from '../resource/resource.service';
import { Resource } from '../resource/resource';
import { AppCreate } from './app-create';
import { ButtonComponent } from '../shared/button/button.component';
-import { offset } from '@popperjs/core';
@Component({
selector: 'app-apps',
@@ -63,7 +62,10 @@ export class AppsComponent implements OnInit, OnDestroy {
private error$ = new BehaviorSubject
('');
private destroy$ = new Subject();
- isLoading = false;
+ showLoader = signal(false);
+ isLoading = computed(() => {
+ return this.appServers() === undefined || this.showLoader();
+ });
permissions = computed(() => {
if (this.authService.restrictions().length > 0) {
@@ -111,7 +113,7 @@ export class AppsComponent implements OnInit, OnDestroy {
}
saveAppServer(appServer: AppServer) {
- this.isLoading = true;
+ this.showLoader.set(true);
this.appsService
.createAppServer(appServer)
.pipe(takeUntil(this.destroy$))
@@ -124,13 +126,12 @@ export class AppsComponent implements OnInit, OnDestroy {
},
complete: () => {
this.appsService.refreshData();
- this.isLoading = false;
},
});
}
saveApp(app: AppCreate) {
- this.isLoading = true;
+ this.showLoader.set(true);
this.appsService
.createApp(app)
.pipe(takeUntil(this.destroy$))
@@ -139,7 +140,6 @@ export class AppsComponent implements OnInit, OnDestroy {
error: (e) => this.error$.next(e.toString()),
complete: () => {
this.appsService.refreshData();
- this.isLoading = false;
},
});
}
diff --git a/AMW_angular/io/src/app/apps/apps.service.ts b/AMW_angular/io/src/app/apps/apps.service.ts
index 28d72b57e..7dd56ba18 100644
--- a/AMW_angular/io/src/app/apps/apps.service.ts
+++ b/AMW_angular/io/src/app/apps/apps.service.ts
@@ -58,7 +58,11 @@ export class AppsService extends BaseService {
.pipe(catchError(this.handleError))
.pipe(
map((response: HttpResponse) => {
- this.count.set(Number(response.headers.get('x-total-count')));
+ if (response.body.length <= 0) {
+ this.count.set(0);
+ } else {
+ this.count.set(Number(response.headers.get('x-total-count')));
+ }
return response.body;
}),
);
diff --git a/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/domain/applist/ApplistScreenDomainServiceQueries.java b/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/domain/applist/ApplistScreenDomainServiceQueries.java
index 8575287c3..86131e678 100644
--- a/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/domain/applist/ApplistScreenDomainServiceQueries.java
+++ b/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/domain/applist/ApplistScreenDomainServiceQueries.java
@@ -91,7 +91,7 @@ Tuple, Long> getAppServersWithApps(Integer startIndex, Inte
if (maxResult != null) {
query.setMaxResults(maxResult);
- }
+ }
return new Tuple<>(query.getResultList(), totalCount);
}