|
1 | 1 | import proj4 from 'proj4'
|
2 | 2 |
|
| 3 | +import { DISABLE_DRAWING_MENU_FOR_LEGACY_ON_HOSTNAMES } from '@/config' |
3 | 4 | import { transformLayerIntoUrlString } from '@/router/storeSync/LayerParamConfig.class'
|
4 | 5 | import { LV95, WEBMERCATOR, WGS84 } from '@/utils/coordinates/coordinateSystems'
|
5 | 6 | import CustomCoordinateSystem from '@/utils/coordinates/CustomCoordinateSystem.class'
|
@@ -144,6 +145,10 @@ const handleLegacyParams = (legacyParams, store, to, next) => {
|
144 | 145 | const { projection } = store.state.position
|
145 | 146 | let legacyCoordinates = []
|
146 | 147 | let latlongCoordinates = []
|
| 148 | + // TODO BGDIINF_SB-2685: remove once legacy prod is decommissioned |
| 149 | + const isOnDevelopmentHost = DISABLE_DRAWING_MENU_FOR_LEGACY_ON_HOSTNAMES.some( |
| 150 | + (hostname) => hostname === store.state.ui.hostname |
| 151 | + ) |
147 | 152 |
|
148 | 153 | Object.keys(legacyParams).forEach((param) => {
|
149 | 154 | handleLegacyParam(
|
@@ -177,11 +182,10 @@ const handleLegacyParams = (legacyParams, store, to, next) => {
|
177 | 182 | const urlWithoutQueryParam = window.location.href.substr(0, window.location.href.indexOf('?'))
|
178 | 183 | window.history.replaceState(window.history.state, document.title, urlWithoutQueryParam)
|
179 | 184 |
|
180 |
| - // TODO BGDIINF_SB-2685: re-activate once on prod |
181 |
| - // we cannot let adminId get through right now because legacy KML will be broken by the new viewer if edited |
182 |
| - // (broken in a sense that they will not be usable by mf-geoadmin3 anymore) |
183 |
| - const absolutelyNot = () => false |
184 |
| - if (absolutelyNot() && 'adminId' in legacyParams) { |
| 185 | + // TODO BGDIINF_SB-2685: remove dev host check when map.geo.admin.ch hosts web-mapviewer's code |
| 186 | + // we cannot let adminId get through right now (on our dev envs) because legacy KML will be broken by the |
| 187 | + // new viewer if edited (broken in a sense that they will not be usable by mf-geoadmin3 anymore) |
| 188 | + if (!isOnDevelopmentHost && 'adminId' in legacyParams) { |
185 | 189 | // adminId legacy param cannot be handle above in the loop because it needs to add a layer
|
186 | 190 | // to the layers param, thats why we do handle after.
|
187 | 191 | handleLegacyKmlAdminIdParam(legacyParams, newQuery)
|
|
0 commit comments