Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix assets view (#89) #91

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
janpmeyer marked this conversation as resolved.
Show resolved Hide resolved
</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
Loading