Browse Source

fix(admin-ui): Fix link to Asset detail from asset picker

Closes #2411
Michael Bromley 2 years ago
parent
commit
4539de36da

+ 1 - 1
packages/admin-ui/src/lib/core/src/shared/components/asset-gallery/asset-gallery.component.html

@@ -46,7 +46,7 @@
                 >
                 >
             </ng-container>
             </ng-container>
             <div *ngIf="selectionManager.selection.length === 1">
             <div *ngIf="selectionManager.selection.length === 1">
-                <a [routerLink]="['./', lastSelected().id]" class="button-ghost">
+                <a [routerLink]="['/catalog/assets/', lastSelected().id]" (click)="editAssetClick.emit()" class="button-ghost">
                     <clr-icon shape="pencil"></clr-icon> {{ 'common.edit' | translate }}
                     <clr-icon shape="pencil"></clr-icon> {{ 'common.edit' | translate }}
                     <clr-icon shape="arrow right"></clr-icon>
                     <clr-icon shape="arrow right"></clr-icon>
                 </a>
                 </a>

+ 10 - 1
packages/admin-ui/src/lib/core/src/shared/components/asset-gallery/asset-gallery.component.ts

@@ -1,4 +1,12 @@
-import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
+import {
+    ChangeDetectionStrategy,
+    Component,
+    EventEmitter,
+    Input,
+    OnChanges,
+    Output,
+    SimpleChanges,
+} from '@angular/core';
 
 
 import { SelectionManager } from '../../../common/utilities/selection-manager';
 import { SelectionManager } from '../../../common/utilities/selection-manager';
 import { ModalService } from '../../../providers/modal/modal.service';
 import { ModalService } from '../../../providers/modal/modal.service';
@@ -21,6 +29,7 @@ export class AssetGalleryComponent implements OnChanges {
     @Input() canDelete = false;
     @Input() canDelete = false;
     @Output() selectionChange = new EventEmitter<AssetLike[]>();
     @Output() selectionChange = new EventEmitter<AssetLike[]>();
     @Output() deleteAssets = new EventEmitter<AssetLike[]>();
     @Output() deleteAssets = new EventEmitter<AssetLike[]>();
+    @Output() editAssetClick = new EventEmitter<void>();
 
 
     selectionManager = new SelectionManager<AssetLike>({
     selectionManager = new SelectionManager<AssetLike>({
         multiSelect: this.multiSelect,
         multiSelect: this.multiSelect,

+ 1 - 0
packages/admin-ui/src/lib/core/src/shared/components/asset-picker-dialog/asset-picker-dialog.component.html

@@ -21,6 +21,7 @@
     [assets]="(assets$ | async)! | paginate: paginationConfig"
     [assets]="(assets$ | async)! | paginate: paginationConfig"
     [multiSelect]="multiSelect"
     [multiSelect]="multiSelect"
     (selectionChange)="selection = $event"
     (selectionChange)="selection = $event"
+    (editAssetClick)="cancel()"
     #assetGalleryComponent
     #assetGalleryComponent
 ></vdr-asset-gallery>
 ></vdr-asset-gallery>