@@ -11,6 +11,7 @@ import {
1111 DestroyRef ,
1212 effect ,
1313 inject ,
14+ OnDestroy ,
1415 OnInit ,
1516 signal ,
1617} from '@angular/core' ;
@@ -24,6 +25,7 @@ import { MetadataResourceEnum } from '@osf/shared/enums/metadata-resource.enum';
2425import { ResourceType } from '@osf/shared/enums/resource-type.enum' ;
2526import { CustomConfirmationService } from '@osf/shared/services/custom-confirmation.service' ;
2627import { CustomDialogService } from '@osf/shared/services/custom-dialog.service' ;
28+ import { SignpostingService } from '@osf/shared/services/signposting.service' ;
2729import { ToastService } from '@osf/shared/services/toast.service' ;
2830import { CollectionsSelectors , GetProjectSubmissions } from '@osf/shared/stores/collections' ;
2931import {
@@ -117,14 +119,15 @@ import {
117119 styleUrl : './metadata.component.scss' ,
118120 changeDetection : ChangeDetectionStrategy . OnPush ,
119121} )
120- export class MetadataComponent implements OnInit {
122+ export class MetadataComponent implements OnInit , OnDestroy {
121123 private readonly activeRoute = inject ( ActivatedRoute ) ;
122124 private readonly router = inject ( Router ) ;
123125 private readonly destroyRef = inject ( DestroyRef ) ;
124126 private readonly customDialogService = inject ( CustomDialogService ) ;
125127 private readonly toastService = inject ( ToastService ) ;
126128 private readonly customConfirmationService = inject ( CustomConfirmationService ) ;
127129 private readonly environment = inject ( ENVIRONMENT ) ;
130+ private readonly signpostingService = inject ( SignpostingService ) ;
128131
129132 private resourceId = '' ;
130133
@@ -264,12 +267,18 @@ export class MetadataComponent implements OnInit {
264267 this . actions . getCedarTemplates ( ) ;
265268 this . actions . fetchSelectedSubjects ( this . resourceId , this . resourceType ( ) ) ;
266269
270+ this . signpostingService . addMetadataSignposting ( this . resourceId ) ;
271+
267272 if ( this . isProjectType ( ) ) {
268273 this . actions . getProjectSubmissions ( this . resourceId ) ;
269274 }
270275 }
271276 }
272277
278+ ngOnDestroy ( ) : void {
279+ this . signpostingService . removeSignpostingLinkTags ( ) ;
280+ }
281+
273282 onTabChange ( tabId : string | number ) : void {
274283 const tab = this . tabs ( ) . find ( ( x ) => x . id === tabId . toString ( ) ) ;
275284
0 commit comments