Skip to content

Commit

Permalink
feat: fix assets view (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpmeyer committed Sep 13, 2023
1 parent 6ded704 commit d89ce84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
<mat-list-item>
<mat-icon mat-list-icon>info</mat-icon>
<div class="asset-property" mat-line>Name</div>
<div mat-line>{{asset.name}}</div>
<div mat-line>{{asset.properties.mandatoryValue('edc','name')}}</div>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon>category</mat-icon>
<div class="asset-property" mat-line>Content Type</div>
<div mat-line>{{asset.contentType}}</div>
<div mat-line>{{asset.properties.mandatoryValue('edc','contenttype')}}</div>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon>file_copy</mat-icon>
<div class="asset-property" mat-line>Version</div>
<div mat-line>{{asset.version}}</div>
<div mat-line>{{asset.properties.mandatoryValue('edc','version')}}</div>
</mat-list-item>
</mat-list>
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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$;
Expand Down

0 comments on commit d89ce84

Please sign in to comment.