Skip to content

Commit 01aff9d

Browse files
committed
BGDIINF_SB-3194: Renaming generic catalogue from topic to catalogue
1 parent d09804b commit 01aff9d

File tree

6 files changed

+40
-40
lines changed

6 files changed

+40
-40
lines changed

src/modules/menu/components/LayerCatalogue.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function clearPreviewLayer() {
2424
</script>
2525

2626
<template>
27-
<div class="menu-topic-list" data-cy="menu-topic-tree" @mouseleave="clearPreviewLayer">
27+
<div class="menu-catalogue-list" @mouseleave="clearPreviewLayer">
2828
<LayerCatalogueItem
2929
v-for="item in layerCatalogue"
3030
:key="item.getID()"

src/modules/menu/components/LayerCatalogueItem.vue

+9-9
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ function onItemClick() {
8888
</script>
8989
9090
<template>
91-
<div class="menu-topic-item" data-cy="topic-tree-item">
91+
<div class="menu-catalogue-item" data-cy="catalogue-tree-item">
9292
<div
93-
class="menu-topic-item-title"
93+
class="menu-catalogue-item-title"
9494
:class="{ group: hasChildren }"
95-
:data-cy="`topic-tree-item-${item.getID()}`"
95+
:data-cy="`catalogue-tree-item-${item.getID()}`"
9696
@click="onItemClick"
9797
@mouseenter="startLayerPreview"
9898
>
@@ -120,12 +120,12 @@ function onItemClick() {
120120
}`"
121121
/>
122122
</button>
123-
<span class="menu-topic-item-name">{{ item.name }}</span>
123+
<span class="menu-catalogue-item-name">{{ item.name }}</span>
124124
<button
125125
v-if="canBeAddedToTheMap"
126126
class="btn"
127127
:class="{ 'btn-lg': !compact }"
128-
data-cy="topic-tree-item-info"
128+
data-cy="catalogue-tree-item-info"
129129
@click.stop="showLayerLegend = true"
130130
>
131131
<FontAwesomeIcon icon="info-circle" />
@@ -134,7 +134,7 @@ function onItemClick() {
134134
<CollapseTransition :duration="200">
135135
<ul
136136
v-show="showChildren"
137-
class="menu-topic-item-children"
137+
class="menu-catalogue-item-children"
138138
:class="`ps-${2 + 2 * depth}`"
139139
>
140140
<LayerCatalogueItem
@@ -158,7 +158,7 @@ function onItemClick() {
158158
@import 'src/scss/webmapviewer-bootstrap-theme';
159159
@import 'src/modules/menu/scss/menu-items';
160160
161-
.menu-topic-item {
161+
.menu-catalogue-item {
162162
border-bottom: none;
163163
164164
&-title {
@@ -177,10 +177,10 @@ function onItemClick() {
177177
}
178178
}
179179
}
180-
.menu-topic-item-name {
180+
.menu-catalogue-item-name {
181181
@extend .menu-name;
182182
}
183-
.menu-topic-item-children {
183+
.menu-catalogue-item-children {
184184
@extend .menu-list;
185185
}
186186
</style>

src/modules/menu/components/topics/MenuTopicSection.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
@close="showTopicSelectionPopup = false"
2525
/>
2626
</template>
27-
<LayerCatalogue :layer-catalogue="currentTopicTree" :compact="compact" />
27+
<LayerCatalogue
28+
data-cy="menu-topic-tree"
29+
:layer-catalogue="currentTopicTree"
30+
:compact="compact"
31+
/>
2832
</MenuSection>
2933
</template>
3034

@@ -90,10 +94,6 @@ export default {
9094
<style lang="scss" scoped>
9195
@import 'src/modules/menu/scss/menu-items';
9296
93-
.menu-topic-list {
94-
@extend .menu-list;
95-
overflow-y: auto;
96-
}
9797
.menu-topic-switch {
9898
border: 0;
9999
background: none;

tests/e2e-cypress/integration/header.cy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ describe('Test functions for the header / search bar', () => {
9292
}
9393
cy.get('[data-cy="change-topic-button"]').click()
9494
cy.get('[data-cy="change-to-topic-test-topic-standard"]').click()
95-
cy.get('[data-cy="topic-tree-item-2"]').click()
96-
cy.get('[data-cy="topic-tree-item-5"]').click()
97-
cy.get('[data-cy="topic-tree-item-test.wms.layer"]').click()
95+
cy.get('[data-cy="catalogue-tree-item-2"]').click()
96+
cy.get('[data-cy="catalogue-tree-item-5"]').click()
97+
cy.get('[data-cy="catalogue-tree-item-test.wms.layer"]').click()
9898
cy.readStoreValue('state.layers.activeLayers').should('have.length', 1)
9999
}
100100
it('Reload the app with current topic/lang when clicking on the swiss flag', () => {

tests/e2e-cypress/integration/layers.cy.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,15 @@ describe('Test of layer handling', () => {
277277
cy.goToMapView()
278278
cy.clickOnMenuButtonIfMobile()
279279
const testLayerId = 'test.wmts.layer'
280-
const testLayerSelector = `[data-cy="topic-tree-item-${testLayerId}"]`
280+
const testLayerSelector = `[data-cy="catalogue-tree-item-${testLayerId}"]`
281281
cy.get('[data-cy="menu-topic-section"]').click()
282282
// opening up layer parents in the topic tree
283-
cy.get('[data-cy="topic-tree-item-2"]').click()
284-
cy.get('[data-cy="topic-tree-item-3"]').click()
283+
cy.get('[data-cy="catalogue-tree-item-2"]').click()
284+
cy.get('[data-cy="catalogue-tree-item-3"]').click()
285285
// Find the test layer and open the appropriate menu entries.
286286
cy.get(testLayerSelector)
287287
.parentsUntil('[data-cy="menu-topic-section"]')
288-
.filter('[data-cy="topic-tree-item"]')
288+
.filter('[data-cy="catalogue-tree-item"]')
289289
.then((menuItems) => {
290290
menuItems
291291
.toArray()
@@ -348,15 +348,15 @@ describe('Test of layer handling', () => {
348348
})
349349
it('allows toggling layers visibility from the topic menu', () => {
350350
const testLayerId = 'test.wmts.layer'
351-
const testLayerSelector = `[data-cy="topic-tree-item-${testLayerId}"]`
351+
const testLayerSelector = `[data-cy="catalogue-tree-item-${testLayerId}"]`
352352
cy.get('[data-cy="menu-topic-section"]').click()
353353
// opening up layer parents in the topic tree
354-
cy.get('[data-cy="topic-tree-item-2"]').click()
355-
cy.get('[data-cy="topic-tree-item-3"]').click()
354+
cy.get('[data-cy="catalogue-tree-item-2"]').click()
355+
cy.get('[data-cy="catalogue-tree-item-3"]').click()
356356
// Find the test layer and open the appropriate menu entries.
357357
cy.get(testLayerSelector)
358358
.parentsUntil('[data-cy="menu-topic-section"]')
359-
.filter('[data-cy="topic-tree-item"]')
359+
.filter('[data-cy="catalogue-tree-item"]')
360360
.then((menuItems) => {
361361
menuItems
362362
.toArray()

tests/e2e-cypress/integration/topics.cy.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,17 @@ describe('Topics', () => {
167167
cy.get('[data-cy="menu-topic-tree"]').should('be.visible')
168168

169169
// it must not open the first elements of the tree by default
170-
cy.get('[data-cy="topic-tree-item-2"]').should('be.visible')
171-
cy.get('[data-cy="topic-tree-item-3"]').should('not.be.visible')
170+
cy.get('[data-cy="catalogue-tree-item-2"]').should('be.visible')
171+
cy.get('[data-cy="catalogue-tree-item-3"]').should('not.be.visible')
172172

173173
// shows a topic tree item's children when we click on it
174-
cy.get('[data-cy="topic-tree-item-2"]').click()
175-
cy.get('[data-cy="topic-tree-item-3"]').should('be.visible')
174+
cy.get('[data-cy="catalogue-tree-item-2"]').click()
175+
cy.get('[data-cy="catalogue-tree-item-3"]').should('be.visible')
176176

177177
// it adds a layer to the map when we click on its name in the topic tree
178-
cy.get('[data-cy="topic-tree-item-3"]').click()
178+
cy.get('[data-cy="catalogue-tree-item-3"]').click()
179179
cy.readStoreValue('state.layers.activeLayers').should('be.empty')
180-
cy.get('[data-cy="topic-tree-item-test.wmts.layer"]').click()
180+
cy.get('[data-cy="catalogue-tree-item-test.wmts.layer"]').click()
181181
cy.readStoreValue('state.layers.activeLayers').then((activeLayers) => {
182182
expect(activeLayers).to.be.an('Array').lengthOf(1)
183183
const [firstLayer] = activeLayers
@@ -191,19 +191,19 @@ describe('Topics', () => {
191191
`<div>${expectedContent}</div>`
192192
).as('legend')
193193

194-
cy.get('[data-cy="topic-tree-item-info"]').first().click()
194+
cy.get('[data-cy="catalogue-tree-item-info"]').first().click()
195195
cy.get('[data-cy="layer-legend-popup"]').should('be.visible').contains(expectedContent)
196196
})
197197

198198
if (!isMobileViewport) {
199199
it('previews the layer on hover', () => {
200200
const expectedLayerId = 'test.wmts.layer'
201-
const layerSelector = `[data-cy="topic-tree-item-${expectedLayerId}"]`
201+
const layerSelector = `[data-cy="catalogue-tree-item-${expectedLayerId}"]`
202202

203203
cy.goToMapView()
204204
cy.get('[data-cy="menu-topic-section"]').click()
205-
cy.get('[data-cy="topic-tree-item-2"]').click()
206-
cy.get('[data-cy="topic-tree-item-3"]').click()
205+
cy.get('[data-cy="catalogue-tree-item-2"]').click()
206+
cy.get('[data-cy="catalogue-tree-item-3"]').click()
207207

208208
cy.get(layerSelector).trigger('mouseenter')
209209
cy.readStoreValue('getters.visibleLayers').then((visibleLayers) => {
@@ -240,15 +240,15 @@ describe('Topics', () => {
240240
}
241241

242242
// it should open the menu section by default if some catalog nodes are set in the URL (even if the default topic is shown)
243-
cy.get('[data-cy="topic-tree-item-2"]').should('be.visible')
244-
cy.get('[data-cy="topic-tree-item-3"]').should('be.visible')
243+
cy.get('[data-cy="catalogue-tree-item-2"]').should('be.visible')
244+
cy.get('[data-cy="catalogue-tree-item-3"]').should('be.visible')
245245
cy.readStoreValue('state.topics.openedTreeThemesIds').then((currentlyOpenedThemesId) => {
246246
expect(currentlyOpenedThemesId).to.be.an('Array')
247247
expect(currentlyOpenedThemesId).to.deep.equal(['2'])
248248
})
249249
// it must not change the URL when we close on a tree item (it's not meant to be synced with the UI after loading)
250-
cy.get('[data-cy="topic-tree-item-3"]').click()
251-
cy.get('[data-cy="topic-tree-item-test.wmts.layer"]').should('be.visible')
250+
cy.get('[data-cy="catalogue-tree-item-3"]').click()
251+
cy.get('[data-cy="catalogue-tree-item-test.wmts.layer"]').should('be.visible')
252252
cy.url().should('contain', 'catalogNodes=2')
253253
cy.url().should('not.contain', 'catalogNodes=2,3')
254254
})

0 commit comments

Comments
 (0)