@@ -97,6 +97,7 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
9797 Logger . logVerbose ( this . messages . getMessage ( 'fileNotHavingWrapper' ) ) ;
9898 }
9999 } catch ( err ) {
100+ this . populateExceptionInfo ( file , experienceSitesAssessmentInfo ) ;
100101 Logger . error ( this . messages . getMessage ( 'errorProcessingExperienceSite' , [ file . name ] ) ) ;
101102 Logger . error ( JSON . stringify ( err ) ) ;
102103 }
@@ -168,6 +169,25 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
168169 return experienceSiteAssessmentInfo ;
169170 }
170171
172+ private populateExceptionInfo ( file : File , experienceSiteAssessmentInfos : ExperienceSiteAssessmentInfo [ ] ) : void {
173+ try {
174+ const experienceSiteAssessmentInfo : ExperienceSiteAssessmentInfo = {
175+ name : file . name ,
176+ warnings : [ 'Unknown error occurred' ] ,
177+ errors : [ '' ] ,
178+ infos : [ ] ,
179+ path : file . location ,
180+ diff : JSON . stringify ( [ ] ) ,
181+ hasOmnistudioContent : false ,
182+ status : 'Errors' ,
183+ } ;
184+
185+ experienceSiteAssessmentInfos . push ( experienceSiteAssessmentInfo ) ;
186+ } catch {
187+ Logger . error ( this . messages . getMessage ( 'experienceSiteException' ) ) ;
188+ }
189+ }
190+
171191 private processRegion (
172192 region : ExpSiteRegion ,
173193 experienceSiteAssessmentInfo : ExperienceSiteAssessmentInfo ,
@@ -259,16 +279,22 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
259279 ) : void {
260280 Logger . logVerbose ( this . messages . getMessage ( 'processingFlexcardComponent' , [ JSON . stringify ( component ) ] ) ) ;
261281 const flexcardName = targetName . substring ( 2 ) ; // cfCardName -> CardName
262- const targetDataFromStorageFC : FlexcardStorage = storage . fcStorage . get ( flexcardName ) ;
282+ const targetDataFromStorageFC : FlexcardStorage = storage . fcStorage . get ( flexcardName . toLowerCase ( ) ) ;
263283
264284 Logger . logVerbose ( this . messages . getMessage ( 'targetData' , [ JSON . stringify ( targetDataFromStorageFC ) ] ) ) ;
265285
266286 // Remove later
267287 if ( this . shouldAddWarning ( targetDataFromStorageFC ) ) {
268288 const warningMsg : string = this . getWarningMessage ( flexcardName , targetDataFromStorageFC ) ;
269289 experienceSiteAssessmentInfo . warnings . push ( warningMsg ) ;
290+ experienceSiteAssessmentInfo . status = 'Errors' ;
270291 } else {
271292 component . componentName = TARGET_COMPONENT_NAME_FC ;
293+
294+ const keysToDelete = [ 'target' , 'layout' , 'params' , 'standalone' ] ;
295+
296+ keysToDelete . forEach ( ( key ) => delete currentAttribute [ key ] ) ;
297+
272298 currentAttribute [ 'flexcardName' ] = targetDataFromStorageFC . name ;
273299 currentAttribute [ 'objectApiName' ] = '{!objectApiName}' ;
274300 currentAttribute [ 'recordId' ] = '{!recordId}' ;
@@ -285,7 +311,6 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
285311 Logger . logVerbose ( this . messages . getMessage ( 'processingOmniscriptComponent' , [ JSON . stringify ( component ) ] ) ) ;
286312 // Use storage to find the updated properties
287313 const targetDataFromStorage : OmniScriptStorage = storage . osStorage . get ( targetName . toLowerCase ( ) ) ;
288- StorageUtil . printAssessmentStorage ( ) ;
289314 Logger . logVerbose ( this . messages . getMessage ( 'targetData' , [ JSON . stringify ( targetDataFromStorage ) ] ) ) ;
290315
291316 if ( this . shouldAddWarning ( targetDataFromStorage ) ) {
@@ -303,7 +328,7 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
303328 keysToDelete . forEach ( ( key ) => delete currentAttribute [ key ] ) ;
304329
305330 currentAttribute [ 'direction' ] = 'ltr' ;
306- currentAttribute [ 'display' ] = 'Display button to open Omniscript ' ;
331+ currentAttribute [ 'display' ] = 'Display OmniScript on page ' ;
307332 currentAttribute [ 'inlineVariant' ] = 'brand' ;
308333 currentAttribute [ 'language' ] =
309334 targetDataFromStorage . language === undefined ? 'English' : targetDataFromStorage . language ;
0 commit comments