Fix loadingIndicator in wpList component

pull/8041/head
Oliver Günther 5 years ago
parent e6200adcf8
commit fbb6efaf68
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 18
      frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.ts

@ -101,11 +101,8 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
this.hasQueryProps = !!this.$state.params.query_props;
// If the query was loaded, reload invisibly
if (this.querySpace.initialized.hasValue()) {
this.refresh();
} else {
this.loadCurrentQuery();
}
const isFirstLoad = !this.querySpace.initialized.hasValue();
this.refresh(isFirstLoad, isFirstLoad);
// Load query on URL transitions
this.updateQueryOnParamsChanges();
@ -199,7 +196,7 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
let promise:Promise<unknown>;
if (firstPage) {
promise = this.loadCurrentQuery();
promise = this.wpListService.loadCurrentQueryFromParams(this.projectIdentifier);
} else {
promise = this.wpListService.reloadCurrentResultsList();
}
@ -207,7 +204,7 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
if (visibly) {
this.loadingIndicator = promise.then(() => {
if (this.wpTableTimeline.isVisible) {
return this.querySpace.timelineRendered.toPromise();
return this.querySpace.timelineRendered.pipe(take(1)).toPromise();
} else {
return this.querySpace.tableRendered.valuesPromise() as Promise<unknown>;
}
@ -253,7 +250,7 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
this.wpListChecksumService
.executeIfOutdated(newId,
newChecksum,
() => this.loadCurrentQuery());
() => this.refresh(true, true));
});
}
@ -273,9 +270,4 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
this.loadingIndicatorService.table.promise = promise;
}
protected loadCurrentQuery():Promise<unknown> {
return this.loadingIndicator =
this.wpListService
.loadCurrentQueryFromParams(this.projectIdentifier);
}
}

Loading…
Cancel
Save