Skip to content

Commit

Permalink
Merge pull request #1137 from geoadmin/fix-pb-1128-permalink-problem
Browse files Browse the repository at this point in the history
PB-1128: fix permalink custom attributes
  • Loading branch information
pakb authored Nov 26, 2024
2 parents 6180886 + 64cf53f commit 0e9fc33
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/store/modules/layers.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ const actions = {
const clone = layerConfig.clone()
clone.visible = layer.visible
clone.opacity = layer.opacity
clone.customAttributes = layer.customAttributes
if (layer.timeConfig) {
clone.timeConfig.updateCurrentTimeEntry(
clone.timeConfig.getTimeEntryForYear(layer.timeConfig.currentYear)
Expand Down
16 changes: 16 additions & 0 deletions tests/cypress/tests-e2e/layers.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1368,4 +1368,20 @@ describe('Test of layer handling', () => {
cy.wait('@geojson-data', { timeout: 5000 })
})
})
context('Custom url attributes', () => {
it('Keep custom attributes when changing language', () => {
cy.goToMapView({
lang: 'fr',
})
cy.wait(['@routeChange', '@layers', '@topics', '@topic-ech'])
cy.goToMapView({
lang: 'en',
bgLayer: 'ch.swisstopo.pixelkarte-farbe',
topic: 'ech',
layers: 'WMS|https://wms.geo.admin.ch/?item=2024-10-30t103151|test.background.layer@item=2024-10-30t103151',
})
cy.wait(['@routeChange', '@layers', '@topics', '@topic-ech'])
cy.url().should('contain', 'item=2024-10-30t103151')
})
})
})

0 comments on commit 0e9fc33

Please sign in to comment.