@@ -25,9 +25,6 @@ import { ActivatedRoute } from '@angular/router';
2525
2626import { ENVIRONMENT } from '@core/provider/environment.provider' ;
2727
28- import 'cedar-artifact-viewer' ;
29- import 'cedar-embeddable-editor' ;
30-
3128import { CEDAR_CONFIG , CEDAR_VIEWER_CONFIG } from '../../constants' ;
3229import { CedarMetadataHelper } from '../../helpers' ;
3330import {
@@ -71,6 +68,8 @@ export class CedarTemplateFormComponent {
7168 readonly downloadUrl = signal < string > ( '' ) ;
7269 readonly schemaName = signal < string > ( '' ) ;
7370
71+ readonly fileGuid = toSignal ( this . route . params . pipe ( map ( ( params ) => params [ 'fileGuid' ] ) ) ?? of ( undefined ) ) ;
72+
7473 shareItems = [
7574 {
7675 label : 'files.detail.actions.share.email' ,
@@ -123,7 +122,17 @@ export class CedarTemplateFormComponent {
123122 this . validateCedarMetadata ( ) ;
124123 }
125124
126- readonly fileGuid = toSignal ( this . route . params . pipe ( map ( ( params ) => params [ 'fileGuid' ] ) ) ?? of ( undefined ) ) ;
125+ private initializeFormData ( ) : void {
126+ const template = this . template ( ) ?. attributes ?. template ;
127+ if ( ! template ) return ;
128+ const metadata = this . existingRecord ( ) ?. attributes ?. metadata ;
129+ if ( this . existingRecord ( ) ) {
130+ const structuredMetadata = CedarMetadataHelper . buildStructuredMetadata ( metadata ) ;
131+ this . formData . set ( structuredMetadata ) ;
132+ } else {
133+ this . formData . set ( CedarMetadataHelper . buildEmptyMetadata ( ) ) ;
134+ }
135+ }
127136
128137 downloadMetadadaRecord ( ) {
129138 if ( this . fileGuid ( ) ) {
@@ -174,18 +183,6 @@ export class CedarTemplateFormComponent {
174183 }
175184 }
176185
177- private initializeFormData ( ) : void {
178- const template = this . template ( ) ?. attributes ?. template ;
179- if ( ! template ) return ;
180- const metadata = this . existingRecord ( ) ?. attributes ?. metadata ;
181- if ( this . existingRecord ( ) ) {
182- const structuredMetadata = CedarMetadataHelper . buildStructuredMetadata ( metadata ) ;
183- this . formData . set ( structuredMetadata ) ;
184- } else {
185- this . formData . set ( CedarMetadataHelper . buildEmptyMetadata ( ) ) ;
186- }
187- }
188-
189186 handleEmailShare ( ) : void {
190187 const url = window . location . href ;
191188 window . location . href = `mailto:?subject=${ this . schemaName ( ) } &body=${ url } ` ;
0 commit comments