@@ -26,7 +26,6 @@ import { ActivatedRoute } from '@angular/router';
2626import { ENVIRONMENT } from '@core/provider/environment.provider' ;
2727
2828import 'cedar-artifact-viewer' ;
29- import 'cedar-embeddable-editor' ;
3029
3130import { CEDAR_CONFIG , CEDAR_VIEWER_CONFIG } from '../../constants' ;
3231import { CedarMetadataHelper } from '../../helpers' ;
@@ -71,6 +70,8 @@ export class CedarTemplateFormComponent {
7170 readonly downloadUrl = signal < string > ( '' ) ;
7271 readonly schemaName = signal < string > ( '' ) ;
7372
73+ readonly fileGuid = toSignal ( this . route . params . pipe ( map ( ( params ) => params [ 'fileGuid' ] ) ) ?? of ( undefined ) ) ;
74+
7475 shareItems = [
7576 {
7677 label : 'files.detail.actions.share.email' ,
@@ -123,7 +124,17 @@ export class CedarTemplateFormComponent {
123124 this . validateCedarMetadata ( ) ;
124125 }
125126
126- readonly fileGuid = toSignal ( this . route . params . pipe ( map ( ( params ) => params [ 'fileGuid' ] ) ) ?? of ( undefined ) ) ;
127+ private initializeFormData ( ) : void {
128+ const template = this . template ( ) ?. attributes ?. template ;
129+ if ( ! template ) return ;
130+ const metadata = this . existingRecord ( ) ?. attributes ?. metadata ;
131+ if ( this . existingRecord ( ) ) {
132+ const structuredMetadata = CedarMetadataHelper . buildStructuredMetadata ( metadata ) ;
133+ this . formData . set ( structuredMetadata ) ;
134+ } else {
135+ this . formData . set ( CedarMetadataHelper . buildEmptyMetadata ( ) ) ;
136+ }
137+ }
127138
128139 downloadMetadadaRecord ( ) {
129140 if ( this . fileGuid ( ) ) {
@@ -174,18 +185,6 @@ export class CedarTemplateFormComponent {
174185 }
175186 }
176187
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-
189188 handleEmailShare ( ) : void {
190189 const url = window . location . href ;
191190 window . location . href = `mailto:?subject=${ this . schemaName ( ) } &body=${ url } ` ;
0 commit comments