@@ -19,8 +19,9 @@ const defaultSettings = {
1919 stdcmName : 'Stdcm' ,
2020 stdcmLogo : undefined ,
2121 stdcmSimulationSheetLogo : undefined ,
22- isCustomizedDeployment : false ,
22+ hasCustomizedLogo : false ,
2323 stdcmFeedbackMail :
'[email protected] ' , 24+ noInfraEdit : false ,
2425} ;
2526
2627export type DeploymentSettings = {
@@ -30,8 +31,9 @@ export type DeploymentSettings = {
3031 stdcmName : string ;
3132 stdcmLogo ?: string ;
3233 stdcmSimulationSheetLogo ?: string ;
33- isCustomizedDeployment : boolean ;
34+ hasCustomizedLogo : boolean ;
3435 stdcmFeedbackMail ?: string ;
36+ noInfraEdit ?: boolean ;
3537} ;
3638
3739export type DeploymentSettingsContext = {
@@ -76,25 +78,46 @@ export const DeploymentContextProvider = ({ children }: DeploymentContextProvide
7678 } ) ;
7779 } else {
7880 const overridesData = await response . json ( ) ;
79- const { icons, names, stdcm_feedback_mail } = overridesData ;
81+ const { icons, names, stdcm_feedback_mail, no_infra_edit } = overridesData ;
82+
83+ const deploySettings : DeploymentSettings = {
84+ ...defaultSettings ,
85+ } ;
86+
87+ if ( names ) {
88+ if ( names . digital_twin ) {
89+ deploySettings . digitalTwinName = names . digital_twin ;
90+ }
91+ if ( names . stdcm ) {
92+ deploySettings . stdcmName = names . stdcm ;
93+ }
94+ }
95+
96+ if ( icons ) {
97+ deploySettings . hasCustomizedLogo = true ;
98+
99+ if ( icons . digital_twin ) {
100+ deploySettings . digitalTwinLogo = `/overrides/${ icons . digital_twin . dark } _Logo_Grey40.svg` ;
101+ deploySettings . digitalTwinLogoWithName = `/overrides/${ icons . digital_twin . dark } _Grey10.svg` ;
102+ }
103+
104+ if ( icons . stdcm ) {
105+ deploySettings . stdcmLogo = `/overrides/${ icons . stdcm . light } .svg` ;
106+ deploySettings . stdcmSimulationSheetLogo = `/overrides/${ icons . stdcm . light } @2x.png` ;
107+ }
108+ }
80109
81- const lmrLogoPath = `/overrides/${ icons . stdcm . light } .svg` ;
82- const lmrPngLogoPath = `/overrides/${ icons . stdcm . light } @2x.png` ;
83- const horizonLogoWithNamePath = `/overrides/${ icons . digital_twin . dark } _Grey10.svg` ;
84- const horizonLogoPath = `/overrides/${ icons . digital_twin . dark } _Logo_Grey40.svg` ;
110+ if ( stdcm_feedback_mail ) {
111+ deploySettings . stdcmFeedbackMail = stdcm_feedback_mail ;
112+ }
113+
114+ if ( no_infra_edit ) {
115+ deploySettings . noInfraEdit = no_infra_edit ;
116+ }
85117
86118 setCustomizedDeploymentSetting ( {
87119 isLoading : false ,
88- deploymentSettings : {
89- digitalTwinName : names . digital_twin ,
90- digitalTwinLogo : horizonLogoPath ,
91- digitalTwinLogoWithName : horizonLogoWithNamePath ,
92- stdcmName : names . stdcm ,
93- stdcmLogo : lmrLogoPath ,
94- stdcmSimulationSheetLogo : lmrPngLogoPath ,
95- isCustomizedDeployment : true ,
96- stdcmFeedbackMail : stdcm_feedback_mail ,
97- } ,
120+ deploymentSettings : deploySettings ,
98121 } ) ;
99122 }
100123 } catch ( error ) {
0 commit comments