Skip to content

PB-211: Profile infobox minimization button #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/modules/infobox/InfoboxModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<div
class="infobox-header card-header d-flex justify-content-end"
data-cy="infobox-header"
@click="onToggleContent"
>
<button
v-if="showFloatingToggle"
Expand All @@ -25,6 +24,14 @@
>
<FontAwesomeIcon icon="print" />
</button>
<button
class="btn btn-light btn-sm d-flex align-items-center"
data-cy="infobox-minimize-maximize"
@click="onToggleContent"
>
<FontAwesomeIcon v-if="!showContent" icon="window-maximize" />
<FontAwesomeIcon v-if="showContent" icon="window-minimize" />
</button>
<button
class="btn btn-light btn-sm d-flex align-items-center"
data-cy="infobox-close"
Expand Down
2 changes: 2 additions & 0 deletions src/setup-fontawesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
faTimesCircle,
faTree,
faUser,
faWindowMaximize,
faWindowMinimize,
faXmark,
} from '@fortawesome/free-solid-svg-icons'
Expand Down Expand Up @@ -120,6 +121,7 @@ library.add(
faTimesCircle,
faTree,
faUser,
faWindowMaximize,
faWindowMinimize,
faXmark,
faSortAlphaUp,
Expand Down
6 changes: 3 additions & 3 deletions tests/cypress/tests-e2e/drawing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,13 +835,13 @@ describe('Drawing module tests', () => {
cy.get('[data-cy="profile-graph"]').trigger('mouseleave')

// clicking on the header of the profile container
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-header"]').should('be.visible')
// it should hide the content (only the header stays visible)
cy.get('[data-cy="infobox-content"]').should('not.be.visible')

// click once again on the header
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-header"]').should('be.visible')
// the content should now be visible again
cy.get('[data-cy="infobox-content"]').should('be.visible')
Expand All @@ -856,7 +856,7 @@ describe('Drawing module tests', () => {
cy.get('[data-cy="infobox"]').should('be.visible')

// clicking on the X button again, but this time with the content being hidden (clicking first on the header)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-close"]').click()
cy.get('[data-cy="infobox"]').should('not.be.visible')
})
Expand Down
12 changes: 6 additions & 6 deletions tests/cypress/tests-e2e/geodesicDrawing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe.skip('Correct handling of geodesic geometries', () => {
moveMapPos(centerOfLinearLine)
// hiding/minimizing the infobox, otherwise a click to the center of the map is blocked
// by the very long attribution string (with VT multiple attributions)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get(olSelector).click('center')
checkFeatureUnselected()

Expand All @@ -155,10 +155,10 @@ describe.skip('Correct handling of geodesic geometries', () => {

// hiding/minimizing the infobox, otherwise a click to the center of the map is blocked
// by the very long attribution string (with VT multiple attributions)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get(olSelector).click('center')
// opening the infobox again
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
/* As explained in geodesicManager.js, the maximal discrepancy should be about 2.1cm for
a line at 47° less than 1000km long. But as 1 equatorial meter < 1 meter at 47°, we are a
bit more tolerant and allow 0.04 equatorial meters */
Expand All @@ -169,7 +169,7 @@ describe.skip('Correct handling of geodesic geometries', () => {
moveMapPos(offsetX(centerOfLinearLine, selectOffset))
// hiding/minimizing the infobox, otherwise a click to the center of the map is blocked
// by the very long attribution string (with VT multiple attributions)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get(olSelector).click('center')
checkFeatureUnselected()
}
Expand Down Expand Up @@ -227,7 +227,7 @@ describe.skip('Correct handling of geodesic geometries', () => {
moveMapPos(inLinearPolygon)
// hiding/minimizing the infobox, otherwise a click to the center of the map is blocked
// by the very long attribution string (with VT multiple attributions)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get(olSelector).click('center')
checkFeatureUnselected()

Expand All @@ -241,7 +241,7 @@ describe.skip('Correct handling of geodesic geometries', () => {
moveMapPos(lineToDraw[2])
// hiding/minimizing the infobox, otherwise a click to the center of the map is blocked
// by the very long attribution string (with VT multiple attributions)
cy.get('[data-cy="infobox-header"]').click()
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get(olSelector).click('center')
checkFeatureSelected([lineDrawn[0], lineDrawn[1], lineDrawn[3], lineDrawn[4]])
}
Expand Down
11 changes: 11 additions & 0 deletions tests/cypress/tests-e2e/infobox.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ describe('The infobox', () => {
cy.get('[data-cy="popover"]').should('not.exist')
cy.get('[data-cy="infobox"]').should('be.visible')

cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-content"]').should('not.be.visible')

cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-content"]').should('be.visible')

cy.get('[data-cy="infobox-toggle-floating"]').click()
cy.get('[data-cy="popover"]').should('be.visible')
cy.get('[data-cy="infobox"]').should('not.be.visible')
Expand All @@ -42,6 +48,11 @@ describe('The infobox', () => {
cy.get('[data-cy="toggle-floating-off"]').click()
cy.get('[data-cy="popover"]').should('not.exist')
cy.get('[data-cy="infobox"]').should('be.visible')
cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-content"]').should('not.be.visible')

cy.get('[data-cy="infobox-minimize-maximize"]').click()
cy.get('[data-cy="infobox-content"]').should('be.visible')

cy.get('[data-cy="infobox-toggle-floating"]').click()
cy.get('[data-cy="popover"]').should('be.visible')
Expand Down