Skip to content

Commit

Permalink
Merge pull request #251 from swisstopo/develop
Browse files Browse the repository at this point in the history
Release Candidate
  • Loading branch information
TIL-EBP authored Aug 6, 2024
2 parents 95bd458 + efdf9ed commit c3d2583
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<tr>
<th translate="search.content"></th>
<td>
<ng-container *ngIf="assetDetail.assetFormatCompositions.length === 0">&ndash; </ng-container>
<ng-container *ngIf="assetDetail.assetFormatCompositions.length === 0">&ndash;</ng-container>
<ng-container *rxFor="let assetFormatComposition of assetDetail.assetFormatCompositions; let last = last">
{{ (assetFormatComposition | valueItemName) + (last ? "" : ", ") }}
</ng-container>
Expand All @@ -158,14 +158,13 @@
<tr>
<th translate="search.reference"></th>
<td>
<ng-container *ngIf="assetDetail.referenceAssets.length === 0">&ndash; </ng-container>
<ng-container *ngIf="assetDetail.referenceAssets.length === 0">&ndash;</ng-container>
<ul [class.single-entry]="assetDetail.referenceAssets.length === 1">
<li *rxFor="let referenceAsset of assetDetail.referenceAssets">
<a
asset-sg-reset
class="line"
[routerLink]="['.']"
[queryParams]="{ searchParams: undefined, assetId: referenceAsset.assetId }"
(click)="searchForReferenceAsset(referenceAsset.assetId)"
queryParamsHandling="merge"
>
{{ referenceAsset.titlePublic }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ export class AssetSearchDetailComponent {

constructor(private httpClient: HttpClient) {}

isActiveFileDownload(file: Omit<AssetFile, 'fileSize'>, isDownload = true): boolean {
public isActiveFileDownload(file: Omit<AssetFile, 'fileSize'>, isDownload = true): boolean {
const download = this.activeFileDownloads.get(file.fileId);
return download != null && download.isDownload == isDownload;
}

downloadFile(file: Omit<AssetFile, 'fileSize'>, isDownload = true): void {
public searchForReferenceAsset(assetId: number) {
this._store.dispatch(actions.assetClicked({ assetId }));
}

public downloadFile(file: Omit<AssetFile, 'fileSize'>, isDownload = true): void {
this.activeFileDownloads.set(file.fileId, { isDownload });
this.httpClient.get(`/api/files/${file.fileId}`, { responseType: 'blob' }).subscribe({
next: (blob) => {
Expand Down

0 comments on commit c3d2583

Please sign in to comment.