Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replaces promise with observable suncscribe for storages resource service

Andreas Pfohl794dcb83a515
diff --git a/frontend/src/app/core/state/storages/storages.service.ts b/frontend/src/app/core/state/storages/storages.service.ts
index 7ca746d95c9..7347e0b0d8a 100644
--- a/frontend/src/app/core/state/storages/storages.service.ts
+++ b/frontend/src/app/core/state/storages/storages.service.ts
@@ -69,13 +69,12 @@ export class StoragesResourceService {
);
}
- async updateCollection(key:string, storageLinks:{ href:string }[]):Promise<void> {
- const storages = await forkJoin(
+ updateCollection(key:string, storageLinks:{ href:string }[]):void {
+ forkJoin(
storageLinks.map((link) => this.http.get<IStorage>(link.href)),
- ).toPromise();
-
- const storageCollection = { _embedded: { elements: storages } } as IHALCollection<IStorage>;
-
- insertCollectionIntoState(this.store, storageCollection, key);
+ ).subscribe((storages) => {
+ const storageCollection = { _embedded: { elements: storages } } as IHALCollection<IStorage>;
+ insertCollectionIntoState(this.store, storageCollection, key);
+ });
}
}
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
index b56aa4bba0c..4a1c0314183 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
@@ -196,7 +196,7 @@ export class WorkPackageSingleViewBase extends UntilDestroyedMixin {
});
const project = this.workPackage.project as { $links:{ storages:{ href:string }[] }, href:string };
- void this.storages.updateCollection(project.href, project.$links.storages);
+ this.storages.updateCollection(project.href, project.$links.storages);
}
protected handleLoadingError(error:unknown):void {