Skip to content

Commit

Permalink
Merge pull request #1116 from geoadmin/pb-598-hide-zoom-buttons
Browse files Browse the repository at this point in the history
PB-598: Hide zoom buttons on mobile.
  • Loading branch information
ismailsunni authored Nov 11, 2024
2 parents f0ff0c8 + 034f4cc commit a54bbc0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/modules/map/components/toolbox/MapToolbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const isDrawingMode = computed(() => store.state.drawing.drawingOverlay.show)
>
<FullScreenButton v-if="fullScreenButton" />
<GeolocButton v-if="geolocButton" :compass-button="compassButton" />
<ZoomButtons />
<ZoomButtons class="hide-on-mobile" />
<Toggle3dButton v-if="toggle3dButton" />
<slot />
</div>
Expand Down Expand Up @@ -87,4 +87,10 @@ const isDrawingMode = computed(() => store.state.drawing.drawingOverlay.show)
}
}
}
.hide-on-mobile {
@include respond-below(phone) {
display: none;
}
}
</style>
4 changes: 0 additions & 4 deletions tests/cypress/tests-e2e/embed.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ describe('Testing the embed view', () => {
cy.get('[data-cy="mouse-position-select"]').should('not.exist')
cy.get('[data-cy="mouse-position"]').should('not.exist')

cy.get('[data-cy="zoom-in"]').should('be.visible')
cy.get('[data-cy="zoom-out"]').should('be.visible')
cy.get('[data-cy="3d-button"]').should('be.visible')

cy.get('[data-cy="geolocation-button"]').should('not.exist')
Expand Down Expand Up @@ -104,8 +102,6 @@ describe('Testing the embed view', () => {
cy.get('[data-cy="mouse-position-select"]').should('not.exist')
cy.get('[data-cy="mouse-position"]').should('not.exist')

cy.get('[data-cy="zoom-in"]').should('be.visible')
cy.get('[data-cy="zoom-out"]').should('be.visible')
cy.get('[data-cy="3d-button"]').should('be.visible')

cy.get('[data-cy="geolocation-button"]').should('not.exist')
Expand Down
1 change: 1 addition & 0 deletions tests/cypress/tests-e2e/footer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { WEBMERCATOR } from '@/utils/coordinates/coordinateSystems'

describe('Testing the footer content / tools', () => {
it('shows/hide the scale line depending on the map resolution, while in Mercator', () => {
cy.viewport(1920, 1080)
cy.goToMapView({
sr: WEBMERCATOR.epsgNumber,
})
Expand Down
6 changes: 2 additions & 4 deletions tests/cypress/tests-e2e/shareShortLink.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ describe('Testing the share menu', () => {
cy.get('[data-cy="menu-share-section"]').click()
// a short link should be generated as it is our first time opening this section
cy.wait('@shortLink')
// We close the menu to still be able too click on the zoom button
cy.get('[data-cy="menu-button"]').click()
// zoom in the map in order to change the URL
cy.get('[data-cy="zoom-in"]').click()
// change the language in order to change the URL
cy.clickOnLanguage('fr')
// checking that the shortLink value doesn't exist anymore
cy.readStoreValue('state.share.shortLink').should('eq', null)
// opening the general menu again
Expand Down

0 comments on commit a54bbc0

Please sign in to comment.