@@ -3,6 +3,7 @@ import { container } from 'tsyringe';
33import { AdminDataSource } from '../../datasources/AdminDataSource' ;
44import { FeatureId } from '../../models/Feature' ;
55import { SettingsId } from '../../models/Settings' ;
6+ import { isDevelopment , isStaging } from '../../utils/helperFunctions' ;
67import { setTimezone , setDateTimeFormats } from '../setTimezoneAndFormat' ;
78import { Tokens } from '../Tokens' ;
89import { updateOIDCSettings } from '../updateOIDCSettings' ;
@@ -16,7 +17,7 @@ function getBaseURL() {
1617 return url ;
1718}
1819
19- async function setDLSColourTheme ( ) {
20+ async function setDLSColourTheme ( primaryMainColour : string ) {
2021 const db = container . resolve < AdminDataSource > ( Tokens . AdminDataSource ) ;
2122
2223 await db . waitForDBUpgrade ( ) ;
@@ -28,7 +29,7 @@ async function setDLSColourTheme() {
2829 } ) ,
2930 db . updateSettings ( {
3031 settingsId : SettingsId . PALETTE_PRIMARY_MAIN ,
31- settingsValue : '#202945' ,
32+ settingsValue : primaryMainColour ,
3233 } ) ,
3334 db . updateSettings ( {
3435 settingsId : SettingsId . PALETTE_PRIMARY_LIGHT ,
@@ -142,13 +143,20 @@ async function enableDefaultDLSFeatures() {
142143}
143144
144145async function configureDLSEnvironment ( ) {
145- await Promise . all ( [
146- setDLSColourTheme ( ) ,
147- enableDefaultDLSFeatures ( ) ,
148- setTimezone ( ) ,
149- setDateTimeFormats ( ) ,
150- updateOIDCSettings ( ) ,
151- ] ) ;
146+ if ( isDevelopment ) {
147+ await setDLSColourTheme ( '#b3022b' ) ;
148+ }
149+ if ( isStaging ) {
150+ await setDLSColourTheme ( '#8B008B' ) ;
151+ }
152+ if ( isDevelopment ) {
153+ await Promise . all ( [
154+ enableDefaultDLSFeatures ( ) ,
155+ setTimezone ( ) ,
156+ setDateTimeFormats ( ) ,
157+ updateOIDCSettings ( ) ,
158+ ] ) ;
159+ }
152160}
153161
154162export { configureDLSEnvironment , getBaseURL } ;
0 commit comments