-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from Geoportail-Luxembourg/GSLUX-695-draw-too…
…lbar GSLUX-695: Draw toolbar
- Loading branch information
Showing
10 changed files
with
8,727 additions
and
8,563 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
describe('Footer bar', () => { | ||
beforeEach(() => { | ||
cy.visit('/') | ||
}) | ||
it('toggles the ToolbarDraw', () => { | ||
cy.get('[data-cy="toolbarDraw"]').should('not.exist') | ||
cy.get('button[data-cy="drawButton"]').click() | ||
cy.get('[data-cy="toolbarDraw"]').should('exist') | ||
cy.get('button[data-cy="drawButton"]').click() | ||
cy.get('[data-cy="toolbarDraw"]').should('not.exist') | ||
}) | ||
it('toggles the followRoads input depending on the drawLineButton', () => { | ||
cy.get('[data-cy="followRoads"]').should('not.exist') | ||
cy.get('button[data-cy="drawButton"]').click() | ||
cy.get('button[data-cy="drawLineButton"]').click() | ||
cy.get('[data-cy="followRoads"]').should('exist') | ||
cy.get('button[data-cy="drawLineButton"]').click() | ||
cy.get('[data-cy="followRoads"]').should('not.exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
label: string | ||
active?: boolean | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<button | ||
class="h-16 w-16 text-white bg-tertiary hover:bg-primary" | ||
:class="props.active ? 'bg-primary' : 'bg-tertiary'" | ||
> | ||
<span class="block">{{ props.label }}</span> | ||
</button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import ButtonText from './button-text.vue' | ||
import { useTranslation } from 'i18next-vue' | ||
const { t } = useTranslation() | ||
const drawLineActive = ref(false) | ||
</script> | ||
<template> | ||
<div data-cy="toolbarDraw"> | ||
<ul | ||
class="absolute bottom-full top-auto z-20 flex flex-row justify-start divide-y-0 divide-x divide-gray-400 divide-solid box-content border-y-0 border-x border-gray-400" | ||
> | ||
<li> | ||
<button-text :label="t('Draw Point', { ns: 'client' })"> </button-text> | ||
</li> | ||
<li> | ||
<button-text :label="t('Label', { ns: 'client' })"> </button-text> | ||
</li> | ||
<li> | ||
<button-text | ||
:label="t('Line', { ns: 'client' })" | ||
@click="() => (drawLineActive = !drawLineActive)" | ||
data-cy="drawLineButton" | ||
> | ||
</button-text> | ||
</li> | ||
<li> | ||
<button-text :label="t('Polygon', { ns: 'client' })"> </button-text> | ||
</li> | ||
<li> | ||
<button-text :label="t('Circle', { ns: 'client' })"> </button-text> | ||
</li> | ||
</ul> | ||
<ul | ||
class="absolute bottom-full top-auto z-10 pl-[130px] pb-16 w-[326px]" | ||
v-if="drawLineActive" | ||
data-cy="followRoads" | ||
> | ||
<li | ||
class="flex flex-row justify-center text-white bg-tertiary hover:bg-primary py-2 box-content border-y border-x border-gray-400" | ||
> | ||
<label> | ||
<input type="checkbox" /> | ||
{{ t('Suivre la route', { ns: 'client' }) }} | ||
</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters