@@ -6,7 +6,7 @@ import { Tooltip } from 'primeng/tooltip';
66
77import { map , of } from 'rxjs' ;
88
9- import { CommonModule , isPlatformBrowser } from '@angular/common' ;
9+ import { CommonModule } from '@angular/common' ;
1010import {
1111 ChangeDetectionStrategy ,
1212 Component ,
@@ -16,7 +16,6 @@ import {
1616 inject ,
1717 input ,
1818 output ,
19- PLATFORM_ID ,
2019 signal ,
2120 viewChild ,
2221 ViewEncapsulation ,
@@ -25,7 +24,6 @@ import { toSignal } from '@angular/core/rxjs-interop';
2524import { ActivatedRoute } from '@angular/router' ;
2625
2726import { ENVIRONMENT } from '@core/provider/environment.provider' ;
28- import { LoadingSpinnerComponent } from '@osf/shared/components/loading-spinner/loading-spinner.component' ;
2927
3028import { CEDAR_CONFIG , CEDAR_VIEWER_CONFIG } from '../../constants' ;
3129import { CedarMetadataHelper } from '../../helpers' ;
@@ -38,7 +36,7 @@ import {
3836
3937@Component ( {
4038 selector : 'osf-cedar-template-form' ,
41- imports : [ CommonModule , Button , TranslatePipe , Tooltip , Menu , LoadingSpinnerComponent ] ,
39+ imports : [ CommonModule , Button , TranslatePipe , Tooltip , Menu ] ,
4240 templateUrl : './cedar-template-form.component.html' ,
4341 styleUrl : './cedar-template-form.component.scss' ,
4442 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
@@ -65,8 +63,6 @@ export class CedarTemplateFormComponent {
6563
6664 private route = inject ( ActivatedRoute ) ;
6765 readonly environment = inject ( ENVIRONMENT ) ;
68- private platformId = inject ( PLATFORM_ID ) ;
69- readonly cedarLoaded = signal < boolean > ( false ) ;
7066
7167 readonly recordId = signal < string > ( '' ) ;
7268 readonly downloadUrl = signal < string > ( '' ) ;
@@ -93,15 +89,15 @@ export class CedarTemplateFormComponent {
9389 effect ( ( ) => {
9490 const tpl = this . template ( ) ;
9591 if ( tpl ?. attributes ?. template ) {
96- this . loadCedarLibraries ( ) . then ( ( ) => this . initializeCedar ( ) ) ;
92+ this . initializeCedar ( ) ;
9793 }
9894 } ) ;
9995
10096 effect ( ( ) => {
10197 const record = this . existingRecord ( ) ;
10298 this . schemaName . set ( record ?. embeds ?. template . data . attributes . schema_name || '' ) ;
10399 if ( record ) {
104- this . loadCedarLibraries ( ) . then ( ( ) => this . initializeCedar ( ) ) ;
100+ this . initializeCedar ( ) ;
105101 }
106102 } ) ;
107103 }
@@ -138,19 +134,6 @@ export class CedarTemplateFormComponent {
138134 }
139135 }
140136
141- private async loadCedarLibraries ( ) : Promise < void > {
142- if ( ! isPlatformBrowser ( this . platformId ) || this . cedarLoaded ( ) ) {
143- return ;
144- }
145-
146- try {
147- await Promise . all ( [ import ( 'cedar-artifact-viewer' ) , import ( 'cedar-embeddable-editor' ) ] ) ;
148- this . cedarLoaded . set ( true ) ;
149- } catch {
150- this . cedarLoaded . set ( false ) ;
151- }
152- }
153-
154137 downloadMetadadaRecord ( ) {
155138 if ( this . fileGuid ( ) ) {
156139 window . open ( `${ this . environment . webUrl } /metadata/${ this . fileGuid ( ) } ` ) ?. focus ( ) ;
0 commit comments