diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts index a0ac89edb..e727e4983 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts @@ -180,6 +180,7 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { ] ); deleteAccessorySub: Subscription; + copyDigestSub: Subscription; @ViewChild('datagrid') datagrid; constructor( @@ -241,6 +242,14 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { } ); } + if (!this.copyDigestSub) { + this.copyDigestSub = this.eventService.subscribe( + HarborEvent.COPY_DIGEST, + (a: Accessory) => { + this.copyDigestComponent.showDigestId(a.digest); + } + ); + } } ngOnDestroy() { @@ -252,6 +261,10 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { this.deleteAccessorySub.unsubscribe(); this.deleteAccessorySub = null; } + if (this.copyDigestSub) { + this.copyDigestSub.unsubscribe(); + this.copyDigestSub = null; + } this.datagrid['columnsService']?.columns?.forEach((item, index) => { if (this.depth) { this.hiddenArray[index] = !!item?._value?.hidden; diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/sub-accessories/sub-accessories.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/sub-accessories/sub-accessories.component.html index f4f993329..5f8071f2d 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/sub-accessories/sub-accessories.component.html +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/sub-accessories/sub-accessories.component.html @@ -11,9 +11,12 @@ *ngFor="let a of displayedAccessories; let i = index" [clrDgItem]="a"> - +