From 8c178adbebc243246bb61a242d3d12511b3770ee Mon Sep 17 00:00:00 2001 From: Jan Peter Meyer <102802985+janpmeyer@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:49:55 +0200 Subject: [PATCH] feat: fix assets view (#89) (#91) * feat: fix assets view (#89) * feat: use correct funtion for Asset-Properties (#89) --- .../components/asset-viewer/asset-viewer.component.html | 6 +++--- .../components/asset-viewer/asset-viewer.component.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.html b/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.html index 4f9389387..de13cde20 100644 --- a/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.html +++ b/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.html @@ -30,17 +30,17 @@ info
Name
-
{{asset.name}}
+
{{asset.properties.optionalValue('edc','name')}}
category
Content Type
-
{{asset.contentType}}
+
{{asset.properties.optionalValue('edc','contenttype')}}
file_copy
Version
-
{{asset.version}}
+
{{asset.properties.optionalValue('edc','version')}}
diff --git a/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.ts b/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.ts index 59c22ce7f..4d90c0986 100644 --- a/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.ts +++ b/src/modules/edc-demo/components/asset-viewer/asset-viewer.component.ts @@ -2,12 +2,12 @@ import {Component, OnInit} from '@angular/core'; import {BehaviorSubject, Observable, of} from 'rxjs'; import {first, map, switchMap} from 'rxjs/operators'; import {MatDialog} from '@angular/material/dialog'; -import {AssetInput } from "../../../mgmt-api-client/model"; +import {AssetInput, Asset } from "../../../mgmt-api-client/model"; import {AssetService} from "../../../mgmt-api-client"; import {AssetEditorDialog} from "../asset-editor-dialog/asset-editor-dialog.component"; import {ConfirmationDialogComponent, ConfirmDialogModel} from "../confirmation-dialog/confirmation-dialog.component"; import {NotificationService} from "../../services/notification.service"; -import { Asset } from '../../models/asset'; + @Component({ selector: 'edc-demo-asset-viewer', @@ -35,7 +35,7 @@ export class AssetViewerComponent implements OnInit { this.filteredAssets$ = this.fetch$ .pipe( switchMap(() => { - const assets$ = this.assetService.requestAssets().pipe(map(assets => assets.map(asset => new Asset(asset["edc:properties"])))); + const assets$ = this.assetService.requestAssets(); return !!this.searchText ? assets$.pipe(map(assets => assets.filter(asset => asset.name.includes(this.searchText)))) : assets$;