@@ -8,6 +8,7 @@ type RemoteConfigEntries = {
8
8
"data_disclaimer_severity" : string ,
9
9
"path_contributors" : string ,
10
10
"path_data_department" : string ,
11
+ "path_monkeypox_data_department" : string ,
11
12
"path_list_departments" : string ,
12
13
"path_stats" : string ,
13
14
"url_base" : string ,
@@ -22,6 +23,7 @@ const REMOTE_CONFIG_ENTRIES_FALLBACK: RemoteConfigEntries = {
22
23
"data_disclaimer_severity" : "warning" ,
23
24
"path_contributors" : "/vitemadose/contributors_all.json" ,
24
25
"path_data_department" : "/vitemadose/{code}.json" ,
26
+ "path_monkeypox_data_department" : "/vitemadose/monkeypox/{code}.json" ,
25
27
"path_list_departments" : "/vitemadose/departements.json" ,
26
28
"path_stats" : "/vitemadose/stats.json" ,
27
29
"url_base" : "https://vitemadose.gitlab.io" ,
@@ -68,7 +70,13 @@ export class RemoteConfig {
68
70
statsByDate : ( ) => `/offline/stats_by_date.json` ,
69
71
stats : ( ) => `/offline/stats.json` ,
70
72
infosDepartement : ( codeDepartement ) => `/offline/${ codeDepartement } .json` ,
71
- creneauxQuotidiensDepartement : ( codeDepartement ) => `/offline/${ codeDepartement } /creneaux-quotidiens.json`
73
+ creneauxQuotidiensDepartement : ( codeDepartement , doseType ) => {
74
+ if ( doseType == 'covid' ) {
75
+ return `/offline/${ codeDepartement } /creneaux-quotidiens.json` ;
76
+ }
77
+
78
+ return `/offline/monkeypox/${ codeDepartement } /creneaux-quotidiens.json`
79
+ }
72
80
} ;
73
81
this . configurationSyncedPromise = Promise . resolve ( ) ;
74
82
@@ -105,12 +113,19 @@ export class RemoteConfig {
105
113
const statsByDatePath = `/vitemadose/stats_by_date.json` ;
106
114
const departementsListPath = this . configuration . path_list_departments || `/vitemadose/departements.json` ;
107
115
const infosDepartementPath = this . configuration . path_data_department || `/vitemadose/{code}.json` ;
116
+ const monkeypoxDepartmentDataPath = this . configuration . path_monkeypox_data_department || REMOTE_CONFIG_ENTRIES_FALLBACK . path_monkeypox_data_department ;
108
117
this . _urlGenerator = {
109
118
listDepartements : ( ) => `${ urlBase } ${ departementsListPath } ` ,
110
119
statsByDate : ( ) => `${ urlBase } ${ statsByDatePath } ` ,
111
120
stats : ( ) => `${ urlBase } ${ statsPath } ` ,
112
- infosDepartement : ( codeDepartement ) => `${ urlBase } ${ infosDepartementPath . replace ( '{code}' , codeDepartement ) } ` ,
113
- creneauxQuotidiensDepartement : ( codeDepartement ) => `${ urlBase } /vitemadose/${ codeDepartement } /creneaux-quotidiens.json`
121
+ infosDepartement : ( codeDepartement , doseType ) => doseType === 'monkeypox' ? `${ urlBase } ${ monkeypoxDepartmentDataPath . replace ( '{code}' , codeDepartement ) } ` : `${ urlBase } ${ infosDepartementPath . replace ( '{code}' , codeDepartement ) } ` ,
122
+ creneauxQuotidiensDepartement : ( codeDepartement , doseType ) => {
123
+ if ( doseType == 'covid' ) {
124
+ return `${ urlBase } /vitemadose/${ codeDepartement } /creneaux-quotidiens.json` ;
125
+ }
126
+
127
+ return `${ urlBase } /vitemadose/monkeypox/${ codeDepartement } /creneaux-quotidiens.json` ;
128
+ }
114
129
} ;
115
130
} else if ( USE_GITLAB_AS_FALLBACK ) {
116
131
this . _urlGenerator = GITLAB_DATA_URLS ;
0 commit comments