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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Integrated Akita store for Storage file service
Andreas Pfohl924d13fa1bd8
diff --git a/frontend/src/app/core/state/storage-files/storage-files.service.ts b/frontend/src/app/core/state/storage-files/storage-files.service.tsindex 0c486a65538..fd1c4d67c30 100644--- a/frontend/src/app/core/state/storage-files/storage-files.service.ts+++ b/frontend/src/app/core/state/storage-files/storage-files.service.ts@@ -35,6 +35,10 @@ import {import { StorageFilesStore } from 'core-app/core/state/storage-files/storage-files.store';import { Observable, of } from 'rxjs';import { IStorageFile } from 'core-app/core/state/storage-files/storage-file.model';+import { IHalResourceLink } from 'core-app/core/state/hal-resource';+import { insertCollectionIntoState } from 'core-app/core/state/collection-store';+import { map } from 'rxjs/operators';+import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';@Injectable()export class StorageFilesResourceService extends ResourceCollectionService<IStorageFile> {@@ -46,7 +50,20 @@ export class StorageFilesResourceService extends ResourceCollectionService<IStorreturn new StorageFilesStore();}- public getMockData():Observable<IStorageFile[]> {+ // fetch(link:IHalResourceLink):void {+ fetch():void {+ // this.http+ // .get<[IStorageFile]>(link.href)+ this.mockedFileList()+ .pipe(map((fileList) => ({ _embedded: { elements: fileList } } as unknown as IHALCollection<IStorageFile>)))+ .subscribe((fileList) => insertCollectionIntoState(this.store, fileList, 'root'));+ }++ files():Observable<IStorageFile[]> {+ return this.collection('root');+ }++ private mockedFileList():Observable<IStorageFile[]> {return of([{id: 1,diff --git a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.tsindex 98f3d4a655d..aef85d05a0e 100644--- a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts+++ b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts@@ -80,8 +80,9 @@ export class FilePickerModalComponent extends OpModalComponent implements OnInitngOnInit():void {super.ngOnInit();+ this.storageFilesResourceService.fetch();- this.storageFiles$ = this.storageFilesResourceService.getMockData();+ this.storageFiles$ = this.storageFilesResourceService.files();this.storageFiles$.subscribe(() => {this.loading$.next(false);