57 Commits

Author SHA1 Message Date
Andreani Jean
83833fc0a6 Release 2.5.1 2024-03-19 15:03:09 +01:00
Jean Andreani
3dca1773cd Merge branch 'feat/edit-a-sequence' into 'develop'
Feat/edit a sequence

See merge request geovisio/website!126
2024-03-19 13:03:46 +00:00
Jean Andreani
3ced85eaf5 Feat/edit a sequence 2024-03-19 13:03:46 +00:00
Jean Andreani
e56c159146 Merge branch 'fix/ign-tiles' into 'main'
fix/ add new tiles IGN4

See merge request geovisio/website!131
2024-03-18 14:01:02 +00:00
Jean Andreani
ca6619b773 fix/ add new tiles IGN4 2024-03-18 14:01:01 +00:00
antoine-de
518f06c846 Release 2.5.0 2024-03-11 11:42:26 +01:00
antoine-de
50f1f7b472 Merge branch 'update_geovisio_2_5' into 'develop'
Update geovisio to 2.5

See merge request geovisio/website!128
2024-03-11 08:47:03 +00:00
antoine-de
2f4000291f Update geovisio to 2.5 2024-03-11 08:47:03 +00:00
Jean Andreani
6ad1d85604 Feat/improve meta tag 2024-03-05 13:30:13 +01:00
Jean Andreani
707420c69e Feat/add matomo analytics 2024-03-05 13:30:13 +01:00
Jean Andreani
1bd41002af Merge branch 'fix/ign-tiles-fallback' into 'main'
fix/ign-tiles-fallback

See merge request geovisio/website!125
2024-03-05 12:27:47 +00:00
Jean Andreani
c30eeb020d fix/ign-tiles-fallback 2024-03-05 12:27:47 +00:00
Andreani Jean
c37296066f Release 2.4.1 2024-02-01 10:17:17 +01:00
Andreani Jean
19f5f5a320 maj geovisio 2024-02-01 10:15:00 +01:00
Andreani Jean
589f7c64c0 Release 2.4.0 2024-01-31 15:24:10 +01:00
Jean Andreani
459efcfd57 Merge branch 'fix/auth-sequence-list' into 'develop'
Fix/auth sequence list

See merge request geovisio/website!122
2024-01-31 13:39:11 +00:00
Jean Andreani
966be42f19 Fix/auth sequence list 2024-01-31 13:39:11 +00:00
Jean Andreani
c4066930ba Merge branch 'fix/auth-sequence-list' into 'develop'
Fix/auth sequence list

See merge request geovisio/website!121
2024-01-31 09:00:25 +00:00
Jean Andreani
6322a75f42 Fix/auth sequence list 2024-01-31 09:00:25 +00:00
Andreani Jean
c37f814dc3 Release 2.3.1 2024-01-29 17:23:12 +01:00
Jean Andreani
fe68941ea9 Merge branch 'fix/ui-ux-fixs' into 'develop'
fix : UI / UX

See merge request geovisio/website!120
2024-01-29 16:20:50 +00:00
Jean Andreani
e2df50e18f fix : UI / UX 2024-01-29 16:20:50 +00:00
Jean Andreani
5d83e9df13 Merge branch 'feat-fullscreen-viewer' into 'develop'
feat: add fullscreen button to home

Closes #60

See merge request geovisio/website!118
2024-01-29 15:16:38 +00:00
Jean Andreani
d849f95013 feat: add fullscreen button to home 2024-01-29 15:16:38 +00:00
Jean Andreani
f53adeea28 Merge branch 'fix/pagination' into 'develop'
fix: remove condition pagination

See merge request geovisio/website!119
2024-01-24 13:56:08 +00:00
Jean Andreani
7685993710 fix: remove condition pagination 2024-01-24 13:56:08 +00:00
Jean Andreani
47dfd9bddc Merge branch 'feat/bbox-filter-sequence-list' into 'develop'
feat : bbox filter sequence

See merge request geovisio/website!117
2024-01-23 22:41:52 +00:00
Jean Andreani
b72fb7a0df feat : bbox filter sequence 2024-01-23 22:41:52 +00:00
Jean Andreani
136b3d629f Merge branch 'feat/filters-sequence-list' into 'develop'
Feat/filters sequence list

See merge request geovisio/website!116
2024-01-23 16:33:57 +00:00
Jean Andreani
9d82d73ca8 Feat/filters sequence list 2024-01-23 16:33:57 +00:00
Jean Andreani
503443f458 Merge branch 'feat/filters-sequence-list' into 'develop'
Feat/filters sequence list

Closes #57

See merge request geovisio/website!115
2024-01-22 14:08:46 +00:00
Jean Andreani
9b6bdc394b Feat/filters sequence list 2024-01-22 14:08:46 +00:00
Jean Andreani
cec383e424 Merge branch 'feat/link-to-sequence-from-viewer' into 'develop'
feat: add button to viewer to link to seuqence + refacto

Closes #48

See merge request geovisio/website!114
2023-12-19 12:53:06 +00:00
Jean Andreani
7e20788591 feat: add button to viewer to link to seuqence + refacto 2023-12-19 12:53:06 +00:00
Jean Andreani
390343916e Merge branch 'tech/add-more-test-e2e' into 'develop'
add e2e for upload test

See merge request geovisio/website!113
2023-12-18 10:27:31 +00:00
Jean Andreani
c768b714b9 add e2e for upload test 2023-12-18 10:27:31 +00:00
Jean Andreani
bf0bc4d91c Merge branch 'tech/perf-hover-sequence-list' into 'develop'
Tech/perf hover sequence list

See merge request geovisio/website!110
2023-12-12 15:55:46 +00:00
Jean Andreani
5d292b186c Tech/perf hover sequence list 2023-12-12 15:55:46 +00:00
Jean Andreani
93e434ecf9 Merge branch 'fix-e2e' into 'develop'
fix duration gitlab for e2e

See merge request geovisio/website!112
2023-12-12 15:43:21 +00:00
Jean Andreani
721bafbd3e fix duration gitlab for e2e 2023-12-12 15:43:21 +00:00
Jean Andreani
127550a19f Merge branch 'tech-add-test-e2e' into 'develop'
Tech add test e2e

See merge request geovisio/website!89
2023-12-12 15:01:50 +00:00
Jean Andreani
85abc46038 Tech add test e2e 2023-12-12 15:01:50 +00:00
Andreani Jean
40f3560d94 Release 2.3.0 2023-12-06 12:05:18 +01:00
Jean Andreani
3d65fd9b42 Merge branch 'fix/some-fixs' into 'develop'
feat: add flyTo user sequence list

See merge request geovisio/website!108
2023-12-06 10:32:30 +00:00
Jean Andreani
476699adab feat: add flyTo user sequence list 2023-12-06 10:32:30 +00:00
Jean Andreani
7a49628e0d Merge branch 'fix/docker-nginx-conf' into 'develop'
Fix unrecognized URLs in Nginx in Docker

See merge request geovisio/website!109
2023-12-06 08:02:30 +00:00
Adrien Pavie
52d3f27b6d Fix unrecognized URLs in Nginx in Docker 2023-12-05 16:10:25 +01:00
Jean Andreani
70b252bf8b Merge branch 'feat/pagination-sequence-list' into 'develop'
Feat/pagination sequence list

Closes #45

See merge request geovisio/website!107
2023-11-27 20:32:55 +00:00
Jean Andreani
bc7bd9719d Feat/pagination sequence list 2023-11-27 20:32:54 +00:00
Jean Andreani
ee6736ec5d Merge branch 'feature/gvs-230' into 'develop'
Update GeoVisio to 2.3.0

See merge request geovisio/website!106
2023-11-27 16:52:29 +00:00
Adrien Pavie
36bf95db1e Update GeoVisio to 2.3.0 2023-11-27 16:52:29 +00:00
Jean Andreani
bda308d686 Merge branch 'feat/hu-translation' into 'develop'
feat: add hungarian translation

See merge request geovisio/website!105
2023-11-21 15:40:35 +00:00
Jean Andreani
babee7cb57 feat: add hungarian translation 2023-11-21 15:40:35 +00:00
Jean Andreani
aed3e689f9 Merge branch 'fix/pr-cookie' into 'develop'
fix: remove log + add comments

See merge request geovisio/website!104
2023-11-21 15:11:51 +00:00
Jean Andreani
5e7154c889 fix: remove log + add comments 2023-11-21 15:11:51 +00:00
Jean Andreani
9af517f407 Merge branch 'fix/cookie-bug' into 'develop'
Fix/cookie bug

See merge request geovisio/website!102
2023-11-21 14:55:30 +00:00
Jean Andreani
00fe5433c2 Fix/cookie bug 2023-11-21 14:55:29 +00:00
95 changed files with 11753 additions and 2913 deletions

1
.gitignore vendored
View File

@@ -90,6 +90,7 @@ sw.*
*.swp
# Cypress generated screen and videos files
cypress/downloads/*
cypress/screenshot/
cypress/videos/
*.cy.ts.mp4

View File

@@ -8,9 +8,10 @@ variables:
DOCKER_BUILDKIT: 1 # use buildkit for better performance
DOCKER_DRIVER: overlay2 # better docker driver to avoid copying too many files on each run
GITLAB_REGISTRY: registry.gitlab.com # We use docker.io for official images and gitlab's registry to store temporary images
IMAGE_NAME: geovisio/api
IMAGE_NAME: geovisio/website
CI_IMAGE_CACHE: $GITLAB_REGISTRY/$IMAGE_NAME:build_cache
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_CERTDIR: ''
DOCKER_HOST: tcp://docker:2375
before_script:
## chmod is unfortunately currently mandatory : https://github.com/nodejs/docker-node/issues/661
@@ -22,28 +23,29 @@ cache:
install:
stage: Install
image: node:18.16.0
image: node:18.16.1
script:
- yarn install
- ls node_modules/.bin/cypress
test:unit:
stage: Test
image: node:18.16.0
image: node:18.16.1
script:
- yarn test:unit
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
test:e2e:
stage: Test
image: cypress/browsers:node-18.16.0-chrome-113.0.5672.92-1-ff-113.0-edge-113.0.1774.35-1
image: node:18.16.1-alpine
services:
- docker:dind
script:
- yarn install
- ./node_modules/.bin/cypress install
- echo "VITE_API_URL=https://geovisio-proxy-dev.osc-fr1.scalingo.io/" > .env
- echo "VITE_ENV=dev" >> .env
- PORT=5173 yarn start &
- yarn test:e2e
- apk add --update --no-cache docker-cli docker-cli-compose git
- PROJECT_DIR=$PWD docker compose -f cypress/docker-compose-geovisio.yml -f cypress/docker-compose-gitlab-override.yml run --rm e2e
after_script:
- PROJECT_DIR=$PWD docker compose -f cypress/docker-compose-geovisio.yml -f cypress/docker-compose-gitlab-override.yml logs web || true
- PROJECT_DIR=$PWD docker compose -f cypress/docker-compose-geovisio.yml -f cypress/docker-compose-gitlab-override.yml down || true
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
artifacts:
when: always
@@ -54,7 +56,7 @@ test:e2e:
deploy:
stage: Deploy
image: node:18.16.0
image: node:18.16.1
cache:
paths:
- node_modules
@@ -74,7 +76,7 @@ deploy:develop:
stage: Deploy
image: docker:latest
services:
- docker:dind
- docker:dind
before_script:
# login to the gitlab docker registry to use the cache and to publish
- echo $CI_DEPLOY_PASSWORD | docker login -u $CI_DEPLOY_USER --password-stdin $GITLAB_REGISTRY
@@ -106,7 +108,7 @@ deploy:latest:
stage: Deploy
image: docker:latest
services:
- docker:dind
- docker:dind
before_script:
# login to the gitlab docker registry to use the cache and to publish
- echo $CI_DEPLOY_PASSWORD | docker login -u $CI_DEPLOY_USER --password-stdin $GITLAB_REGISTRY

View File

@@ -7,6 +7,81 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Before _0.1.0_, website development was on rolling release, meaning there are no version tags.
## [2.5.1] - 2024-03-19
### Added
- Panel management to edit a sequence:
- 3 tabs to edit in a sequence page
- add the possibility to re-orient all the pictures of a sequence with a widget
- add the possibility to sort the pictures of a sequence
## [2.5.0] - 2024-03-11
### Changed
- GeoVisio web viewer updated to [2.5.0](https://gitlab.com/geovisio/web-viewer/-/compare/2.4.0...2.5.0) to reduce tiles size.
## [2.4.1] - 2024-02-01
### Fixed
- Fix geovisio version yarn.lock
## [2.4.0] - 2024-01-31
### Added
- Possibility to edit a sequence title in the sequence page
### Changed
- GeoVisio web viewer updated to [2.4.0](https://gitlab.com/geovisio/web-viewer/-/compare/2.3.1...2.4.0) to manage sequence by user
### Fixed
- Fix filter reset button to include bbox filter
- Fix fullscreen button added by the widget viewer
- Some UI and UX fixes before user tests
## [2.3.1] - 2024-01-29
### Added
- Add the possibility to fullscreen the viewer in the homepage : https://gitlab.com/geovisio/website/-/issues/60
- In the sequence list page add a filter by bbox in the map : https://gitlab.com/geovisio/website/-/issues/61
- In the sequence list page add a filter by date in the list : https://gitlab.com/geovisio/website/-/issues/57
- Add a cancel button to when a sequence is uploading to cancel the upload
### Changed
- GeoVisio web viewer updated to [2.3.1](https://gitlab.com/geovisio/web-viewer/-/compare/2.3.0...2.3.1)
### Fixed
- Some UI and UX fixes before user tests
## [2.3.0] - 2023-12-06
### Added
- Add the possibility to an user to select a sequence in the list using the map : https://gitlab.com/geovisio/website/-/merge_requests/100
- For a selected sequence in the list, if the sequence is not displayed in the map, fly to the sequence on the map : https://gitlab.com/geovisio/website/-/merge_requests/108
- Add the pagination to the sequence with sort with API routes : https://gitlab.com/geovisio/website/-/merge_requests/107
- Add Hungarian translation : https://gitlab.com/geovisio/website/-/merge_requests/105
- Add the possibility to hide/delete a sequence in the sequence list : https://gitlab.com/geovisio/website/-/merge_requests/101
- Add the possibility for the user to change the title of the sequence before upload the pictures : https://gitlab.com/geovisio/website/-/merge_requests/101
- Add the possibility to resize the sequence page by dragging the blocs : https://gitlab.com/geovisio/website/-/merge_requests/101
### Changed
- GeoVisio web viewer updated to [2.3.0](https://gitlab.com/geovisio/web-viewer/-/compare/2.2.1...2.3.0)
### Fixed
- Nginx server in Docker container was not recognizing routes other than `/` on first loading.
- Fix the cookie bug by decoding flask cookie : https://gitlab.com/geovisio/website/-/merge_requests/102
## [2.2.3] - 2023-11-03
### Added
@@ -16,6 +91,7 @@ Before _0.1.0_, website development was on rolling release, meaning there are no
### Changed
- Page My Sequences, add the possibility to select a sequence in the list with the map :
- the user can only see his sequences on the list
- display the selected sequence in blue in the map
- display a thumbnail the hovered sequence
@@ -125,9 +201,15 @@ Before _0.1.0_, website development was on rolling release, meaning there are no
- Header have now a new entry `Mes photos` when the user is logged to access to the sequence list
- The router guard for logged pages has been changed to not call the api to check the token
[unreleased]: https://gitlab.com/geovisio/website/-/compare/2.2.3...develop
[2.2.1]: https://gitlab.com/geovisio/website/-/compare/2.2.2...2.2.3
[2.2.1]: https://gitlab.com/geovisio/website/-/compare/2.2.1...2.2.2
[unreleased]: https://gitlab.com/geovisio/website/-/compare/2.5.1...develop
[2.5.1]: https://gitlab.com/geovisio/website/-/compare/2.5.0...2.5.1
[2.5.0]: https://gitlab.com/geovisio/website/-/compare/2.4.1...2.5.0
[2.4.1]: https://gitlab.com/geovisio/website/-/compare/2.4.0...2.4.1
[2.4.0]: https://gitlab.com/geovisio/website/-/compare/2.3.1...2.4.0
[2.3.1]: https://gitlab.com/geovisio/website/-/compare/2.3.0...2.3.1
[2.3.0]: https://gitlab.com/geovisio/website/-/compare/2.2.3...2.3.0
[2.2.3]: https://gitlab.com/geovisio/website/-/compare/2.2.2...2.2.3
[2.2.2]: https://gitlab.com/geovisio/website/-/compare/2.2.1...2.2.2
[2.2.1]: https://gitlab.com/geovisio/website/-/compare/2.2.0...2.2.1
[2.2.0]: https://gitlab.com/geovisio/website/-/compare/2.1.3...2.2.0
[2.1.3]: https://gitlab.com/geovisio/website/-/compare/2.1.2...2.1.3

View File

@@ -2,7 +2,7 @@
#- Build image
#-
FROM node:18.16.0-alpine AS build
FROM node:18.16.1-alpine AS build
WORKDIR /opt/geovisio
@@ -19,6 +19,7 @@ COPY *.json *.js *.ts *.html ./
# Replace env variables by placeholder for dynamic change on container start
ENV VITE_INSTANCE_NAME=DOCKER_VITE_INSTANCE_NAME
ENV VITE_RASTER_TILE=DOCKER_VITE_RASTER_TILE
ENV VITE_API_URL=DOCKER_VITE_API_URL
ENV VITE_TILES=DOCKER_VITE_TILES
ENV VITE_MAX_ZOOM=DOCKER_VITE_MAX_ZOOM
@@ -50,6 +51,7 @@ ENV VITE_INSTANCE_NAME="GeoVisio/Docker"
ENV VITE_API_URL="https://panoramax.openstreetmap.fr"
ENV VITE_TILES="https://tile-vect.openstreetmap.fr/styles/basic/style.json"
ENV VITE_MAX_ZOOM=""
ENV VITE_RASTER_TILE=""
ENV VITE_ZOOM=""
ENV VITE_CENTER=""

View File

@@ -12,6 +12,6 @@ export default defineConfig({
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'http://localhost:5173'
baseUrl: 'http://localhost:5173/'
}
})

3
cypress.env.json Normal file
View File

@@ -0,0 +1,3 @@
{
"api_url": "http://localhost:5000/"
}

View File

@@ -0,0 +1,79 @@
services:
api:
image: geovisio/api:develop
command: api
restart: always
ports:
- 5000:5000
depends_on:
db:
condition: service_healthy
auth:
condition: service_healthy
environment:
DB_URL: postgres://gvs:gvspwd@db/geovisio
PICTURE_PROCESS_THREADS_LIMIT: 2
PICTURE_PROCESS_DERIVATES_STRATEGY: ON_DEMAND
API_FORCE_AUTH_ON_UPLOAD: 'true'
OAUTH_CLIENT_ID: geovisio
OAUTH_CLIENT_SECRET: what_a_secret
OAUTH_OIDC_URL: http://localhost:8183/realms/geovisio
OAUTH_PROVIDER: oidc
FLASK_SECRET_KEY: a_very_secret_key_never_to_be_used_in_production
healthcheck:
test: python -c "import requests; requests.get('http://localhost:5000/api').raise_for_status()"
interval: 5s
timeout: 5s
retries: 10
extra_hosts:
- 'localhost:host-gateway'
networks:
db: {}
geovisio:
aliases:
- api.localtest.me
db:
image: postgis/postgis:13-3.2
environment:
- POSTGRES_USER=gvs
- POSTGRES_PASSWORD=gvspwd
- POSTGRES_DB=geovisio
healthcheck:
test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER
interval: 5s
timeout: 5s
retries: 5
networks:
db: {}
auth:
command: start-dev --import-realm
environment:
GEOVISIO_BASE_URL: http://localhost:5000
GEOVISIO_CLIENT_SECRET: what_a_secret
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
KEYCLOAK_FRONTEND_URL: http://localhost:5000/api/auth/login
KC_HTTP_PORT: 8183
ports:
- '8183:8183'
healthcheck:
test: curl --fail http://localhost:8183/realms/geovisio
timeout: 5s
interval: 2s
retries: 20
start_period: 15s
image: quay.io/keycloak/keycloak:20.0.1
volumes:
- ./keycloak-realm.json:/opt/keycloak/data/import/geovisio_realm.json
networks:
geovisio:
aliases:
- keycloak.localtest.me
networks:
db: {}
geovisio: {}

View File

@@ -0,0 +1,55 @@
# Docker-compose used in gitlab-ci to run a container having access to all the other containers
services:
web:
image: node:18.16.1-alpine
volumes:
- $PROJECT_DIR:/src
working_dir: /src
command: >
sh -c "apk add --update --no-cache curl && yarn install && yarn start"
environment:
PORT: 5173
VITE_API_URL: http://api.localtest.me:5000
VITE_ENV: dev
depends_on:
api:
condition: service_healthy
auth:
condition: service_healthy
ports:
- 5173:5173
healthcheck:
test: curl --fail http://0.0.0.0:5173
timeout: 10s
interval: 3s
retries: 20
start_period: 15s
networks:
geovisio:
aliases:
- front.localtest.me
e2e:
image: cypress/included:cypress-12.17.3-node-18.16.1-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
volumes:
- $PROJECT_DIR:/src
working_dir: /src
environment:
- CYPRESS_baseUrl=http://front.localtest.me:5173/
- CYPRESS_api_url=http://api.localtest.me:5000/
- LANG=fr
command: sleep 2 && yarn add --dev cypress && ./node_modules/.bin/cypress install && yarn test:e2e
depends_on:
web:
condition: service_healthy
networks:
geovisio: {}
api:
environment:
OAUTH_OIDC_URL: http://keycloak.localtest.me:8183/realms/geovisio
FLASK_SESSION_COOKIE_DOMAIN: localtest.me
auth:
environment:
GEOVISIO_BASE_URL: http://api.localtest.me:5000
KEYCLOAK_FRONTEND_URL: http://api.localtest.me:5000/api/auth/login

View File

@@ -0,0 +1,29 @@
describe('In the contribute page', () => {
it('go to the login page', () => {
cy.visit('/pourquoi-contribuer')
cy.get('.upload-text').scrollIntoView()
cy.fixture('contribute').then((contributeData: contributeInterface) => {
cy.contains(contributeData.textButtonContribute).click()
})
})
it('go to the doc pages', () => {
cy.visit('pourquoi-contribuer')
cy.fixture('contribute').then((contributeData: contributeInterface) => {
cy.get('.upload-text').scrollIntoView()
cy.contains(contributeData.textButtonDocPython).click()
cy.contains(contributeData.textButtonCli).click()
cy.contains(contributeData.textButtonDocCli).click()
cy.contains(contributeData.textButtonTiles).click()
cy.contains(contributeData.textButtonDoc).click()
})
})
})
interface contributeInterface {
textButtonContribute: string
textButtonDocPython: string
textButtonCli: string
textButtonDocCli: string
textButtonTiles: string
textButtonDoc: string
}
export {}

16
cypress/e2e/home.cy.ts Normal file
View File

@@ -0,0 +1,16 @@
describe('In the home page', () => {
it('click on the link in the footer to go to Panoramax.fr', () => {
cy.visit('/')
cy.fixture('home').then((homeData) => {
cy.contains(homeData.textLinkPanoramax).click()
})
})
it('click on the link in the footer to go to Gitlab', () => {
cy.visit('/')
cy.fixture('home').then((homeData) => {
cy.contains(homeData.textLinkGitlab).click()
})
})
})
export {}

View File

@@ -1,7 +1,25 @@
describe('In the login page', () => {
it('type in the form to login', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
cy.get('#username').type('Elysee')
cy.get('#password').type('my password')
cy.contains('Sign In').click()
cy.visit('/')
})
it('go to the register form and create an account', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
cy.fixture('login').then((loginData) => {
cy.contains(loginData.textLinkRegister).click()
cy.get('#firstName').type('Tom')
cy.get('#lastName').type('Tom')
cy.get('#email').type('test@test123.com')
cy.get('#username').type('Elysee12445')
cy.get('#password').type('my password1')
cy.get('#password-confirm').type('my password1')
cy.get('form').submit()
cy.visit('/')
})
})
})
export {}

View File

@@ -0,0 +1,9 @@
{
"compilerOptions": {
"types": ["reflect-metadata", "jest", "cypress"],
"module": "commonjs",
"target": "es5",
"sourceMap": true
},
"exclude": ["node_modules"]
}

32
cypress/e2e/upload.cy.ts Normal file
View File

@@ -0,0 +1,32 @@
describe('In the login page', () => {
it('login and go to the upload page to upload images', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
cy.get('#username').type('Elysee')
cy.get('#password').type('my password')
cy.fixture('upload').then((uploadData: uploadInterface) => {
cy.contains(uploadData.textLinkLogin).click()
cy.visit('/envoyer')
cy.get('.edit-button').click()
cy.get('#upload-title').clear()
cy.get('#upload-title').type(uploadData.textTitle)
cy.contains(uploadData.textButtonTitle).click()
cy.contains(uploadData.textButtonUpload).click()
})
cy.get('.input-file').selectFile(
[
'/src/cypress/fixtures/images/image1.jpg',
'/src/cypress/fixtures/images/image2.jpg',
'/src/cypress/fixtures/images/image3.jpg'
],
{ force: true }
)
})
})
interface uploadInterface {
textLinkLogin: string
textLinkUpload: string
textButtonUpload: string
textTitle: string
textButtonTitle: string
}
export {}

View File

@@ -0,0 +1,8 @@
{
"textButtonContribute": "Partager des images",
"textButtonDocCli": "Voir la documentation",
"textButtonDoc": "Retrouvez sa documentation ici",
"textButtonDocPython": "de python (au moins la version 3.8)",
"textButtonCli": "L'outil en ligne de commande",
"textButtonTiles": "de tuiles vectorielles"
}

View File

@@ -0,0 +1,5 @@
{
"textLinkContribute": "Pourquoi contribuer ?",
"textLinkPanoramax": "Découvrir Panoramax",
"textLinkGitlab": "Voir le code"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -0,0 +1,4 @@
{
"textLinkRegister": "Register",
"textLinkLogin": "Sign In"
}

View File

@@ -0,0 +1,7 @@
{
"textLinkLogin": "Sign In",
"textLinkUpload": "Mes photos",
"textTitle": "My title",
"textButtonTitle": "Valider",
"textButtonUpload": "Glissez vos images ici ou cliquez sur"
}

1987
cypress/keycloak-realm.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -18,5 +18,10 @@ http {
root /usr/share/nginx/html;
gzip_static on;
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}
}

View File

@@ -14,6 +14,7 @@ Available parameters are:
- `VITE_MAX_ZOOM`: the max zoom to use on the map (defaults to 24).
- `VITE_ZOOM`: the zoom to use at the initialization of the map (defaults to 0).
- `VITE_CENTER`: the center position to use at the initialization of the map (defaults to 0).
- `VITE_RASTER_TILE`: the raster tile. Example : `https://maplibre.org/maplibre-style-spec/sources/#raster`.
- Settings for the work environment:
- `NPM_CONFIG_PRODUCTION`: is it production environment (`true`, `false`)
- `YARN_PRODUCTION`: same as below, but if you use Yarn instead of NPM

View File

@@ -4,6 +4,31 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/static/favicon.ico" />
<title>
Panoramax <%- instanceName %> : photo-cartographier les territoires
</title>
<meta
name="description"
content="L'instance Panoramax <%- instanceName %> permet la publication de photo de terrain pour cartographier le territoire. Panoramax favorise la réutilisation des photos pour de nombreux cas d'usages."
/>
<meta
name="twitter:title"
content="Panoramax <%- instanceName %> : photo-cartographier les territoires"
/>
<meta
name="og:title"
content="Panoramax <%- instanceName %> : photo-cartographier les territoires"
/>
<meta
name="twitter:description"
content="L'instance Panoramax <%- instanceName %> permet la publication de photo de terrain pour cartographier le territoire. Panoramax favorise la réutilisation des photos pour de nombreux cas d'usages."
/>
<meta
name="og:description"
content="L'instance Panoramax <%- instanceName %> permet la publication de photo de terrain pour cartographier le territoire. Panoramax favorise la réutilisation des photos pour de nombreux cas d'usages."
/>
<meta name="og:image" content="<%- frontUrl %>/static/meta-img.jpg" />
<meta name="twitter:image" content="<%- frontUrl %>/static/meta-img.jpg" />
</head>
<body>
<div id="app"></div>

View File

@@ -1,8 +1,8 @@
{
"name": "geovisio-website",
"version": "2.2.3",
"version": "2.5.1",
"engines": {
"node": "18.16.0"
"node": "18.16.1"
},
"private": true,
"scripts": {
@@ -25,15 +25,17 @@
"axios": "^1.2.3",
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.3",
"geovisio": "2.2.1-develop-acb9989e",
"geovisio": "2.5.1",
"moment": "^2.29.4",
"pako": "^2.1.0",
"pinia": "^2.1.4",
"v-calendar": "^3.1.2",
"vue": "^3.2.45",
"vue-axios": "^3.5.2",
"vue-draggable-resizable-vue3": "^2.3.1-beta.13",
"vue-eslint-parser": "^9.1.0",
"vue-i18n": "9.2.2",
"vue-meta": "^3.0.0-alpha.10",
"vue-matomo": "^4.2.0",
"vue-router": "^4.1.6",
"vue3-cookies": "^1.0.6",
"vue3-smooth-scroll": "^0.8.1"
@@ -41,6 +43,7 @@
"devDependencies": {
"@pinia/testing": "^0.1.2",
"@rushstack/eslint-patch": "^1.1.4",
"@types/jest": "^29.5.4",
"@types/jsdom": "^20.0.1",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.46.0",
@@ -51,12 +54,13 @@
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/test-utils": "^2.2.4",
"@vue/tsconfig": "^0.1.3",
"cypress": "^12.12.0",
"cypress": "^13.1.0",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-vue": "^9.8.0",
"jest": "^29.6.4",
"jsdom": "^20.0.3",
"less": "^4.2.0",
"less-loader": "^11.1.3",
@@ -66,6 +70,7 @@
"typescript": "~4.7.4",
"vite": "^3.2.4",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.2",
"vitest": "^0.25.3",
"vue-tsc": "^1.0.9"
},

1
pako.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'pako'

View File

@@ -3,33 +3,19 @@ import { ref, computed } from 'vue'
import Header from '@/components/Header.vue'
import Footer from '@/components/Footer.vue'
import { RouterView } from 'vue-router'
import { useMeta } from 'vue-meta'
import { useI18n } from 'vue-i18n'
import { useCookies } from 'vue3-cookies'
import { title } from '@/utils/index'
import { hasASessionCookieDecoded } from '@/utils/auth'
import authConfig from './composables/auth'
const { authConf } = authConfig()
const { t } = useI18n()
const { cookies } = useCookies()
let focusMap = ref<string>('focus-map')
useMeta({
title: title(t('general.title')),
og: {
title: title(t('general.meta.title')),
description: title(t('general.meta.description'))
},
twitter: {
title: title(t('general.meta.title')),
description: title(t('general.meta.description'))
}
})
function setFocusMap(value: string) {
focusMap.value = value
}
const getUserId = computed<string>(() => cookies.get('user_id'))
const isLogged = computed((): boolean => {
const cookie = hasASessionCookieDecoded()
return !!(cookie && cookie.account)
})
</script>
<template>
@@ -51,7 +37,7 @@ const getUserId = computed<string>(() => cookies.get('user_id'))
: ''
"
/>
<RouterView @trigger="setFocusMap" :class="{ logged: getUserId }" />
<Footer v-if="!getUserId" />
<RouterView @trigger="setFocusMap" :class="{ logged: isLogged }" />
<Footer v-if="!isLogged" />
</template>
<style scoped></style>

View File

@@ -0,0 +1,14 @@
@mixin switch-button-view() {
position: fixed;
right: 0;
top: toRem(22);
z-index: 3;
height: toRem(5);
display: flex;
align-items: center;
justify-content: center;
border-top-left-radius: toRem(0.5);
border-bottom-left-radius: toRem(0.5);
background-color: var(--white);
border: toRem(0.1) solid var(--grey-pale);
}

View File

@@ -28,7 +28,7 @@
}
@if $size == h4 {
font-weight: normal;
font-size: toRem(1.6);
font-size: toRem(1.8);
}
@if $size == xxl-regular {
font-size: toRem(3.2);

37
src/assets/images/car.svg Normal file
View File

@@ -0,0 +1,37 @@
<svg width="58" height="114" viewBox="0 0 58 114" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M54.5335 97.255C53.702 100.976 51.4048 104.696 50.7988 106.514C50.0096 108.882 39.7427 110.087 29.2996 110.136C29.1939 110.136 29.0953 110.136 28.9896 110.136C28.8839 110.136 28.7852 110.136 28.6795 110.136C18.2365 110.087 7.96957 108.882 7.18035 106.514C6.57434 104.696 4.2701 100.976 3.44565 97.255L2.7269 99.221C3.42451 103.238 6.02471 107.395 6.68004 109.361C7.4904 111.785 17.9898 113.018 28.6725 113.06C28.7782 113.06 28.8839 113.06 28.9896 113.06C29.0953 113.06 29.201 113.06 29.3067 113.06C39.9893 113.011 50.4887 111.778 51.2991 109.354C51.9544 107.381 54.5546 103.23 55.2522 99.2139L54.5335 97.2479V97.255Z" fill="#160302"/>
<path d="M6.30663 32.0951C7.65253 25.2599 10.2386 11.8713 10.2386 11.8713L10.288 11.7304C11.9439 6.12836 27.087 5.0291 28.8276 5.08547C28.8839 5.08547 28.9333 5.08547 28.9896 5.08547C29.046 5.08547 29.0953 5.08547 29.1517 5.08547C30.8852 5.0291 46.0353 6.12836 47.6913 11.7304L47.7406 11.8713C47.7406 11.8713 50.3197 25.2528 51.6726 32.0951C54.5265 27.2752 55.203 21.4759 53.5611 16.1204C52.2786 11.9348 51.0807 8.97519 51.0807 8.97519L51.0173 8.81312C49.0654 2.2175 31.2234 0.920929 29.1799 0.984348C29.1165 0.984348 29.053 0.984348 28.9896 0.984348C28.9262 0.984348 28.8628 0.984348 28.7994 0.984348C26.7559 0.920929 8.91387 2.2175 6.95492 8.81312L6.8915 8.97519C6.8915 8.97519 5.69358 11.9277 4.4111 16.1204C2.76924 21.4759 3.44571 27.2752 6.29958 32.0951H6.30663Z" fill="#160302"/>
<path d="M55.0126 70.3581L53.6879 66.3627L53.0396 48.5559C52.9621 43.6022 53.0466 41.8405 53.2017 37.373C53.2228 36.7881 54.7308 33.7863 54.7519 33.2155C55.1324 23.5969 49.5797 9.87012 49.5797 9.87012L49.5233 9.72214C47.7053 3.57046 31.0683 2.35845 29.1657 2.42187C29.1023 2.42187 29.0459 2.42187 28.9895 2.42187C28.9332 2.42187 28.8698 2.42187 28.8134 2.42187C26.9038 2.35845 10.2738 3.57046 8.44871 9.72214L8.39234 9.87012C8.39234 9.87012 2.83962 23.5969 3.22014 33.2155C3.24128 33.7863 4.74925 36.7881 4.77039 37.373C4.92541 41.8405 5.00997 43.6022 4.93246 48.5559L4.29122 66.257L2.95941 70.2595V93.8162L3.21309 95.9302V95.9795C3.7134 100.095 6.50385 104.485 7.17328 106.507C7.9625 108.875 18.2294 110.08 28.6724 110.129C28.7781 110.129 28.8768 110.129 28.9825 110.129C29.0882 110.129 29.1868 110.129 29.2925 110.129C39.7356 110.08 50.0025 108.875 50.7917 106.507C51.4682 104.478 54.2516 100.095 54.7519 95.9795V95.9302L55.0056 93.9149V70.3581H55.0126Z" fill="#17347A"/>
<path d="M45.8168 47.795L26.0018 27.9799C24.7898 12.8016 31.9843 6.36803 39.1226 3.68328C34.5845 2.66857 30.1029 2.3867 29.1657 2.42194C29.1023 2.42194 29.0459 2.42194 28.9895 2.42194C28.9332 2.42194 28.8698 2.42194 28.8134 2.42194C26.9038 2.35852 10.2738 3.57053 8.44871 9.72221L8.39234 9.87019C8.39234 9.87019 2.83962 23.597 3.22014 33.2156C3.24128 33.7863 4.74925 36.7882 4.77039 37.3731C4.92541 41.8406 5.00997 43.6023 4.93246 48.556L4.29122 66.2571L2.95941 70.2595V93.8163L3.21309 95.9303V95.9796C3.64293 99.5029 5.74282 103.216 6.76458 105.485C9.08291 100.003 12.268 92.1674 12.268 92.1674L12.8881 51.276C20.139 52.9742 28.6302 52.6642 28.6302 52.6642C45.6054 52.8192 45.8239 47.7879 45.8239 47.7879L45.8168 47.795Z" fill="#1E4084"/>
<path d="M43.9213 10.8637L49.0583 18.9673L51.0031 22.0396C49.6572 17.0788 48.0929 13.2173 48.0929 13.2173L48.0436 13.0763C47.4939 11.2231 45.4856 9.85605 42.9771 8.84839C43.2096 9.55305 43.5196 10.2295 43.9142 10.8637H43.9213Z" fill="#C1D1D0"/>
<path d="M14.0508 10.8637C14.4524 10.2366 14.7555 9.55305 14.988 8.84839C12.4724 9.84901 10.4711 11.216 9.92149 13.0763L9.87216 13.2173C9.87216 13.2173 8.30781 17.0788 6.96191 22.0396L14.0508 10.8637Z" fill="#C1D1D0"/>
<path d="M14.4102 10.2225C14.6427 9.77854 14.833 9.32051 14.988 8.84839C12.4724 9.84901 10.4711 11.216 9.92151 13.0763L9.87218 13.2173C9.87218 13.2173 9.40006 14.387 8.75177 16.2544C9.22389 16.1134 9.66078 15.8809 10.0554 15.5286C11.4154 14.3165 13.1488 12.2589 14.4102 10.2225Z" fill="#DFF3F4"/>
<path d="M43.562 10.2225C44.8233 12.266 46.5638 14.3165 47.9167 15.5286C48.3114 15.8809 48.7482 16.1064 49.2204 16.2544C48.5721 14.38 48.1 13.2173 48.1 13.2173L48.0506 13.0763C47.501 11.2231 45.4927 9.85605 42.9841 8.84839C43.1392 9.32051 43.3294 9.78559 43.562 10.2225Z" fill="#DFF3F4"/>
<path d="M45.3729 106.655C39.0521 107.578 33.1189 107.578 28.9826 107.578C24.8462 107.578 18.913 107.578 12.5922 106.655C7.37065 105.894 8.97727 104.097 8.97727 104.097L12.3455 97.6073C18.3633 98.8052 39.5877 98.8052 45.6055 97.6073L48.9738 104.097C48.9738 104.097 50.5874 105.894 45.3589 106.655H45.3729Z" fill="#373637"/>
<path d="M28.9896 107.656C24.9871 107.656 18.9482 107.656 12.5922 106.733C10.3161 106.401 9.01955 105.838 8.73769 105.048C8.55448 104.534 8.87862 104.125 8.92795 104.055L12.3174 97.5227L12.3737 97.5368C18.4268 98.7488 39.5454 98.7488 45.6055 97.5368L45.6619 97.5227L45.69 97.572L49.0583 104.055C49.1147 104.118 49.4388 104.534 49.2486 105.048C48.9667 105.838 47.6701 106.401 45.3941 106.733C39.0381 107.656 32.9921 107.656 28.9967 107.656H28.9896ZM12.4019 97.6989L9.04774 104.154C9.04774 104.154 8.7095 104.541 8.87862 104.999C9.06183 105.499 9.8581 106.183 12.6133 106.585C18.9623 107.508 24.9942 107.508 28.9896 107.508C32.985 107.508 39.024 107.508 45.3659 106.585C48.1211 106.183 48.9174 105.499 49.1006 104.999C49.2697 104.534 48.9385 104.161 48.9315 104.154L48.9174 104.139L45.5773 97.6989C39.4538 98.8968 18.5254 98.8968 12.4019 97.6989Z" fill="#160302"/>
<path d="M44.6753 105.774C38.6223 106.627 32.9427 106.641 28.9896 106.641C25.0365 106.641 19.3499 106.627 13.3039 105.774C8.30079 105.07 9.84399 103.407 9.84399 103.407L12.8177 97.861C19.223 98.9532 38.7562 98.9532 45.1545 97.861L48.1282 103.407C48.1282 103.407 49.6714 105.07 44.6683 105.774H44.6753Z" fill="#DFF3F4"/>
<path d="M48.1282 103.407L47.8674 102.92C47.346 102.765 46.6907 102.624 45.8662 102.512C39.3551 101.596 33.2457 101.582 28.9826 101.582C24.7194 101.582 18.61 101.596 12.0989 102.512C11.2745 102.624 10.6191 102.765 10.0977 102.92L9.83694 103.407C9.83694 103.407 8.29374 105.07 13.2968 105.774C19.3499 106.627 25.0294 106.641 28.9826 106.641C32.9357 106.641 38.6223 106.627 44.6683 105.774C49.6714 105.07 48.1282 103.407 48.1282 103.407Z" fill="#C1D1D0"/>
<path d="M35.8953 109.03L35.8741 108.988L35.8389 108.931L35.7473 108.769C35.5571 108.713 35.3245 108.67 35.0567 108.628C32.6609 108.29 30.406 108.29 28.9192 108.29C27.4323 108.29 25.1774 108.29 22.7816 108.628C22.5138 108.663 22.2883 108.713 22.091 108.769L22.0135 108.917C22.0135 108.917 21.9853 108.952 21.9712 108.981L21.9501 109.023H21.9007C18.2717 108.868 15.0162 108.537 11.9509 108.022C9.66785 107.635 8.33604 106.986 7.98371 106.084C7.71594 105.394 8.13874 104.837 8.15283 104.816L11.9791 97.3396C12.0919 97.1141 12.4301 96.9872 12.7543 97.0577C19.2724 98.3684 38.6787 98.3684 45.1968 97.0577C45.5209 96.9943 45.8592 97.1141 45.9719 97.3396L49.8053 104.816C49.8546 104.879 50.2281 105.422 49.9744 106.077C49.6221 106.979 48.2832 107.628 46.0072 108.015C42.9137 108.537 39.6159 108.868 35.9376 109.023H35.8882L35.8953 109.03ZM35.9658 108.847C35.9658 108.847 35.9728 108.861 35.9869 108.875C39.6441 108.72 42.9137 108.396 45.9931 107.874C48.7624 107.402 49.615 106.613 49.8476 106.035C50.0871 105.429 49.6996 104.922 49.6996 104.915V104.901L45.8521 97.4171C45.7676 97.255 45.4928 97.1634 45.2391 97.2127C38.7069 98.5234 19.2653 98.5234 12.7331 97.2127C12.4794 97.1634 12.2046 97.255 12.1201 97.4171L8.28672 104.901C8.28672 104.901 7.89211 105.429 8.13169 106.035C8.35718 106.613 9.21687 107.409 11.9862 107.874C15.0303 108.389 18.2647 108.713 21.8655 108.868C21.8796 108.847 21.8937 108.833 21.8937 108.833L21.9923 108.642H22.0205C22.2249 108.572 22.4715 108.523 22.7604 108.48C25.1704 108.142 27.4253 108.142 28.9192 108.142C30.413 108.142 32.6679 108.142 35.0779 108.48C35.3668 108.523 35.6134 108.572 35.8178 108.628H35.846L35.9517 108.84L35.9658 108.847Z" fill="#160302"/>
<path d="M45.3166 26.8032C39.0169 24.513 33.1119 24.4778 28.9826 24.4778C24.8533 24.4778 18.9482 24.513 12.6486 26.8032C7.44113 28.6987 9.04775 32.8844 9.04775 32.8844L12.1483 47.7879C13.7478 52.939 44.161 52.8262 45.8099 47.7879L48.9104 32.8844C48.9104 32.8844 50.517 28.6987 45.3095 26.8032H45.3166Z" fill="#160302"/>
<path d="M44.6753 29.0792C38.6223 27.0427 32.9427 27.0145 28.9896 27.0145C25.0364 27.0145 19.3498 27.0427 13.3038 29.0792C8.30076 30.7633 9.84396 34.7376 9.84396 34.7376L12.8176 47.9922C14.3538 52.5725 43.569 52.4668 45.1545 47.9922L48.1281 34.7376C48.1281 34.7376 49.6713 30.7633 44.6683 29.0792H44.6753Z" fill="#DFF3F4"/>
<path d="M44.6753 29.0792C38.6223 27.0427 32.9427 27.0145 28.9896 27.0145C25.0364 27.0145 19.3498 27.0427 13.3038 29.0792C8.30076 30.7633 9.84396 34.7376 9.84396 34.7376L10.3654 37.0489C10.8728 37.4083 11.514 37.7324 12.2962 38.0002C12.3314 38.9233 12.4583 39.783 12.7401 40.5299C12.1693 40.6356 11.6549 40.7554 11.2321 40.8963L11.7606 43.2428C13.2193 43.6234 15.3403 43.87 17.7009 43.87C22.1121 43.87 25.6847 43.0314 25.6847 41.9956C25.6847 41.4037 24.515 40.8752 22.6829 40.5369C22.7463 40.389 22.7956 40.241 22.8449 40.093C25.3394 40.2903 27.5943 40.2974 29.4899 40.2974C33.8094 40.2974 39.9964 40.2692 46.599 38.0425C46.9161 37.9368 47.205 37.817 47.4728 37.6972L48.1352 34.7446C48.1352 34.7446 49.6784 30.7704 44.6753 29.0862V29.0792Z" fill="#C1D1D0"/>
<path d="M6.10921 33.7792C6.1233 33.2789 6.8632 33.2014 6.99708 33.6806C8.54733 39.3037 11.8381 51.29 11.824 51.8185L10.76 92.428C10.7318 93.6823 9.49862 94.2813 8.95604 93.2032C8.95604 93.2032 5.36932 83.4718 5.35522 80.3431L6.10921 33.7792Z" fill="#17347A"/>
<path d="M9.72417 93.8443C9.38594 93.8443 9.08293 93.6259 8.88563 93.2383C8.84335 93.1326 5.29186 83.4506 5.27777 80.3431L6.03176 33.7791C6.0388 33.4761 6.27134 33.3141 6.49683 33.2859C6.71528 33.2577 6.99009 33.3634 7.07465 33.6593C8.88563 40.2127 11.9227 51.297 11.9016 51.8184L10.8375 92.428C10.8164 93.2102 10.3513 93.7175 9.90739 93.8162C9.84397 93.8303 9.78759 93.8373 9.72417 93.8373V93.8443ZM6.18678 33.7862L5.4328 80.3501C5.44689 83.4295 8.99133 93.0833 9.02656 93.182C9.22387 93.5695 9.52687 93.7527 9.86511 93.6752C10.2527 93.5907 10.6614 93.1326 10.6755 92.435L11.7395 51.8255C11.7536 51.4591 9.94967 44.6873 6.91963 33.7087C6.86326 33.4973 6.673 33.4268 6.51093 33.448C6.36295 33.462 6.18678 33.5677 6.17974 33.7932L6.18678 33.7862Z" fill="#160302"/>
<path d="M6.75751 34.822L10.8304 50.1624C10.9855 50.7473 11.0559 51.3462 11.0348 51.9452L9.87915 91.7303C9.86506 92.294 6.79274 84.1129 6.79274 82.3935L6.75751 34.8079V34.822Z" fill="#373637"/>
<path d="M9.87217 91.8431C9.62554 91.8431 8.33601 88.1506 8.18803 87.7278C7.75114 86.4665 6.72234 83.4153 6.72234 82.4006L6.6871 34.223L10.908 50.1413C11.063 50.7332 11.1335 51.3392 11.1194 51.9452L9.96377 91.7303C9.96377 91.8149 9.9074 91.836 9.87217 91.836V91.8431ZM6.83508 35.4139L6.87031 82.4006C6.87031 83.9297 9.26616 90.3421 9.80875 91.5189L10.9573 51.9452C10.9714 51.3463 10.908 50.7543 10.753 50.1836L6.83508 35.4139Z" fill="#160302"/>
<path d="M9.70307 82.5698L10.5205 52.3046C10.5346 51.7409 10.4782 51.1772 10.3443 50.6275L7.25085 37.6759L7.31427 75.4245C7.31427 77.4399 7.84982 79.427 8.86453 81.1675C9.13934 81.6396 9.42121 82.1188 9.70307 82.5768V82.5698Z" fill="#C1D1D0"/>
<path d="M9.70304 82.5698L10.5204 52.3046C10.5345 51.7409 10.4782 51.1772 10.3443 50.6275L9.69599 47.9005C8.25144 54.0592 7.3847 61.9585 7.3847 70.5765C7.3847 73.0921 7.46222 75.5514 7.60315 77.9261C7.85683 79.0606 8.27962 80.1528 8.87154 81.1675C9.14635 81.6396 9.42822 82.1188 9.71008 82.5768L9.70304 82.5698Z" fill="#DFF3F4"/>
<path d="M6.75049 69.3011C6.87028 70.6752 9.42819 75.2554 10.4147 76.0728L10.5275 72.2043C9.7312 70.4638 7.18033 67.2787 6.74344 65.5593L6.75753 69.294L6.75049 69.3011Z" fill="#160302"/>
<path d="M6.7928 34.8502C6.7928 34.8502 0.373348 38.3383 0.373348 39.4587C0.373348 40.5791 -0.00012207 43.2075 -0.00012207 43.2075L5.2355 41.3472L7.66658 38.0705L6.78575 34.8502H6.7928Z" fill="#160302"/>
<path d="M5.62918 66.4665L5.49713 66.5477L10.3844 74.4949L10.5164 74.4137L5.62918 66.4665Z" fill="#160302"/>
<path d="M51.8629 33.8778C51.8488 33.3775 51.1089 33.3 50.975 33.7792C49.4248 39.4024 46.134 51.3886 46.1481 51.9171L47.2122 92.5267C47.2403 93.781 48.4735 94.3799 49.0161 93.3018C49.0161 93.3018 52.6028 83.5705 52.6169 80.4418L51.8629 33.8778Z" fill="#17347A"/>
<path d="M48.2479 93.943C48.1916 93.943 48.1282 93.943 48.0647 93.9219C47.6138 93.8232 47.1487 93.3159 47.1275 92.5337L46.0705 51.9241C46.0494 51.3957 49.0865 40.3184 50.8975 33.7651C50.975 33.4691 51.2568 33.3634 51.4753 33.3916C51.7008 33.4198 51.9333 33.5818 51.9404 33.8849L52.6943 80.4488C52.6803 83.5563 49.1217 93.2383 49.0865 93.337C48.8892 93.7316 48.5862 93.95 48.2479 93.95V93.943ZM51.4119 33.5325C51.2639 33.5325 51.1018 33.61 51.0525 33.8003C48.0225 44.7789 46.2185 51.5507 46.2326 51.9171L47.2896 92.5337C47.3107 93.2313 47.7124 93.6893 48.1 93.7739C48.4382 93.8514 48.7483 93.6682 48.9456 93.2736C48.9808 93.182 52.5252 83.5281 52.5393 80.4488L51.7853 33.8849C51.7783 33.6594 51.6021 33.5607 51.4541 33.5466C51.4401 33.5466 51.4189 33.5466 51.4048 33.5466L51.4119 33.5325Z" fill="#160302"/>
<path d="M51.2145 34.9207L47.1416 50.2612C46.9866 50.846 46.9161 51.445 46.9373 52.0439L48.0929 91.829C48.107 92.3928 51.1793 84.2117 51.1793 82.4923L51.2145 34.9066V34.9207Z" fill="#373637"/>
<path d="M48.1 91.9418C48.1 91.9418 48.0154 91.9207 48.0083 91.8361L46.8598 52.051C46.8457 51.438 46.9091 50.832 47.0712 50.24L51.2921 34.3218V34.9137L51.2568 82.4923C51.2568 83.507 50.228 86.5582 49.7911 87.8195C49.6432 88.2423 48.3536 91.9277 48.107 91.9348L48.1 91.9418ZM51.137 35.5127L47.2191 50.2823C47.0641 50.8601 47.0007 51.4521 47.0148 52.044L48.1634 91.6177C48.713 90.4479 51.1018 84.0285 51.1018 82.4994L51.137 35.5127Z" fill="#160302"/>
<path d="M48.2691 82.6615L47.4517 52.3963C47.4376 51.8326 47.494 51.2689 47.6279 50.7192L50.7213 37.7676L50.6579 75.5162C50.6579 77.5315 50.1224 79.5187 49.1076 81.2592C48.8328 81.7313 48.551 82.2105 48.2691 82.6685V82.6615Z" fill="#C1D1D0"/>
<path d="M48.2691 82.5698L47.4517 52.3046C47.4376 51.7409 47.494 51.1772 47.6279 50.6275L48.2761 47.9005C49.7207 54.0592 50.5874 61.9585 50.5874 70.5765C50.5874 73.0921 50.5099 75.5514 50.369 77.9261C50.1153 79.0606 49.6925 80.1528 49.1006 81.1675C48.8258 81.6396 48.5439 82.1188 48.2621 82.5768L48.2691 82.5698Z" fill="#DFF3F4"/>
<path d="M51.2217 69.3998C51.1019 70.7739 48.544 75.3542 47.5574 76.1716L47.4447 72.303C48.241 70.5625 50.7918 67.3775 51.2287 65.6581L51.2146 69.3928L51.2217 69.3998Z" fill="#160302"/>
<path d="M51.1864 34.9489C51.1864 34.9489 57.6058 38.4299 57.6058 39.5573C57.6058 40.6848 57.9793 43.3061 57.9793 43.3061L52.7437 41.4458L50.3126 38.1691L51.1934 34.9489H51.1864Z" fill="#160302"/>
<path d="M52.342 66.5611L47.4576 74.51L47.5897 74.5912L52.4741 66.6423L52.342 66.5611Z" fill="#160302"/>
<path d="M7.87093 29.7697L7.80047 29.509C7.26492 27.4584 6.55322 24.6821 6.25021 23.0754V23.0472L6.25726 23.0191L13.9803 10.8425C14.6498 9.78555 15.0866 8.62286 15.2699 7.38266L15.5024 5.82536L15.5376 5.80422C15.5729 5.78308 19.3428 3.95097 27.3971 3.38019C27.5944 3.35905 27.7987 3.34496 28.0242 3.33791H28.1158C28.1158 3.33791 28.3906 3.31677 28.7852 3.31677H28.9684H29.1446C29.5533 3.31677 29.8211 3.33087 29.8211 3.33087H29.9127C30.1382 3.35201 30.3425 3.3661 30.5398 3.38019C38.5871 3.95097 42.364 5.78308 42.3993 5.80422L42.4345 5.82536L42.667 7.38266C42.8573 8.62286 43.2871 9.78555 43.9566 10.8425L51.7008 23.0472V23.0754C51.3837 24.6821 50.679 27.4584 50.1435 29.509L50.073 29.7697L49.9955 29.516C49.5093 27.9799 48.2338 26.8454 46.2044 26.1337C39.5243 23.8083 33.1682 23.8083 28.9614 23.8083C24.7546 23.8083 18.3985 23.8083 11.7184 26.1337C9.68895 26.8383 8.41352 27.9799 7.9273 29.516L7.84979 29.7697H7.87093ZM28.9896 23.6603C33.2035 23.6603 39.5806 23.6603 46.2819 25.9927C48.255 26.6762 49.5304 27.7685 50.0871 29.2271C50.6086 27.2259 51.2709 24.6257 51.5669 23.0825L43.8579 10.9271C43.1744 9.84897 42.7305 8.67219 42.5402 7.41085L42.3147 5.93811C41.913 5.74785 38.1502 4.08485 30.5469 3.54226C30.3496 3.52112 30.1452 3.50703 29.9197 3.49998H29.8281C29.8281 3.49998 29.5604 3.47884 29.1658 3.47884H28.9825H28.8134C28.4118 3.47884 28.144 3.49294 28.1369 3.49294H28.0453C27.8199 3.51408 27.6155 3.52817 27.4252 3.54226C19.822 4.08485 16.0591 5.74785 15.6574 5.93811L15.4319 7.41085C15.2417 8.67219 14.7977 9.85602 14.1142 10.9271L6.40524 23.0825C6.7012 24.6186 7.36358 27.2188 7.88502 29.2271C8.44171 27.7614 9.71714 26.6762 11.6902 25.9927C18.3915 23.6603 24.7687 23.6603 28.9825 23.6603H28.9896Z" fill="#160302"/>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,3 @@
<svg width="202" height="135" viewBox="0 0 202 135" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.18153 39.6234C17.011 27.3107 32.2015 17.7116 48.8458 11.4109C66.2695 4.81515 84.892 1.98332 103.49 3.10152C122.087 4.21972 140.239 9.26262 156.751 17.8989C172.525 26.149 186.463 37.4998 197.732 51.2619L95.8009 131.621L4.18153 39.6234Z" fill="#2954E9" fill-opacity="0.55" stroke="white" stroke-width="5"/>
</svg>

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,18 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_193_56)">
<circle cx="16.8921" cy="14.0595" r="12" transform="rotate(2.04823 16.8921 14.0595)" fill="white" fill-opacity="0.45"/>
<path d="M12.542 9.32783C12.2352 9.04959 11.7609 9.07278 11.4826 9.37962C11.2044 9.68647 11.2276 10.1608 11.5344 10.439L12.542 9.32783ZM22.446 20.0368C22.8597 20.0165 23.1787 19.6648 23.1584 19.251L22.8288 12.5091C22.8086 12.0954 22.4568 11.7764 22.0431 11.7966C21.6294 11.8168 21.3104 12.1686 21.3306 12.5823L21.6236 18.5752L15.6308 18.8682C15.217 18.8884 14.8981 19.2402 14.9183 19.6539C14.9385 20.0676 15.2903 20.3866 15.704 20.3664L22.446 20.0368ZM11.5344 10.439L21.9055 19.8433L22.9131 18.7321L12.542 9.32783L11.5344 10.439Z" fill="#0A1F69"/>
</g>
<defs>
<filter id="filter0_d_193_56" x="0.891907" y="0.0593262" width="32.0003" height="32.0004" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="2"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_193_56"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_193_56" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,6 @@
<svg width="173" height="360" viewBox="0 0 173 360" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="173" height="360" fill="#D5DAE8"/>
<line x1="6.5" y1="-1.09278e-07" x2="6.50002" y2="360" stroke="white" stroke-width="5"/>
<line x1="166.5" y1="1.3381e-07" x2="166.5" y2="358.776" stroke="white" stroke-width="5"/>
<line x1="85.0001" y1="5.35242e-08" x2="85" y2="358.776" stroke="white" stroke-width="2" stroke-dasharray="4 4"/>
</svg>

After

Width:  |  Height:  |  Size: 448 B

View File

@@ -34,10 +34,11 @@ h5 {
--grey-pale: #cfd2cf;
--grey-semi-dark: #808080;
--grey-dark: #3e3e3e;
--blue: #2954e9;
--blue-dark: #0a1f69;
--blue-semi: #d7dffc;
--blue: #2954e9;
--blue-semi-pale: #f2f5ff;
--blue-pale: #f2f5ff;
--blue-very-pale: #f9faff;
--blue-geovisio: #34495e;
--beige: #f5f3ec;
--yellow: #fec868;

View File

@@ -1,3 +1,45 @@
export function createLink(href: string, text: string): string {
return `<a href='mailto:signalement.ign@panoramax.fr${href}' target='_blank' title='${text}' class='gvs-btn gvs-widget-bg gvs-btn-large' style='font-size: 1.6em;display: block'><i class="bi bi-exclamation-triangle"></i></a>`
return `<a href='mailto:signalement.ign@panoramax.fr${href}' target='_blank' title='${text}' class='gvs-btn gvs-widget-bg gvs-btn-large' style='font-size: 1.6em;display: block; margin-top: 0.5em;'><i class="bi bi-exclamation-triangle"></i></a>`
}
export function createSequenceLink(href: string, title: string): string {
return `<a href='${href}' title='${title}' class='gvs-btn gvs-widget-bg gvs-btn-large' style='font-size: 1.6em;display: block; position: relative; margin-top: 0.5em;'>
<i class="bi bi-images"></i>
</a>`
}
export function createFullScreenButton(): string {
return `<button type='button' onClick="
const header = document.getElementById('navHeader')
const footer = document.getElementById('navFooter')
const icon = document.getElementById('iconScreen')
const home = document.getElementById('homePage')
if (header) {
const isHiddenHeader = header.classList.contains('hidden')
if (isHiddenHeader) header.classList.remove('hidden')
else header.classList.add('hidden')
}
if (footer) {
const isHiddenHeader = footer.classList.contains('hidden')
if (isHiddenHeader) footer.classList.remove('hidden')
else footer.classList.add('hidden')
}
if (icon) {
const isIconNotFull = icon.classList.contains('bi-fullscreen')
if(isIconNotFull) {
icon.classList.remove('bi-fullscreen')
icon.classList.add('bi-fullscreen-exit')
} else {
icon.classList.remove('bi-fullscreen-exit')
icon.classList.add('bi-fullscreen')
}
}
if (home) {
const isHomeFull = home.classList.contains('full-viewer')
if(isHomeFull) home.classList.remove('full-viewer')
else home.classList.add('full-viewer')
}
"
class='gvs-btn gvs-widget-bg gvs-btn-large'
>
<i id='iconScreen' class="bi bi-fullscreen"></i>
</button>`
}

View File

@@ -35,7 +35,7 @@ defineProps({
}
}
.default {
height: toRem(3.5);
height: toRem(3);
min-width: toRem(3.5);
@include text(s-regular);
display: flex;
@@ -55,13 +55,34 @@ defineProps({
visibility: visible;
}
}
.row-reverse {
flex-direction: row-reverse;
justify-content: flex-start;
width: 100%;
padding: 0;
font-size: toRem(1.2);
.icon {
margin-left: toRem(0.5);
margin-right: 0;
}
}
.button--black {
color: var(--white);
background-color: var(--black);
}
.button-border--black {
font-size: toRem(1.4);
background-color: var(--white);
border: toRem(0.1) solid var(--black);
.icon {
font-size: toRem(1.4);
color: var(--black);
}
}
.button--blue {
color: var(--white);
background-color: var(--blue);
height: toRem(4);
&.disabled {
opacity: 0.6;
color: var(--white);
@@ -75,28 +96,37 @@ defineProps({
color: var(--white);
}
.button--red {
color: var(--red);
background-color: transparent;
border: toRem(0.1) solid var(--red);
color: var(--white);
background-color: var(--red-pale);
border: toRem(0.1) solid var(--red-pale);
.icon {
margin-right: 0;
font-size: toRem(1.4);
color: var(--red);
color: var(--white);
}
.text {
margin-left: toRem(1);
}
&.background-white {
color: var(--red-pale);
.icon {
color: var(--red-pale);
}
&.disabled {
.icon {
color: var(--grey-pale);
}
}
}
}
.button--white {
color: var(--blue);
background-color: var(--white);
border: toRem(0.1) solid var(--blue);
.icon {
font-size: toRem(1.4);
color: var(--blue);
margin-right: 0;
}
.text {
margin-left: toRem(1);
margin-right: toRem(1);
}
}
.no-text {
@@ -104,7 +134,6 @@ defineProps({
width: toRem(3);
padding: 0;
.icon {
color: var(--black);
font-size: toRem(1.8);
margin-right: 0;
}
@@ -112,10 +141,29 @@ defineProps({
.no-text-white .icon {
color: var(--white);
margin-right: 0;
font-size: toRem(1.4);
}
.no-text-blue-dark .icon {
color: var(--blue-dark);
margin-right: 0;
font-size: toRem(1.4);
}
.no-text-green .icon {
color: var(--blue);
margin-right: 0;
font-size: toRem(1.6);
}
.background-white {
background-color: var(--white);
}
.link--blue {
color: var(--blue);
text-decoration: underline;
.icon {
font-size: toRem(1.4);
color: var(--blue);
}
}
.link--grey {
color: var(--grey-semi-dark);
.icon {
@@ -123,12 +171,19 @@ defineProps({
color: var(--grey-semi-dark);
}
}
.link--red {
color: var(--red);
background-color: var(--white);
.link--black {
color: var(--black);
.icon {
font-size: toRem(1.4);
color: var(--red);
color: var(--black);
}
}
.link--red {
color: var(--red-pale);
text-decoration: underline;
.icon {
font-size: toRem(1.4);
color: var(--red-pale);
}
}
@@ -143,8 +198,10 @@ defineProps({
align-items: center;
border-radius: 50%;
padding: 0;
height: toRem(2.5);
width: toRem(2.5);
height: toRem(4);
width: toRem(4);
background-color: var(--white);
border: toRem(0.1) solid var(--grey-pale);
.icon {
color: var(---black);
font-size: toRem(1.8);
@@ -162,6 +219,7 @@ defineProps({
visibility: hidden;
width: toRem(20);
right: 0;
z-index: 9;
@include text(xss-regular);
}

View File

@@ -1,15 +1,28 @@
<template>
<div class="entry-edit">
<form
v-if="isEditTitle"
@submit.prevent="isEditTitle = false"
class="edit-form"
>
<div class="wrapper-input">
<Input
:text="text || ''"
:placeholder="$t('pages.upload.edit_placeholder_input')"
@input="changeTextValue"
<div :class="['entry-edit', { 'edit-mode': isEditTitle }]">
<span v-if="isEditTitle && formTitle" class="form-title">{{
formTitle
}}</span>
<div class="entry-form">
<form
v-if="isEditTitle && !isDisabled"
@submit.prevent="isEditTitle = false"
class="edit-form"
>
<div class="wrapper-input">
<Input
id="upload-title"
:text="text || ''"
:placeholder="$t('pages.upload.edit_placeholder_input')"
@input="changeTextValue"
/>
</div>
<Button
id="valid-button"
:text="$t('pages.upload.ok_button')"
type="submit"
look="button--white"
@trigger="validNewName"
/>
<div class="close-button">
<Button
@@ -19,23 +32,17 @@
@trigger="closeEdition"
/>
</div>
</form>
<span v-else class="title">{{ text }}</span>
<div v-if="!isEditTitle" class="edit-button">
<Button
look="no-text-white"
icon="bi bi-pen"
:tooltip="$t('pages.upload.edit_title_tooltip')"
:disabled="isDisabled"
@trigger="goToEditMode"
/>
</div>
<Button
id="valid-button"
:text="$t('pages.upload.ok_button')"
type="submit"
look="button button--blue"
@trigger="validNewName"
/>
</form>
<span v-else class="title">{{ text }}</span>
<div v-if="!isEditTitle" class="edit-button">
<Button
look="no-text"
icon="bi bi-pen"
:tooltip="$t('pages.upload.edit_title_tooltip')"
@trigger="goToEditMode"
/>
</div>
</div>
</template>
@@ -49,7 +56,10 @@ const emit = defineEmits<{
(e: 'triggerNewText', value: string | null): void
}>()
const props = defineProps({
defaultText: { type: String, default: null }
defaultText: { type: String, default: null },
isLoading: { type: Boolean, default: false },
isLoaded: { type: Boolean, default: false },
formTitle: { type: String, default: null }
})
let titleToEdit = ref<string | null>(null)
let isEditTitle = ref<boolean>(false)
@@ -75,18 +85,35 @@ const text = computed<string | null>(() => {
if (props.defaultText) return props.defaultText
return null
})
const isDisabled = computed<boolean>(() => props.isLoading && !props.isLoaded)
</script>
<style scoped lang="scss">
.title {
color: var(--blue-dark);
text-align: left;
}
.form-title {
text-align: left;
width: 100%;
@include text(xs-r-regular);
margin-bottom: toRem(0.3);
}
.entry-edit {
display: flex;
flex-direction: column;
position: relative;
}
.entry-form {
display: flex;
align-items: center;
margin-bottom: toRem(2);
}
.edit-mode {
background-color: var(--blue-very-pale);
padding: toRem(1);
border-radius: toRem(0.4);
width: 100%;
height: toRem(4.7);
}
.wrapper-edit {
display: flex;
@@ -95,15 +122,16 @@ const text = computed<string | null>(() => {
width: 100%;
}
.edit-button {
background-color: var(--grey);
background-color: var(--blue);
border-radius: 50%;
height: toRem(3.5);
width: toRem(3.5);
height: toRem(2.5);
width: toRem(2.5);
padding: toRem(1);
display: flex;
justify-content: center;
align-items: center;
margin-left: toRem(1.5);
z-index: 2;
}
.wrapper-input {
position: relative;
@@ -123,7 +151,7 @@ const text = computed<string | null>(() => {
height: toRem(2);
width: toRem(2);
top: toRem(-1);
right: toRem(-1);
left: toRem(-1);
background-color: var(--blue-dark);
color: var(--white);
border-radius: 50%;

View File

@@ -1,5 +1,5 @@
<template>
<footer class="footer">
<footer id="navFooter" class="footer">
<ul class="link-list">
<li class="link-item">
<div class="link">
@@ -62,6 +62,9 @@ ul {
padding: toRem(1.5) toRem(3);
border-top: toRem(0.1) solid var(--grey);
}
.hidden {
display: none;
}
.link-list {
display: flex;
justify-content: center;

View File

@@ -1,5 +1,5 @@
<template>
<header class="header">
<header id="navHeader" class="header">
<div class="responsive entry-instance">
<InstanceName />
</div>
@@ -107,16 +107,13 @@
<script lang="ts" setup>
import { ref, computed } from 'vue'
import { onClickOutside } from '@vueuse/core'
import { useCookies } from 'vue3-cookies'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { getAuthRoute } from '@/utils/auth'
import { getAuthRoute, hasASessionCookieDecoded } from '@/utils/auth'
import Link from '@/components/Link.vue'
import InstanceName from '@/components/InstanceName.vue'
import HeaderOpen from '@/components/header/HeaderOpen.vue'
import AccountButton from '@/components/header/AccountButton.vue'
const { cookies } = useCookies()
const { t } = useI18n()
const route = useRoute()
defineProps({
@@ -128,26 +125,31 @@ let menuIsClosed = ref<boolean>(true)
onClickOutside(list, () => closeModal())
function closeModal() {
function closeModal(): void {
menuIsClosed.value = true
}
function toggleMenu(): void {
menuIsClosed.value = !menuIsClosed.value
}
const isLogged = computed((): boolean => !!cookies.get('user_id'))
const isLogged = computed((): boolean => {
const cookie = hasASessionCookieDecoded()
return !!(cookie && cookie.account)
})
const ariaLabel = computed((): string =>
menuIsClosed.value
? t('general.header.burger_menu_aria_label_open')
: t('general.header.burger_menu_aria_label_closed')
)
const userName = computed((): string =>
cookies!
.get('user_name')
.match(/\b(\w)/g)!
.join('')
.toUpperCase()
)
const userName = computed((): string => {
const cookie = hasASessionCookieDecoded()
if (cookie && cookie.account) {
return cookie.account.name
.match(/\b(\w)/g)!
.join('')
.toUpperCase()
}
return ''
})
</script>
<style lang="scss" scoped>
@@ -158,6 +160,9 @@ const userName = computed((): string =>
background-color: var(--white);
border-bottom: toRem(0.1) solid var(--grey-pale);
}
.hidden {
display: none;
}
.nav {
width: 100%;
display: flex;

View File

@@ -10,9 +10,7 @@
alt=""
class="icon-block-img"
/>
<h3 v-if="title" class="subtitle">
{{ title }}
</h3>
<slot name="title"></slot>
</div>
<p v-if="text" v-html="text" class="information-text"></p>
</div>
@@ -23,7 +21,6 @@
<script setup lang="ts">
defineProps({
text: { type: String, default: null },
title: { type: String, default: null },
look: { type: String, default: '' }
})
</script>
@@ -36,11 +33,11 @@ h3 {
.information-block {
position: relative;
border-left: toRem(1.4) solid var(--blue);
padding: toRem(2) toRem(2) toRem(1.5);
padding: toRem(1.8) toRem(1.8) toRem(1.3);
background-color: var(--white);
border-radius: toRem(1.5);
display: flex;
align-items: flex-end;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
@@ -61,10 +58,6 @@ h3 {
margin-right: toRem(0.5);
height: toRem(2.2);
}
.subtitle {
@include text(h2);
color: var(--blue-dark);
}
.information-text {
margin-top: toRem(1);
@include text(m-r-regular);

View File

@@ -3,16 +3,21 @@
:value="text"
:required="true"
:placeholder="placeholder"
class="input"
type="text"
:type="type"
:min="min"
:max="max"
@input="emitValue"
class="input"
/>
</template>
<script lang="ts" setup>
const emit = defineEmits<{ (e: 'input', value: string): void }>()
const props = defineProps({
text: { type: String, default: null },
defineProps({
type: { type: String, default: 'text' },
min: { type: String, default: '' },
max: { type: String, default: '' },
text: { type: [String, Number], default: null },
placeholder: { type: String, default: '' }
})
@@ -24,10 +29,11 @@ function emitValue(event: Event): void {
<style scoped lang="scss">
.input {
padding: toRem(1);
padding: toRem(0.5) toRem(1);
border-radius: toRem(0.5);
border: toRem(0.1) solid var(--blue-dark);
color: var(--blue-dark);
width: 100%;
@include text(s-r-regular);
}
</style>

View File

@@ -1,18 +1,18 @@
<template>
<div class="wrapper-checkbox">
<div :class="['wrapper-checkbox', { checked: isChecked || isIndeterminate }]">
<div class="input-checkbox">
<i v-if="isChecked && !isIndeterminate" class="icon bi bi-check-square" />
<i v-if="!isChecked && !isIndeterminate" class="icon bi bi-square" />
<i v-if="isIndeterminate && !isChecked" class="icon bi bi-dash-square" />
<input
id="checkbox"
:id="name"
v-model="inputValue"
type="checkbox"
@input="updateValue(!inputValue)"
class="input"
/>
</div>
<label v-if="label && label.length" for="checkbox" class="label">{{
<label v-if="label && label.length" :for="name" class="label">{{
label
}}</label>
</div>
@@ -35,6 +35,7 @@ watchEffect(async () => {
if (htmlCheckbox) {
htmlCheckbox.indeterminate = props.isIndeterminate
}
inputValue.value = props.isChecked
})
function updateValue(value: boolean): void {
@@ -42,7 +43,11 @@ function updateValue(value: boolean): void {
htmlCheckbox.indeterminate = false
}
inputValue.value = value
emit('trigger', { isChecked: value, isIndeterminate: false })
emit('trigger', {
isChecked: value,
isIndeterminate: false,
name: props.name
})
}
</script>
@@ -54,6 +59,8 @@ function updateValue(value: boolean): void {
align-items: center;
height: toRem(2);
width: toRem(2);
background-color: var(--white);
border-radius: toRem(0.5);
}
.input {
-webkit-appearance: none;
@@ -68,7 +75,7 @@ function updateValue(value: boolean): void {
.icon {
font-size: toRem(2);
position: absolute;
color: var(--grey-semi-dark);
color: var(--blue);
}
.wrapper-checkbox {
display: flex;
@@ -77,5 +84,14 @@ function updateValue(value: boolean): void {
.label {
cursor: pointer;
margin-left: toRem(0.5);
@include text(s-r-regular);
}
.checked {
.input-checkbox {
background-color: var(--blue);
}
.icon {
color: var(--white);
}
}
</style>

View File

@@ -0,0 +1,36 @@
<template>
<div class="input-radio">
<input
:id="id"
:name="name"
:value="id"
type="radio"
:checked="props.value === id"
@change="updateValue"
class="input"
/>
<label v-if="label && label.length" :for="id" class="label">{{
label
}}</label>
</div>
</template>
<script lang="ts" setup>
const emit = defineEmits<{ (e: 'trigger', value: string): void }>()
const props = defineProps({
name: { type: String, default: null },
id: { type: String, default: '' },
label: { type: String, default: '' },
value: { type: String, default: null }
})
function updateValue(): void {
emit('trigger', props.id)
}
</script>
<style lang="scss" scoped>
.label {
margin-left: toRem(0.5);
}
</style>

View File

@@ -0,0 +1,76 @@
<template>
<label class="toggle">
<input
type="checkbox"
v-model="inputValue"
@input="updateValue(inputValue)"
class="input"
/>
<div :class="['labels increase', { increaseChecked: !inputValue }]">
<span>{{ $t('pages.sequence.sort_panel_settings_order_increase') }}</span>
<i class="bi bi-sort-up"></i>
</div>
<div :class="['labels decrease', { decreaseChecked: inputValue }]">
<span>{{ $t('pages.sequence.sort_panel_settings_order_decrease') }}</span>
<i class="bi bi-sort-down"></i>
</div>
</label>
</template>
<script setup lang="ts">
import { ref, watchEffect } from 'vue'
const emit = defineEmits<{
(e: 'trigger', value: { isIncreaseChecked: boolean }): void
}>()
let inputValue = ref<boolean>(false)
const props = defineProps({
increased: { type: Boolean, default: false }
})
watchEffect(() => {
inputValue.value = !props.increased
})
function updateValue(value: boolean): void {
inputValue.value = value
emit('trigger', { isIncreaseChecked: value })
}
</script>
<style scoped lang="scss">
.toggle {
position: relative;
width: 14.5rem;
background-color: var(--blue-very-pale);
padding: toRem(0.7);
border-radius: toRem(0.7);
height: toRem(4.5);
cursor: pointer;
}
.input {
width: 100%;
border: none;
appearance: none;
}
.labels {
position: absolute;
top: toRem(0.7);
@include text(s-r-regular);
padding: toRem(0.5) toRem(1);
color: var(--grey-semi-dark);
span {
margin-right: toRem(0.5);
}
}
.increase {
left: toRem(0.7);
}
.decrease {
right: toRem(0.7);
}
.increaseChecked,
.decreaseChecked {
background-color: var(--blue-dark);
color: var(--white);
border-radius: toRem(0.7);
}
</style>

View File

@@ -55,7 +55,7 @@ const props = defineProps({
})
const titleImg = computed<string>(() =>
props.disabled ? t('general.header.contribute_text') : ''
props.disabled ? t('general.header.about_text') : ''
)
function triggerButton() {
if (props.disabled) return
@@ -117,6 +117,23 @@ function triggerButton() {
color: var(--grey-semi-dark);
text-decoration: underline;
font-weight: inherit;
font-size: toRem(1.4);
.icon {
color: var(--grey-semi-dark);
font-size: toRem(1.4);
margin-right: toRem(0.5);
}
}
.link--grey-dark {
color: var(--grey-dark);
text-decoration: underline;
font-weight: inherit;
font-size: toRem(1.4);
.icon {
color: var(--grey-dark);
font-size: toRem(1.4);
margin-right: toRem(0.5);
}
}
.link--blue-dark {
color: var(--blue-dark);
@@ -163,7 +180,7 @@ function triggerButton() {
}
}
.button--blue-bleu {
background-color: var(--blue-semi);
background-color: var(--blue-semi-pale);
color: var(--blue);
}
.disabled {

View File

@@ -13,15 +13,10 @@
<i class="bi bi-x-circle-fill"></i>
</button>
<div class="modal-header">
<h5>{{ $t('pages.upload.modal_error_title') }}</h5>
<h5>{{ title }}</h5>
</div>
<div class="modal-body">
<ul>
<li v-for="item in uploadErrors" class="error-item">
<span>{{ item.name }} - </span>
<span>{{ item.message }}</span>
</li>
</ul>
<slot name="body"></slot>
</div>
</div>
</div>
@@ -30,15 +25,13 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import type { PropType } from 'vue'
import { Modal } from 'bootstrap'
let bsModal = ref()
import type { uploadErrorInterface } from '@/views/interfaces/UploadPicturesView'
defineProps({
uploadErrors: {
type: Array as PropType<uploadErrorInterface[]>,
default: []
title: {
type: String,
default: ''
}
})
@@ -62,12 +55,6 @@ ul {
.modal {
background: rgba(10, 31, 105, 0.6);
}
.error-item {
padding: toRem(1);
&:nth-child(odd) {
background-color: var(--grey);
}
}
.modal-content {
border-radius: toRem(1.5);
}

View File

@@ -0,0 +1,49 @@
<template>
<div class="tab">
<button
:class="['tablinks', { selected: panelSelected === 'photos' }]"
@click="$emit('trigger', 'photos')"
>
{{ $t('pages.sequence.button_panel_photos') }}
</button>
<button
:class="['tablinks', { selected: panelSelected === 'orientation' }]"
@click="$emit('trigger', 'orientation')"
>
{{ $t('pages.sequence.button_panel_orientation') }}
</button>
<button
:class="['tablinks', { selected: panelSelected === 'sort' }]"
@click="$emit('trigger', 'sort')"
>
{{ $t('pages.sequence.button_panel_sort') }}
</button>
</div>
</template>
<script setup lang="ts">
defineProps({
panelSelected: { type: String, default: '' }
})
</script>
<style scoped lang="scss">
.tab {
display: flex;
width: 100%;
@include text(s-regular);
}
.tablinks {
border: none;
border-top-right-radius: toRem(0.5);
border-top-left-radius: toRem(0.5);
margin-right: toRem(0.3);
background-color: var(--blue-very-pale);
padding: toRem(1);
}
.selected {
background-color: var(--blue-semi-pale);
color: var(--blue-dark);
font-weight: 600;
}
</style>

View File

@@ -39,6 +39,7 @@ defineProps({
min-width: toRem(10);
padding-right: toRem(1);
padding-left: toRem(1);
z-index: 1;
}
.button-close {
position: absolute;

View File

@@ -1,132 +1,196 @@
<template>
<div id="viewer" class="entry-viewer"></div>
<div :id="id" class="entry-viewer"></div>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
import type { ViewerInterface, MapInterface } from '@/views/interfaces/common'
import { getIgnTiles } from '@/utils/mapAndViewer'
import axios from 'axios'
import { onMounted, onUnmounted, ref, computed } from 'vue'
import { useSequenceStore } from '@/store/sequence'
import { Viewer, StandaloneMap } from 'geovisio'
import { createUrlLink } from '@/utils'
import { createLink } from '@/components-viewer/reportLink'
import {
createLink,
createSequenceLink,
createFullScreenButton
} from '@/components-viewer/reportLink'
import { useI18n } from 'vue-i18n'
import { hasASessionCookieDecoded } from '@/utils/auth'
import type { ViewerInterface, MapInterface } from '@/views/interfaces/common'
const sequenceStore = useSequenceStore()
const { t } = useI18n()
const emit = defineEmits<{ (e: 'triggerReady', value: boolean): void }>()
let mapIsLoaded = ref<boolean>(false)
let viewer = ref()
const props = defineProps({
id: { type: String, default: 'viewer' },
fetchOptions: { type: Object, default: {} },
geovisioViewer: { type: Boolean, default: true },
bbox: { type: Array, default: null },
userId: { type: String, default: '' }
})
const isLogged = computed((): boolean => {
const cookie = hasASessionCookieDecoded()
return !!(cookie && cookie.account)
})
const userName = computed((): string => {
const cookie = hasASessionCookieDecoded()
if (cookie && cookie.account) return cookie.account.name
return ''
})
defineExpose({
viewer
})
onMounted(async () => {
const tiles = import.meta.env.VITE_TILES
async function getSequenceId(imgId: string): Promise<{
sequenceId: string
username: string
}> {
const { data } = await axios.get(`api/search?ids=${imgId}`)
return {
sequenceId: data.features[0].collection,
username: data.features[0].properties['geovisio:producer']
}
}
function createViewerButton(link: HTMLDivElement): void {
link.innerHTML = `<div>${createFullScreenButton()}</div>`
viewer.value.addEventListener(
'picture-loaded',
async (e: { detail: { picId: string } }): Promise<void> => {
const sequenceInformation = await getSequenceId(e.detail.picId)
let href: string
if (isLogged.value && sequenceInformation.username === userName.value) {
href = `${window.location.origin}/sequence/${sequenceInformation.sequenceId}?currentPic=${e.detail.picId}`
link.innerHTML = `<div>
${createFullScreenButton()}
${createSequenceLink(
href,
t('pages.home.sequence_title')
)}
</div>`
sequenceStore.addSequence(e.detail.picId)
} else {
href = t('pages.home.report_mail', {
picId: e.detail.picId,
link: createUrlLink(e.detail.picId)
})
link.innerHTML = `<div>
${createFullScreenButton()}
${createLink(
href,
t('pages.home.report_button_text')
)}
</div>`
}
}
)
}
async function setupViewerMap(tiles: string): Promise<void> {
const maxZoom = import.meta.env.VITE_MAX_ZOOM
const zoom = import.meta.env.VITE_ZOOM
const center = import.meta.env.VITE_CENTER
let paramsViewer: ViewerInterface
let paramsMap: MapInterface
try {
if (props.geovisioViewer) {
paramsViewer = { map: { startWide: true } }
if (center && center !== '') {
const centerMap = center.split(',').map((el: string) => parseInt(el))
paramsViewer = {
map: {
...paramsViewer.map,
center: centerMap
}
}
const raster = import.meta.env.VITE_RASTER_TILE
let paramsViewer: ViewerInterface = { map: { startWide: true } }
if (raster && raster !== '') {
paramsViewer = {
map: {
...paramsViewer.map,
raster: JSON.parse(raster)
}
if (zoom && zoom !== '') {
paramsViewer = {
map: {
...paramsViewer.map,
zoom: parseFloat(zoom)
}
}
}
if (maxZoom && maxZoom !== '') {
paramsViewer = {
map: {
...paramsViewer.map,
maxZoom: parseInt(maxZoom)
}
}
}
if (tiles) {
const style = tiles.includes('wxs.ign.fr') ? await getIgnTiles() : tiles
paramsViewer = {
map: {
...paramsViewer.map,
style
}
}
}
if (props.fetchOptions) {
paramsViewer = {
...paramsViewer,
...props.fetchOptions
}
}
const reportLink = document.createElement('div')
reportLink.className = 'gvs-group gvs-group-large gvs-group-btnpanel'
viewer.value = new Viewer(
'viewer', // Div ID
`${import.meta.env.VITE_API_URL}/api/search`,
{
...paramsViewer,
widgets: { customWidget: reportLink }
}
)
if (viewer.value && viewer.value.addEventListener) {
viewer.value.addEventListener(
'picture-loaded',
async (e: { detail: { picId: string } }): Promise<void> => {
const href = t('pages.home.report_mail', {
picId: e.detail.picId,
link: createUrlLink(e.detail.picId)
})
reportLink.innerHTML = createLink(
href,
t('pages.home.report_button_text')
)
}
)
}
} else {
paramsMap = { minZoom: 7 }
if (tiles) {
const style = tiles.includes('wxs.ign.fr') ? await getIgnTiles() : tiles
paramsMap = {
...paramsMap,
style
}
}
viewer.value = new StandaloneMap(
'viewer', // Div ID
`${import.meta.env.VITE_API_URL}/api/search`,
{
...paramsMap,
bounds: [props.bbox[0], props.bbox[1], props.bbox[2], props.bbox[3]],
zoom: 9
}
)
viewer.value.addEventListener('ready', () => {
viewer.value.setFilters({ user: props.userId }, true)
})
}
}
if (center && center !== '') {
const centerMap = center.split(',').map((el: string) => parseInt(el))
paramsViewer = {
map: {
...paramsViewer.map,
center: centerMap
}
}
}
if (zoom && zoom.length) {
paramsViewer = {
map: {
...paramsViewer.map,
zoom: parseFloat(zoom)
}
}
}
if (maxZoom && maxZoom.length) {
paramsViewer = {
map: {
...paramsViewer.map,
maxZoom: parseInt(maxZoom)
}
}
}
if (tiles && tiles.length) {
paramsViewer = {
map: {
...paramsViewer.map,
style: tiles
}
}
}
if (props.fetchOptions) {
paramsViewer = {
...paramsViewer,
...props.fetchOptions
}
}
const reportLink = document.createElement('div')
reportLink.className = 'gvs-group gvs-group-large gvs-group-btnpanel'
viewer.value = new Viewer(
'viewer', // Div ID
`${import.meta.env.VITE_API_URL}/api/search`,
{
...paramsViewer,
widgets: { customWidget: reportLink }
}
)
if (viewer.value && viewer.value.addEventListener) {
createViewerButton(reportLink)
}
}
async function setupMap(tiles: string): Promise<void> {
let paramsMap: MapInterface
paramsMap = { users: [props.userId], minZoom: 7 }
if (tiles && tiles.length) {
paramsMap = {
...paramsMap,
style: tiles
}
}
const bbox = [props.bbox[0], props.bbox[1], props.bbox[2], props.bbox[3]]
viewer.value = new StandaloneMap(
props.id, // Div ID
`${import.meta.env.VITE_API_URL}/api/search`,
{
...paramsMap,
bounds: bbox,
zoom: 14
}
)
viewer.value.addEventListener('ready', () => {
viewer.value.fitBounds(bbox, {
padding: { top: 70, bottom: 70, left: 70, right: 70 },
maxZoom: 14,
speed: 10
})
})
}
onMounted(async (): Promise<void> => {
const tiles = import.meta.env.VITE_TILES
try {
if (props.geovisioViewer) await setupViewerMap(tiles)
else await setupMap(tiles)
mapIsLoaded.value = true
emit('triggerReady', mapIsLoaded.value)
} catch (err) {
mapIsLoaded.value = true
console.log(err)
}
})
onUnmounted(() => {
onUnmounted((): void => {
if (viewer.value && props.geovisioViewer) viewer.value.destroy()
})
</script>

View File

@@ -0,0 +1,166 @@
<template>
<div class="wrapper-calendar">
<div class="inputs-wrapper">
<div class="input-wrapper">
<i class="bi bi-calendar-plus"></i>
<input
:value="
range && range.start
? formatDate(new Date(range.start), 'YYYY-MM-DD')
: null
"
:placeholder="$t('pages.sequences.radio_date_placeholder')"
@input="setStartValue"
class="input"
/>
</div>
<i class="bi bi-arrow-right"></i>
<div class="input-wrapper">
<i class="bi bi-calendar-plus"></i>
<input
:value="
range && range.end
? formatDate(new Date(range.end), 'YYYY-MM-DD')
: null
"
:placeholder="$t('pages.sequences.radio_date_placeholder')"
@input="setEndValue"
class="input"
/>
</div>
</div>
</div>
<v-date-picker
ref="datePicker"
v-model="range"
mode="date"
:masks="{
input: 'YYYY-MM-DD'
}"
is-range
expanded
:max-date="new Date()"
/>
<div class="footer-modal">
<Button
:text="$t('pages.sequences.filter_date_close_button')"
look="button--transparent"
@trigger="$emit('triggerCloseModal')"
/>
<Button
v-if="range && (range.start || range.end)"
:text="$t('pages.sequences.filter_date_reset_button')"
icon="bi bi-trash"
look="button--red"
@trigger="resetCalendar"
/>
</div>
</template>
<script setup lang="ts">
import moment from 'moment'
import { ref, watch } from 'vue'
import type { PropType } from 'vue'
import { formatDate } from '@/utils/dates'
import Button from '@/components/Button.vue'
interface CalendarDateInterface {
start: Date | string | null
end: Date | string | null
type: string
}
const emit = defineEmits(['triggerDate', 'triggerCloseModal'])
const props = defineProps({
type: { type: String, default: '' },
rangeSelected: {
type: Object as PropType<CalendarDateInterface>,
default: { start: null, end: null, type: '' }
}
})
let range = ref<CalendarDateInterface>({
start: props.rangeSelected.start,
end: props.rangeSelected.end,
type: props.rangeSelected.type
})
const datePicker = ref()
function checkValidityDate(dateToValid: string): boolean {
const date = moment(dateToValid, 'YYYY-MM-DD', true)
return date.isValid() && date.format('YYYY-MM-DD') === dateToValid
}
function setStartValue(event: Event): void {
const value = (event.target as HTMLInputElement).value
if (checkValidityDate(value)) {
range.value.start = new Date(value)
const startDate = `${formatDate(new Date(value), 'YYYY-MM-DD')} 12:00 AM`
if (range && range.value.end && range.value.start) {
range.value = {
start: new Date(startDate),
end: range.value.end,
type: props.type
}
datePicker.value.updateValue(range.value)
}
}
}
function setEndValue(event: Event): void {
const value = (event.target as HTMLInputElement).value
if (checkValidityDate(value)) {
range.value.end = new Date(value)
const endDate = `${formatDate(new Date(value), 'YYYY-MM-DD')} 11:59 PM`
if (range && range.value.end && range.value.start) {
range.value = {
end: new Date(endDate),
start: range.value.start,
type: props.type
}
datePicker.value.updateValue(range.value)
}
}
}
function resetCalendar(): void {
range.value = { start: null, end: null, type: '' }
emit('triggerDate', { start: null, end: null, type: props.type })
}
watch(range, (range) => {
if (range && range.start && range.end) {
const startDate = `${formatDate(range.start, 'YYYY-MM-DD')} 12:00 AM`
const endDate = `${formatDate(range.end, 'YYYY-MM-DD')} 11:59 PM`
range.type = props.type
emit('triggerDate', { start: startDate, end: endDate, type: props.type })
}
})
</script>
<style scoped lang="scss">
.wrapper-calendar {
margin-bottom: toRem(2);
}
.inputs-wrapper {
display: flex;
align-items: center;
@include text(xs-r-regular);
}
.input-wrapper {
position: relative;
width: 100%;
}
.footer-modal {
margin-top: toRem(2);
display: flex;
justify-content: space-between;
}
.bi-arrow-right {
margin-right: toRem(1);
margin-left: toRem(1);
}
.bi-calendar-plus {
position: absolute;
left: 5%;
top: 20%;
}
.input {
padding: toRem(0.5) toRem(0.5) toRem(0.5) toRem(2.5);
border-radius: toRem(0.3);
border: toRem(0.1) solid var(--grey-pale);
width: 100%;
}
</style>

View File

@@ -53,7 +53,7 @@ defineProps({
justify-content: center;
align-items: center;
color: var(--blue);
background-color: var(--blue-semi);
background-color: var(--blue-semi-pale);
height: toRem(3);
width: toRem(3);
border-radius: 50%;

View File

@@ -110,7 +110,7 @@ ul {
width: toRem(25);
top: toRem(8);
right: 0;
z-index: 2;
z-index: 3;
background-color: var(--white);
box-shadow: 0 toRem(0.2) toRem(0.4) rgb(0 0 0 / 10%);
border-radius: toRem(1);

View File

@@ -0,0 +1,145 @@
<template>
<div class="wrapper-orientation">
<h2 class="orientation-title">
{{ $t('pages.sequence.orientation_panel_title') }}
</h2>
<div class="entry-information-card">
<InformationCard>
<template v-slot:title>
<h3 class="subtitle">
{{ $t('pages.sequence.orientation_panel_tooltip') }}
</h3>
</template>
</InformationCard>
<div class="wrapper-input-angle">
<label for="inputAngle" name="inputAngle">{{
$t('pages.sequence.orientation_input_label')
}}</label>
<Input
id="inputAngle"
name="inputAngle"
type="number"
min="-180"
max="180"
:text="Number(angleInputValue)"
:placeholder="$t('pages.sequence.orientation_input_placeholder')"
@input="captureAngle"
/>
<span v-if="errorAngleValue" class="errorValue">{{
$t('pages.sequence.orientation_input_error_value')
}}</span>
</div>
</div>
<div class="entry-compass">
<WidgetOrientation
:road-degrees="roadDegrees"
:seq-brute-deg="angleValue"
@triggerAngle="captureAngle"
/>
</div>
<div class="entry-button">
{{ isLoading }}
<Button
look="button--blue"
:text="$t('pages.sequence.orientation_panel_button')"
:disabled="isDisabled(Number(angleInputValue)) || isLoading"
@trigger="triggerAngle"
/>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, watchEffect } from 'vue'
import InformationCard from '@/components/InformationCard.vue'
import Button from '@/components/Button.vue'
import Input from '@/components/Input.vue'
import WidgetOrientation from '@/components/sequence/WidgetOrientation.vue'
const emit = defineEmits<{
(e: 'triggerAngle', value: number): void
}>()
let angleValue = ref<number>(0)
let angleInputValue = ref<number>(0)
let errorAngleValue = ref<boolean>(false)
const props = defineProps({
roadDegrees: { type: Number, default: 0 },
seqBruteDeg: { type: Number, default: 0 },
isLoading: { type: Boolean, default: false }
})
watchEffect(() => {
angleValue.value = props.seqBruteDeg
angleInputValue.value = Math.round(props.seqBruteDeg - props.roadDegrees)
})
function isDisabled(value: number): boolean {
return value < -180 || value > 180
}
function captureAngle(value: number | string) {
errorAngleValue.value = false
const valueNum = Number(value)
angleInputValue.value = valueNum
angleValue.value = valueNum + props.roadDegrees
if (isDisabled(valueNum)) return (errorAngleValue.value = true)
}
function triggerAngle() {
const valueToSend = angleValue.value - Number(props.roadDegrees)
if (isDisabled(valueToSend)) return
emit('triggerAngle', valueToSend)
}
</script>
<style scoped lang="scss">
.wrapper-orientation {
background-color: var(--blue-semi-pale);
}
.orientation-title {
@include text(h4);
margin-bottom: toRem(2);
}
.subtitle {
@include text(m-r-regular);
color: var(--blue-dark);
margin-bottom: 0;
}
.entry-compass {
width: 100%;
margin-bottom: toRem(2);
}
.entry-information-card {
margin-top: toRem(2);
margin-bottom: toRem(2.5);
display: flex;
}
.wrapper-input-angle {
margin-left: toRem(1);
width: 45%;
background-color: var(--white);
padding: toRem(1);
border-radius: toRem(1);
}
.entry-button {
width: 100%;
display: flex;
justify-content: center;
}
.errorValue {
color: var(--red);
@include text(xs-r-regular);
text-align: center;
}
@media (max-width: toRem(102.4)) {
.entry-information-card {
flex-direction: column;
}
.wrapper-input-angle {
margin-left: 0;
width: 100%;
margin-top: toRem(1);
}
}
@media (max-width: toRem(50)) {
.orientation-title {
@include text(m-regular);
margin-bottom: toRem(2);
}
}
</style>

View File

@@ -0,0 +1,256 @@
<template>
<div v-if="pictures && pictures.length">
<div v-if="isSequenceOwner" class="delete-all">
<div class="wrapper-select">
<InputCheckbox
:is-checked="pictures.length === picturesToDelete.length"
:is-indeterminate="isIndeterminate"
:label="selectedText"
name="picture-selected"
@trigger="triggerInputCheck"
/>
<div v-if="picturesToDelete.length" class="wrapper-photo-selected">
<span class="photo-selected-separator">-</span>
<span>{{
$t('pages.sequence.picture_selected', picturesToDelete.length)
}}</span>
</div>
</div>
<div class="action-buttons">
<Button
look="button--white background-white no-text"
:icon="
picturesToDeleteStatus === 'hidden' ||
imagesSelectedHaveDifferentStatus
? 'bi bi-eye'
: 'bi bi-eye-slash'
"
:tooltip="$t('pages.sequence.hide_photo_tooltip')"
:disabled="!picturesToDelete.length || sequence.status === 'hidden'"
@trigger="triggerPatchOrDeleteCollectionItems('PATCH')"
/>
<div class="button-hidde">
<Button
look="button--red background-white no-text"
icon="bi bi-trash"
:tooltip="$t('pages.sequence.delete_photo_tooltip')"
:disabled="!picturesToDelete.length"
@trigger="triggerPatchOrDeleteCollectionItems('DELETE')"
/>
</div>
</div>
</div>
<ul class="photo-list">
<li v-for="(item, i) in pictures" :id="`el-list${i}`" class="photo-item">
<ImageItem
:href="item.assets.thumb.href"
:href-hd="item.assets.hd.href"
:created="formatDate(item.properties.datetime, 'HH:mm:ss')"
:selected="photoToDeleteOrPatchSelected(item, picturesToDelete)"
:selected-on-map="itemSelected === item.id"
:status="
imageStatus(item.properties['geovisio:status'], sequence.status)
"
@trigger="triggerSelectImageAndMove(item)"
/>
</li>
<div class="entry-pagination">
<Pagination
v-for="item in paginationLinks"
:type="item.rel"
:href="item.href"
:self-link="selfLink[0]"
@trigger="triggerGoToNextPage"
/>
</div>
</ul>
</div>
<p v-else class="no-photo">{{ $t('pages.sequence.no_image') }}</p>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { PropType } from 'vue'
import Pagination from '@/components/Pagination.vue'
import InputCheckbox from '@/components/InputCheckbox.vue'
import ImageItem from '@/components/ImageItem.vue'
import Button from '@/components/Button.vue'
import { formatDate } from '@/utils/dates'
import {
imageStatus,
photoToDeleteOrPatchSelected
} from '@/views/utils/sequence/index'
import type {
ResponseUserPhotoLinksInterface,
ResponseUserPhotoInterface,
UserSequenceInterface,
CheckboxInterface
} from '../../views/interfaces/MySequenceView'
const { t } = useI18n()
const emit = defineEmits<{
(e: 'triggerInputCheck', value: CheckboxInterface): void
(e: 'triggerGoToNextPage', value: string): void
(e: 'triggerSelectImageAndMove', value: ResponseUserPhotoInterface): void
(e: 'triggerPatchOrDeleteCollectionItems', value: string): void
}>()
const props = defineProps({
pictures: {
type: Array as PropType<ResponseUserPhotoInterface[]>,
default: []
},
picturesToDelete: {
type: Array as PropType<string[]>,
default: []
},
sequence: {
type: Object as PropType<UserSequenceInterface>,
default: {}
},
paginationLinks: {
type: Array as PropType<ResponseUserPhotoLinksInterface[]>,
default: []
},
selfLink: {
type: Array as PropType<ResponseUserPhotoLinksInterface[]>,
default: []
},
fullImagesToDelete: {
type: Array as PropType<ResponseUserPhotoInterface[]>,
default: []
},
menuHeight: {
type: String,
default: '0'
},
isSequenceOwner: { type: Boolean, default: false },
imagesSelectedHaveDifferentStatus: { type: Boolean, default: false },
itemSelected: { type: String, default: '' }
})
const isIndeterminate = computed(
(): boolean =>
!!props.picturesToDelete.length &&
!!props.sequence &&
props.pictures.length !== props.picturesToDelete.length
)
const selectedText = computed((): string =>
props.picturesToDelete.length === props.pictures.length
? t('pages.sequence.unselect_text')
: t('pages.sequence.select_text')
)
const picturesToDeleteStatus = computed((): string => {
if (props.fullImagesToDelete.length) {
return props.fullImagesToDelete[0].properties['geovisio:status']
}
return 'hidden'
})
function triggerInputCheck(value: CheckboxInterface): void {
emit('triggerInputCheck', value)
}
function triggerGoToNextPage(value: string): void {
emit('triggerGoToNextPage', value)
}
function triggerSelectImageAndMove(value: ResponseUserPhotoInterface): void {
emit('triggerSelectImageAndMove', value)
}
function triggerPatchOrDeleteCollectionItems(value: string): void {
emit('triggerPatchOrDeleteCollectionItems', value)
}
</script>
<style scoped lang="scss">
.delete-all {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: toRem(1);
margin-right: toRem(2);
margin-bottom: toRem(1);
@include text(xs-r-regular);
}
.wrapper-select {
display: flex;
align-items: center;
}
.wrapper-photo-selected {
@include text(xs-regular);
}
.photo-selected-separator {
margin-right: toRem(0.5);
margin-left: toRem(0.5);
}
.action-buttons {
display: flex;
align-items: center;
}
.button-hidde {
margin-right: toRem(1);
margin-left: toRem(1);
}
.photo-list {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
height: 100%;
width: 100%;
padding: 0;
}
.photo-item {
width: calc(33% - #{toRem(2)});
height: fit-content;
margin: toRem(1);
border-radius: toRem(0.5);
background-color: var(--grey);
}
.no-photo {
@include text(s-regular);
text-align: center;
margin-top: toRem(10);
color: var(--grey-dark);
}
.entry-pagination {
margin-top: toRem(2);
width: 100%;
display: flex;
justify-content: center;
}
@media (max-width: toRem(102.4)) {
.photo-item {
width: calc(50% - #{toRem(2)});
}
}
@media (max-width: toRem(76.8)) {
.delete-all {
text-align: left;
}
.wrapper-select {
flex-direction: column;
align-items: initial;
}
.wrapper-photo-selected:nth-child(2) {
margin-top: toRem(0.5);
}
.photo-selected-separator {
display: none;
}
.entry-pagination {
margin-top: toRem(0.5);
margin-bottom: toRem(1);
}
.photo-list {
padding-right: toRem(2);
}
.photo-item {
width: 100%;
margin-right: 0;
}
}
@media (max-width: toRem(50)) {
.entry-pagination {
margin-top: toRem(1);
}
}
</style>

View File

@@ -0,0 +1,118 @@
<template>
<form class="wrapper-sort" @submit.prevent="triggerSort">
<h2 class="sort-title">
{{ $t('pages.sequence.sort_panel_title') }}
</h2>
<span class="sort-subtitle">
{{ $t('pages.sequence.sort_panel_settings') }}
</span>
<div class="wrapper-checkboxs">
<div class="checkbox-item">
<InputRadio
:value="sortValue"
:label="$t('pages.sequence.sort_panel_check_gps')"
name="sort"
id="gpsdate"
@trigger="triggerInputCheck"
/>
</div>
<div class="checkbox-item">
<InputRadio
:value="sortValue"
:label="$t('pages.sequence.sort_panel_check_file')"
name="sort"
id="filedate"
@trigger="triggerInputCheck"
/>
</div>
<div class="checkbox-item">
<InputRadio
:value="sortValue"
:label="$t('pages.sequence.sort_panel_check_name')"
name="sort"
id="filename"
@trigger="triggerInputCheck"
/>
</div>
</div>
<span class="sort-subtitle">
{{ $t('pages.sequence.sort_panel_settings_order') }}
</span>
<div class="wrapper-checkboxs">
<InputSwitch @trigger="triggerInputSwitch" :increased="increaseChecked" />
</div>
<Button
look="button--blue"
type="submit"
:text="$t('pages.sequence.orientation_panel_button')"
:disabled="sortValue.length === 0"
/>
</form>
</template>
<script setup lang="ts">
import { watchEffect, ref } from 'vue'
import InputRadio from '@/components/InputRadio.vue'
import InputSwitch from '@/components/InputSwitch.vue'
import Button from '@/components/Button.vue'
const props = defineProps({
sequenceSorted: { type: String, default: null }
})
const emit = defineEmits<{
(e: 'triggerSort', value: string): void
}>()
let sortValue = ref<string>('')
let increaseChecked = ref<boolean>(true)
watchEffect(() => {
if (props.sequenceSorted) {
const filtersType = ['gpsdate', 'filedate', 'filename']
const filtersValue = ['+', '-']
filtersType.map((e: string) => {
if (props.sequenceSorted.includes(e)) sortValue.value = e
})
filtersValue.map((e: string) => {
if (props.sequenceSorted.includes(e) && e === '+') {
increaseChecked.value = true
}
if (props.sequenceSorted.includes(e) && e === '-') {
increaseChecked.value = false
}
})
}
})
function triggerInputSwitch(value: { isIncreaseChecked: boolean }): void {
increaseChecked.value = value.isIncreaseChecked
}
function triggerInputCheck(value: string): void {
sortValue.value = value
}
function triggerSort() {
const value = increaseChecked.value
? `+${sortValue.value}`
: `-${sortValue.value}`
emit('triggerSort', value)
}
</script>
<style scoped lang="scss">
.sort-title {
@include text(h4);
color: var(--blue-dark);
margin-bottom: toRem(2);
}
.sort-subtitle {
color: var(--grey-semi-dark);
}
.wrapper-checkboxs {
display: flex;
flex-wrap: wrap;
margin-top: toRem(1.5);
margin-bottom: toRem(2.5);
}
.checkbox-item {
margin-right: toRem(4);
margin-bottom: toRem(1);
}
</style>

View File

@@ -0,0 +1,232 @@
<template>
<div class="wrapper-widget-orientation">
<div
class="wrapper-img-road"
:style="{
transform: `rotate(${roadDegrees}deg)`
}"
></div>
<div class="wrapper-widget">
<div class="wrapper-car">
<div class="wrapper-elements">
<div class="rounded-transparent"></div>
<img
src="@/assets/images/car.svg"
alt=""
:style="{
transform: `rotate(${roadDegrees}deg)`
}"
class="car-img"
/>
<div
:style="{
transform: `rotate(${angle}deg)`
}"
id="rotateWrapper"
class="rotate-wrapper"
>
<div
id="rotate"
@mousedown="mousedown"
@mousemove="handleMouseMove"
@mouseup="mouseup"
class="cursor-img"
>
<button class="arrow-img arrow-img-1" @click="clickAndMove(45)">
<img src="@/assets/images/icon/cursor-arrow.svg" alt="" />
</button>
<button class="arrow-img arrow-img-2" @click="clickAndMove(-45)">
<img src="@/assets/images/icon/cursor-arrow.svg" alt="" />
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watchEffect } from 'vue'
let angleValue = ref<number>(0)
let angle = ref<number>(0)
let prevRotation = ref<number>(0)
let active = ref<boolean>(false)
let rotation = ref<number>(0)
let startAngle = ref<number>(0)
let rotateWrapper = ref<HTMLElement | null>(null)
let rotate = ref<HTMLElement | null>(null)
let center: { x: number; y: number } = { x: 0, y: 0 }
const R2D: number = 180 / Math.PI
const emit = defineEmits<{
(e: 'triggerAngle', value: number): void
}>()
const props = defineProps({
roadDegrees: { type: Number, default: 0 },
seqBruteDeg: { type: Number, default: 0 }
})
watchEffect(() => {
angle.value = Math.round(props.seqBruteDeg)
})
onMounted(() => {
const app = document.getElementById('app')
rotateWrapper.value = document.getElementById('rotateWrapper')
rotate.value = document.getElementById('rotate')
if (app) app.addEventListener('mouseup', () => (active.value = false))
})
function mousedown(e: MouseEvent): void {
e.preventDefault()
if (!rotateWrapper.value) return
const bb = rotateWrapper.value.getBoundingClientRect()
const { top: t, left: l, height: h, width: w } = bb
center = { x: l + w / 2, y: t + h / 2 }
let x = e.clientX - center.x
let y = e.clientY - center.y
startAngle.value = R2D * Math.atan2(y, x)
active.value = true
}
function handleMouseMove(e: MouseEvent): void {
e.preventDefault()
if (!active.value || !rotateWrapper.value) return
const x = e.clientX - center.x
const y = e.clientY - center.y
const d = R2D * Math.atan2(y, x)
rotation.value = d - startAngle.value
const calc = angle.value + rotation.value
rotateWrapper.value.style.transform = `rotate(${calc}deg)`
}
function mouseup(): void {
if (!active.value || !rotate.value) return
angle.value += Math.round(rotation.value)
if (rotation.value !== prevRotation.value) {
prevRotation.value = rotation.value
angleValue.value = angle.value
if (angleValue.value !== 0) {
emit('triggerAngle', modulo180(angle.value, props.roadDegrees))
}
}
active.value = false
}
function clickAndMove(value: number): void {
const moduloAngle = modulo180(angle.value, Math.round(props.roadDegrees))
if (moduloAngle % 45 === 0) {
return emit('triggerAngle', moduloAngle + value)
}
let closestMultiple = Math.ceil(moduloAngle / 45) * value
return emit('triggerAngle', closestMultiple)
}
function modulo180(value: number, roadDegrees: number): number {
let moduloAngle = (value - roadDegrees) % 360
if (moduloAngle < -180) moduloAngle += 360
if (moduloAngle > 180) moduloAngle -= 360
return Math.round(moduloAngle)
}
</script>
<style scoped lang="scss">
.wrapper-widget-orientation {
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
height: toRem(40);
width: 100%;
border-radius: toRem(1);
}
.wrapper-img-road {
background-image: url('@/assets/images/road.svg');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
height: 210%;
width: 250%;
}
.wrapper-widget {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.wrapper-car {
height: toRem(40);
width: toRem(40);
display: flex;
justify-content: center;
position: relative;
}
.wrapper-elements {
width: 100%;
height: 100%;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.rotate-wrapper {
width: 100%;
height: 100%;
border-radius: 50%;
transform: rotate(0);
background-color: transparent;
display: flex;
justify-content: center;
position: relative;
z-index: 0;
.cursor-img {
background-image: url('@/assets/images/cursor.svg');
content: '';
display: block;
position: absolute;
left: toRem(2);
right: 0;
top: 0;
margin: auto;
height: 50%;
width: 74%;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
cursor: move;
}
}
.arrow-img {
position: absolute;
border: none;
background-color: transparent;
height: toRem(5);
width: toRem(5);
padding: 0;
img {
height: 100%;
&:hover {
opacity: 0.8;
}
}
}
.arrow-img-1 {
right: toRem(4);
top: toRem(6);
}
.arrow-img-2 {
left: toRem(3.2);
bottom: toRem(10.5);
transform: rotate(90deg);
}
.car-img {
position: absolute;
height: 45%;
z-index: 1;
pointer-events: none;
}
.rounded-transparent {
background-color: rgba(white, 0.4);
height: toRem(25);
width: toRem(25);
position: absolute;
border-radius: 50%;
}
</style>

View File

@@ -37,7 +37,10 @@
"pages": {
"home": {
"report_mail": "?subject=⚠️ Report on picture {picId}&body=HEllo, %0D%0A%0D%0A Problem on image (keep type of problem reported) : %0D%0A%0D%0A %0D%0A%0D%0A inappropriate content / lack of blurring on an element to be anonymized or blurred for security reasons / overblurring (too much blurring) %0D%0A%0D%0A Link to affected photo : {link} %0D%0A%0D%0A Details of affected elements (especially for blurring problems - what should be blurred or unblurred?) :",
"report_button_text": "Report this picture"
"report_button_text": "Report this picture",
"sequence_title": "See the séquence",
"open_fullscreen": "Fullscreen mode",
"close_fullscreen": "Normal mode"
},
"settings": {
"title": "My tokens",
@@ -47,12 +50,31 @@
"sequence_published": "Published",
"sequence_waiting": "Still processing",
"sequence_hidden": "Hidden",
"sequence_form_title": "Edit the title",
"hide_sequence_tooltip": "Hide this sequences",
"back_button": "Back to my sequence list",
"delete_sequence_tooltip": "Permanently delete this sequence",
"hide_photo_tooltip": "Hide selected pictures",
"delete_photo_tooltip": "Permanently delete selected pictures",
"confirm_pictures_dialog": "⚠️ Selected photos will be permanently deleted",
"confirm_sequence_dialog": "⚠️ This sequence will be permanently deleted",
"conf_pic_msg": "⚠️ Selected photos will be permanently deleted",
"conf_sequence_msg": "⚠️ This sequence will be permanently deleted",
"button_panel_photos": "Manage pictures",
"button_panel_orientation": "Set orientation",
"button_panel_sort": "Sort sequence",
"orientation_panel_title": "Adjusting the orientation of all photos in the sequence",
"orientation_panel_tooltip": "Drag the blue box in the desired direction\"",
"orientation_input_label": "or change the angle here",
"orientation_input_placeholder": "Value between -180 and 180",
"orientation_input_error_value": "Value must be between -180 and 180",
"orientation_panel_button": "Validate position",
"sort_panel_title": "Sequence sort setting",
"sort_panel_settings": "Sort sequence by:",
"sort_panel_settings_order": "Order :",
"sort_panel_settings_order_increase": "Ascending",
"sort_panel_settings_order_decrease": "Decreasing",
"sort_panel_check_gps": "GPS Date",
"sort_panel_check_file": "File date",
"sort_panel_check_name": "File name",
"created": "Uploaded :",
"taken": "Shot on :",
"duration": "Duration :",
@@ -75,10 +97,24 @@
},
"sequences": {
"title": "My sequences",
"filter_date_upload_title": "Filter by upload date",
"filter_date_title": "Filter by shooting date :",
"radio_date_placeholder": "03/01/2024",
"radio_datetime_placeholder": "03/01/2024 12:00 AM",
"radio_date": "date",
"hide_button": "Hide",
"show_button": "Show",
"delete_button": "Delete",
"filter_date_reset_button": "Reset",
"filter_date_close_button": "Close",
"no_sequence_found": "No sequence found",
"sequence_name": "Name",
"sequence_photos": "Photos",
"sequence_date": "Shot on",
"sequence_creation": "Upload",
"sequence_creation_tooltip": "Filter by uploaded date",
"sequence_date_tooltip": "Filter by shooting date",
"filter_bbox_button": "Search on this area",
"sequence_status": "Status",
"sequence_published": "Published",
"sequence_waiting": "Still processing",
@@ -138,6 +174,8 @@
"text_import": "Upload your jpg files here. Each picture or series of pictures constitutes a \"sequence\". You can then find them in the \"my pictures\" section and choose to hide, show or delete them.",
"subtitle_process": "Upload processing",
"uploading_process": "Upload in progress...",
"uploading_cancel": "Cancel sending photos",
"cancel_message": "⚠️ Please note, the download will be interrupted if you validate and the sequence will be deleted.",
"sequence_title": "Sequence ",
"import": "Uploads",
"upload_pending": "Upload in progress...",

View File

@@ -37,7 +37,10 @@
"pages": {
"home": {
"report_mail": "?subject=⚠️ Signalement sur l`image {picId}&body=Bonjour, %0D%0A%0D%0A Problème sur l`image (garder le type de problème signalé) : %0D%0A%0D%0A contenu inapproprié / absence de floutage sur un élément à anonymiser ou flouter pour des raisons de sécurité /surfloutage (floutage en trop) %0D%0A%0D%0A Lien vers la photo concernée : {link} %0D%0A%0D%0A Précision sur les éléments concernés (en particulier pour les problèmes de floutage - que faut-il flouter ou déflouter?) :",
"report_button_text": "Signaler la photo"
"report_button_text": "Signaler la photo",
"sequence_title": "Voir la séquence",
"open_fullscreen": "Mode plein écran",
"close_fullscreen": "Mode normal"
},
"settings": {
"title": "Mes Tokens",
@@ -47,12 +50,33 @@
"sequence_published": "Publiée",
"sequence_waiting": "En cours de publication",
"sequence_hidden": "Masquée",
"sequence_form_title": "Modifier le titre",
"hide_sequence_tooltip": "Masque la séquence sur la carte",
"back_button": "Retourner à la liste de mes séquences",
"delete_sequence_tooltip": "Supprime définitivement la séquence",
"hide_photo_tooltip": "Masque les photos sur la carte",
"delete_photo_tooltip": "Supprime définitivement les photos",
"confirm_pictures_dialog": "⚠️ Les photos sélectionnées vont être définitivement supprimées",
"confirm_sequence_dialog": "⚠️ La séquence va être définitivement supprimée",
"conf_pic_msg": "⚠️ Les photos sélectionnées vont être définitivement supprimées",
"conf_sequence_msg": "⚠️ La séquence va être définitivement supprimée",
"button_panel_photos": "Gérer les photos",
"button_panel_orientation": "Régler l'orientation",
"button_panel_sort": "Trier la séquence",
"orientation_panel_title": "Définir l'orientation de la caméra sur le véhicule",
"orientation_panel_tooltip": "Faites glisser la zone bleu dans la direction souhaitée",
"orientation_input_label": "ou modifiez l'angle ici",
"orientation_input_placeholder": "Valeur entre -180 et 180",
"orientation_input_error_value": "La valeur doit être entre -180 et 180",
"orientation_panel_button": "Valider la position",
"orientation_updated": "L'orientation a bien été modifiée",
"sort_updated": "La séquence a bien triée",
"sort_panel_title": "Réglage du tri de la séquence",
"sort_panel_settings": "Trier la séquence par :",
"sort_panel_settings_order": "Ordre :",
"sort_panel_settings_order_increase": "Croissant",
"sort_panel_settings_order_decrease": "Décroissant",
"sort_panel_check_gps": "Date du GPS",
"sort_panel_check_file": "Date de la caméra",
"sort_panel_check_name": "Nom du fichier",
"created": "Versement :",
"taken": "Prise de vue :",
"duration": "Durée :",
@@ -75,10 +99,24 @@
},
"sequences": {
"title": "Mes séquences de photos",
"filter_date_upload_title": "Filtrer par date de versement :",
"filter_date_title": "Filtrer par date de prise de vue :",
"radio_date_placeholder": "2024-01-03",
"radio_date": "date",
"hide_button": "Masquer",
"show_button": "Afficher",
"delete_button": "Supprimer",
"filter_date_reset_button": "Réinitialiser",
"filter_date_close_button": "Fermer",
"no_sequence_found": "Aucune séquence trouvée",
"sequence_name": "Nom",
"sequence_photos": "Photos",
"sequence_date": "Prise de vue",
"sequence_creation": "Versement",
"sequence_creation_tooltip": "Filtre par date de versement",
"sequence_date_tooltip": "Filtre par date de prise de vue",
"reset_filter_button": "Réinitialiser les filtres",
"filter_bbox_button": "Chercher dans cette zone",
"sequence_status": "Statut",
"sequence_published": "Publiée",
"sequence_waiting": "En cours de publication",
@@ -137,7 +175,9 @@
"description_title_sequence": "Le titre d'une séquence est par défaut la date du jour. Vous pouvez, si vous le souhaitez le modifier ci-dessous.",
"text_import": "Déposez ici vos fichiers jpg. Chaque image ou série dimages constitue une « séquence ». Vous pourrez ensuite les retrouver dans la section « mes images » et choisir de les masquer, les afficher ou les supprimer.",
"subtitle_process": "Traitements de l'import",
"uploading_process": "Téléchargement en cours...",
"uploading_process": "Envoi en cours...",
"uploading_cancel": "Annuler l'envoi des photos",
"cancel_message": "⚠️ Attention, le téléchargement sera interrompu si vous validez et la séquence sera supprimée.",
"sequence_title": "Séquence du ",
"import": "Imports",
"upload_pending": "Transfert en cours...",
@@ -148,7 +188,7 @@
"edit_title_tooltip": "Modifier le titre de la séquence",
"edit_placeholder_input": "Modifier le titre de la séquence",
"ok_button": "Valider",
"pictures_error": "{count} image n'a pas pu être chargée| {count} image n'ont pas pu être chargées",
"pictures_error": "{count} image n'a pas pu être chargée| {count} images n'ont pas pu être chargées",
"sequence_loading_information": "Une fois chargée, la séquence sera en traitement et accessible sur Panoramax dans les prochaines minutes.",
"sequence_loaded_information": "La séquence est chargée et est en cours de traitement. Elle sera accessible sur Panoramax dans quelques minutes.",
"leave_message": "⚠️ Attention, le téléchargement sera interrompu si vous quittez la page avant la fin.",

222
src/locales/hu.json Normal file
View File

@@ -0,0 +1,222 @@
{
"general": {
"title": "Panoramax-példány",
"meta": {
"title": "Panoramax-példány",
"description": "Panoramax, szabad alternatíva a világ fotós feltérképezéséhez"
},
"header": {
"login_text": "Kapcsolódás",
"register_text": "Regisztráció",
"contribute_text": "Miért működjön közre?",
"my_account": "Saját fiók",
"upload_text": "+ Fényképek megosztása",
"sequences_text": "Saját fényképek",
"alt_logo": "A példány logója",
"alt_photos": "Képek ikon",
"alt_information": "Felhasználó ikon",
"alt_settings": "Paraméterek ikon",
"alt_logout": "Kijelentkezés ikon",
"title": "Panoramax",
"beta_text": "Béta verzió",
"logout_text": "Kijelentkezés",
"my_information_text": "Saját adatok",
"my_settings_text": "Saját beállítások",
"burger_menu_aria_label_open": "A menü megjelenítése",
"burger_menu_aria_label_closed": "A menü bezárása"
},
"footer": {
"panoramax_site": "A Panoramax felfedezése",
"information_gitlab": "Forráskód megjelenítése",
"gitlab_logo": "Gitlab logó",
"ay11_text": "Akadálymentesítés: nem felel meg"
},
"error_text": "Hiba történt",
"success_text": "Sikeres frissítés"
},
"pages": {
"home": {
"report_mail": "?subject=⚠️ Report on picture {picId}&body=Hello, %0D%0A%0D%0A Problem on image (keep type of problem reported) : %0D%0A%0D%0A %0D%0A%0D%0A inappropriate content / lack of blurring on an element to be anonymized or blurred for security reasons / overblurring (too much blurring) %0D%0A%0D%0A Link to affected photo : {link} %0D%0A%0D%0A Details of affected elements (especially for blurring problems - what should be blurred or unblurred?) :",
"report_button_text": "Fénykép jelentése",
"sequence_title": "lásd a sorrendet",
"open_fullscreen": "Teljes képernyős mód",
"close_fullscreen": "Normál mód"
},
"settings": {
"title": "Saját tokenek",
"setting_tooltip": "A token megjelenítése vagy elrejtése"
},
"sequence": {
"sequence_published": "Közzétéve",
"sequence_waiting": "Feldolgozás alatt",
"sequence_hidden": "Rejtett",
"sequence_form_title": "Szerkessze a címet",
"hide_sequence_tooltip": "A sorozat elrejtése",
"back_button": "Vissza a sorozatlistámhoz",
"delete_sequence_tooltip": "A sorozat végleges törlése",
"hide_photo_tooltip": "A kiválasztott fényképek elrejtése",
"delete_photo_tooltip": "A kiválasztottt fényképek végleges törlése",
"conf_pic_msg": "⚠️ A kiválasztott fényképek véglegesen elvesznek",
"conf_sequence_msg": "⚠️ A kiválasztott sorozat véglegesen elvész",
"button_panel_photos": "Fényképek kezelése",
"button_panel_orientation": "Tájolás beállítása",
"button_panel_sort": "Rendezési sorrend",
"orientation_panel_title": "Az összes kép tájolásának beállítása a sorozatban",
"orientation_panel_tooltip": "Húzza a kék dobozt a kívánt irányba",
"orientation_input_label": "vagy módosítsa a szöget itt",
"orientation_input_placeholder": "-180 és 180 közötti érték",
"orientation_input_error_value": "Az értéknek -180 és 180 között kell lennie",
"orientation_panel_button": "Pozíció ellenőrzése",
"sort_panel_title": "Szekvenciás rendezés beállítása",
"sort_panel_settings": "Sorrend rendezése:",
"sort_panel_settings_order": "Rendelés :",
"sort_panel_settings_order_increase": "Növekvő",
"sort_panel_settings_order_decrease": "Csökkenő",
"sort_panel_check_gps": "GPS dátum",
"sort_panel_check_file": "Fájl dátuma",
"sort_panel_check_name": "Fájlnév",
"created": "Feltöltés ideje:",
"taken": "Elkészítés ideje:",
"duration": "Hossz:",
"duration_begin": "Kezdet:",
"duration_end": "Vég:",
"camera": "Kamera:",
"button_delete": "Törlés",
"button_disable": "Elrejtés",
"button_enable": "Megjelenítés",
"picture_selected": "{count} fénykép kiválasztva| {count} fénykép kiválasztva",
"hours": "{count} óra| {count} óra",
"minutes": "{count} perc| {count} perc",
"seconds": "{count} másodperc| {count} másodperc",
"select_text": "Kiválasztás",
"unselect_text": "Kiválasztás törlése",
"select_shift_text": "Több elemet a Shift segítségével választhat ki",
"waiting_process": "A fénykép feldolgozás alatt áll",
"broken": "Fénykép-feldolgozási hiba",
"no_image": "Nincsenek fényképek ebben a sorozatban"
},
"sequences": {
"title": "Saját fényképsorozatok",
"filter_date_upload_title": "Szűrés feltöltés dátuma szerint :",
"filter_date_title": "Szűrés forgatás dátuma szerint :",
"radio_date_placeholder": "03/01/2024",
"radio_datetime_placeholder": "03/01/2024 12:00 AM",
"radio_date": "dátum",
"hide_button": "Elrejt",
"show_button": "Előadás",
"delete_button": "Töröl",
"filter_date_reset_button": "Visszaállítás",
"filter_date_close_button": "Bezárás",
"no_sequence_found": "Nem található felvétel",
"sequence_name": "Név",
"sequence_photos": "Fényképek",
"sequence_date": "Elkészítés ideje",
"sequence_creation": "Feltöltés ideje",
"sequence_creation_tooltip": "Szűrés feltöltés dátuma szerint",
"sequence_date_tooltip": "Szűrés forgatás dátuma szerint",
"filter_bbox_button": "Keresés ezen a területen",
"sequence_status": "Állapot",
"sequence_published": "Közzétéve",
"sequence_waiting": "Feldolgozás alatt",
"sequence_hidden": "Rejtett",
"no_sequences_text": "Még nincsenek közzétett fényképei \uD83D\uDE22",
"button_upload": "Fényképek feltöltése",
"sequence_deleted": "A sorozat törlésre került"
},
"share_pictures": {
"title": "Miért működjön közre a Panoramaxban?",
"description": "A Panoramaxban való közreműködés azt jelenti, hogy részt vesz egy közös, független, szabad és újrafelhasználható digitális erőforrás fejlesztésében. A Panoramaxon található minden georeferált fénykép bárki által használható, számos célra, például egy önkormányzat megtekintheti az utai állapotát, vagy egy távközlési vállalat felkészülhet a beavatkozásaira.\n\nMinden közreműködő beküldheti a saját képsorozatait, módosíthatja és megnézheti azokat, ahogyan ezt teheti a közösség más tagjai által feltöltött képekkel is. Az arcok és rendszámtáblák kötelező kitakarását maga a platform automatizálja.",
"alt_img_map": "Illusztráció egy nőről, aki egy térképet néz a földrajzi helymeghatározással rendelkező okostelefonján",
"card_photo1": "Közútról látható helyek",
"card_photo2": "Közzétett fényképek 360°-os vagy más formátumban",
"card_photo3": "Könnyen újrafelhasználható fényképek",
"card_photo4": "Képek gyors és egyszerű megosztása",
"card_alt_photo1": "Egy épületet tartalmazó kép",
"card_alt_photo2": "Egy 360°-ot megjelenítő kép",
"card_alt_photo3": "Egy kép egy térképről mutatóval",
"card_alt_photo4": "Egy mutatót ábrázoló kép",
"card_description1": "Minden közútról készült kép elfogadható, ha az georeferált és a földről készült.",
"card_description2": "A 360°-os képek nem kötelezők: az okostelefonnal készült képek is megfelelők. Az előfeltételek a dátum, a helyszín és a jpg formátum használata.",
"card_description3": "Minden fénykép fiók nélkül is könnyedén elérhető és felhasználható: a weboldalon vagy egy szabványos API-n keresztül (STAC szabvány).",
"card_description4": "Számos eszköz elérhető a közreműködések lehetővé tételéhez, köztük egy parancssoros és egy webes felület is.",
"upload_subtitle": "Töltse fel egyszerűen a fényképeit",
"upload_illustration_alt": "Online képfeltöltést ábrázoló illusztráció",
"upload_description": "A Panoramax webalkalmazása lehetővé teszi, hogy egy gombnyomással feltöltse az összes fényképét JPG formátumban. Programozói készségek nem szükségesek. Sok kép esetén viszont a parancssoros eszköz használatát javasoljuk.",
"upload_button": "+ Képek feltöltése",
"command_line_subtitle": "Parancssoros eszköz",
"comment_install": "A geovisio parancssoros eszköz telepítése",
"comment_upload": "A képfeltöltési parancs indítása a kiválasztott mappán",
"description_terminal": "<a href='https://gitlab.com/geovisio/cli' target='_blank' style='color:black'>A parancssor</a> lehetővé teszi, hogy nagy számú képet osszon meg. A folyamat egyszerű, és <a target='_blank' href='https://www.python.org/downloads/' style='color:black'>Pythont (3.8-as vagy újabb verzió)</a> igényli.\n\nAz importálás előtt az eszköz bekéri a bejelentkezési adatait. Amint a képek felöltésre kerültek, azok közzététele előtt feldolgozási idő szükséges.",
"terminal_install": "pip install geovisio_cli",
"terminal_text": "geovisio upload --api-url {webcím} <FÉNYKÉPMAPPA>",
"button_copy": "Másolás",
"information_subtitle": "Itt a fényképek mindenki számára elérhetők: ",
"information_text1": "Automatikusan kitakarva, a törvényi előírásoknak megfelelően.",
"information_text2": "A feltöltött képek a következő alatt lesznek közzétéve: {word}",
"information_text3": "Az eredeti formátumban és felbontásban, számos újrafeldolgozáshoz.",
"information_about_title": "Hozzá kell férnie a fényképeihez?",
"information_about_description": "Az API elérhető az összes metaadat és kép letöltéséhez. <a href='{docLink}' target='_blank' style='color:#0a1f69'>\nTudjon meg többet itt.</a>\nAz adatok <a href='{docTiles}' target='_blank' style='color:#0a1f69'>vektorcsempék</a> formájában is megjelennek.",
"doc_subtitle": "Segítségre van szüksége a Panoramaxban történő közreműködéshez?",
"doc_description": "A Panoramax dokumentációja elérhető tőlünk, oktatóanyagokat pedig a geo-commons fórumán találhat.",
"doc_button": "A dokumentáció megtekintése",
"doc_illustration_alt": "Illusztráció egy karakterről dokumentumokkal"
},
"upload": {
"title": "Közreműködés a Panoramax projektben",
"description": "Nagy számú fényképhez a parancssoros eszköz jobban megfelelő.",
"know_more_button": "További tudnivalók",
"input_label": "Húzza ide a képeket, vagy kattintson a",
"import_word": "feltöltésre",
"import_type": "Csak JPEG formátum",
"subtitle_import": "Képfeltöltés",
"title_sequence": "Sorozat címe",
"description_title_sequence": "Alapértelmezés szerint a sorozat cím a nap dátuma lesz. Ha akarja, itt szerkesztheti a címet.",
"text_import": "Ide töltse fel a JPG-fájljait. Minden kép vagy képsorozat egy „sorozatot” alkot. Megtalálhatja azokat a „saját fényképek” szakaszban, és elrejtheti, megjelenítheti vagy törölheti azokat.",
"subtitle_process": "Feltöltés feldolgozása",
"uploading_process": "Feltöltés folyamatban…",
"uploading_cancel": "Fényképek küldésének megszakítása",
"cancel_message": "⚠️ Felhívjuk figyelmét, hogy a letöltés megszakad, ha érvényesíti, és a sorozat törlődik.",
"sequence_title": "Sorozat ",
"import": "Feltöltések",
"upload_pending": "Feltöltés folyamatban…",
"images_count_text": "Feltöltött képek",
"no_img_text": "még nem volt képfeltöltés",
"upload_done": "A sorozat feltöltése elkészült",
"sequence_link": "A sorozat megjelenítése",
"edit_title_tooltip": "A sorozat címének szerkesztése",
"edit_placeholder_input": "A sorozat címének szerkesztése",
"ok_button": "OK",
"pictures_error": "{count} kép feltöltése nem sikerült| {count} kép feltöltése nem sikerült",
"sequence_loading_information": "Amint feltöltötte, a sorozat feldolgozásra, majd közzétételre került a Panoramaxon (általában néhány perc múlva).",
"sequence_loaded_information": "A sorozatok fel lettek töltve, és feldolgozás alatt vannak. Néhány perc múlva nyilvánosan elérhetőnek kellene lenniük a Panoramaxon.",
"leave_message": "⚠️ FIGYELMEZTETÉS, a feltöltés meg fog szakadni, ha a végezte előtt hagyja el a lapot.",
"error_button": "Hibák megjelenítése",
"modal_error_title": "A hibában érintett képek"
},
"ay11": {
"title": "Déclaration daccessibilité",
"date": "Établie le 18 septembre 2023.",
"introduction": "IGN sengage à rendre son service accessible, conformément à larticle 47 de la loi n° 2005-102 du 11 février 2005.\n Cette déclaration daccessibilité sapplique à Panoramax Instance IGN : https://panoramax.ign.fr",
"subtitle_conformity": "État de conformité",
"conformity_text": "Panoramax Instance IGN est non conforme avec le ",
"conformity_text2": "Le site na encore pas été audité.",
"subtitle_conformity2": "Contenus non accessibles",
"subtitle_increase": "Amélioration et contact",
"increase_text": "Si vous narrivez pas à accéder à un contenu ou à un service, vous pouvez\n contacter le responsable de Panoramax Instance IGN pour être orienté vers une alternative accessible ou obtenir le contenu sous une autre forme.",
"phone": "Téléphone : +33 14 398 84 61",
"email_text": "E-mail :",
"email": "signalement.ign@panoramax.fr",
"address": "Adresse : IGN, Saint-Mandé",
"increase_info": "Nous essayons de répondre dans les 5 jours ouvrés.",
"subtitle_to_do": "Voie de recours",
"to_do_text": "Cette procédure est à utiliser dans le cas suivant : vous avez signalé au responsable du site internet un défaut daccessibilité qui vous\n empêche daccéder à un contenu ou à un des services du portail et vous navez pas obtenu de réponse satisfaisante. \n vous pouvez :",
"write_message": "Écrire un message au",
"defenseur_droits": "Défenseur des droits",
"contact": "Contacter",
"contact_text": "le délégué du Défenseur des droits dans votre région",
"send_letter": "Envoyer un courrier par la poste (gratuit, ne pas mettre de\n timbre):\n Défenseur des droits\n Libre réponse 71120 75342 Paris CEDEX 07",
"end": "Cette déclaration daccessibilité a été créé le\n 18 septembre 2023 grâce au",
"generator_betagouv": "Générateur de Déclaration dAccessibilité de BetaGouv"
}
}
}

View File

@@ -1,22 +1,33 @@
import { createApp } from 'vue'
import { createI18n } from 'vue-i18n'
import VueMatomo from 'vue-matomo'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import { globalCookiesConfig } from 'vue3-cookies'
import { createMetaManager } from 'vue-meta'
import { VueDraggableResizable } from 'vue-draggable-resizable-vue3'
import VCalendar from 'v-calendar'
import 'v-calendar/style.css'
import { pinia } from './store'
import fr from './locales/fr.json'
import en from './locales/en.json'
import hu from './locales/hu.json'
import './assets/main.scss'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-icons/font/bootstrap-icons.css'
import 'geovisio/build/index.css'
declare global {
interface Window {
_paq: any[]
}
}
axios.defaults.baseURL = import.meta.env.VITE_API_URL
axios.defaults.withCredentials = true
const matomoHost = import.meta.env.VITE_MATOMO_HOST
const matomoSiteId = import.meta.env.VITE_MATOMO_SITE_ID
const matomoExist = matomoHost && matomoSiteId
const i18n = createI18n({
locale: navigator.language.split('-')[0],
@@ -26,20 +37,26 @@ const i18n = createI18n({
legacy: false,
messages: {
fr,
en
en,
hu
}
})
globalCookiesConfig({
expireTimes: '7d'
})
const app = createApp(App)
app.use(pinia)
app.use(i18n)
app.use(router)
app.use(VueAxios, axios)
app.provide('axios', app.config.globalProperties.axios)
app.use(createMetaManager())
app.use(VueDraggableResizable)
app.use(VCalendar)
if (matomoExist) {
app.use(VueMatomo, {
host: matomoHost,
siteId: matomoExist
})
}
app.mount('#app')
if (matomoExist) {
window._paq.push(['trackPageView']) // Pour suivre les visites sur vos pages
}

View File

@@ -1,12 +1,11 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useCookies } from 'vue3-cookies'
import type {
RouteRecordRaw,
NavigationGuardNext,
RouteLocationNormalized
} from 'vue-router'
import axios from 'axios'
import { getAuthRoute } from '@/utils/auth'
import { getAuthRoute, hasASessionCookieDecoded } from '@/utils/auth'
import HomeView from '../views/HomeView.vue'
import MyInformationView from '../views/MyInformationView.vue'
import MySettingsView from '../views/MySettingsView.vue'
@@ -15,7 +14,6 @@ import MySequenceView from '../views/MySequenceView.vue'
import SharePicturesView from '../views/SharePicturesView.vue'
import UploadPicturesView from '../views/UploadPicturesView.vue'
import Ay11View from '../views/Ay11View.vue'
const { cookies } = useCookies()
let routes: Array<RouteRecordRaw> = [
{
path: '/',
@@ -77,8 +75,9 @@ router.beforeResolve(
to.name === 'upload-pictures'
if (siteLoggedRoutes) {
if (!isSiteLogged()) goToLoginPage(to.path)
else return next()
if (!isSiteLogged()) {
goToLoginPage(to.path)
} else return next()
}
if (to.name === 'my-information') {
try {
@@ -95,7 +94,8 @@ router.beforeResolve(
)
function isSiteLogged(): boolean {
return !!cookies.get('user_id')
const cookie = hasASessionCookieDecoded()
return !!(cookie && cookie.account)
}
async function isKeycloakLogout(): Promise<{ status: number }> {

View File

@@ -3,7 +3,8 @@ import { defineStore } from 'pinia'
export const useSequenceStore = defineStore('sequence', {
state: () => ({
toastText: <string>'',
toastLook: <string>''
toastLook: <string>'',
picId: <string>''
}),
actions: {
addToastText(text: string, look: string): void {
@@ -12,6 +13,9 @@ export const useSequenceStore = defineStore('sequence', {
setTimeout(() => {
this.toastText = ''
}, 3000)
},
addSequence(id: string): void {
this.picId = id
}
}
})

View File

@@ -96,7 +96,9 @@ describe('Template', () => {
})
describe('When the user is logged', () => {
it('should render the component with good wording keys', async () => {
vi.spyOn(useCookies().cookies, 'get').mockReturnValue('user_id=id')
vi.spyOn(useCookies().cookies, 'get').mockReturnValue(
'.eJw9y0EKgzAQQNG7zLoDJpmYxMuUySRDra0pooUi3r3SRZcf_tuBRdo2rzDsMBYYgFxRytljkeyQrK0YVT16m6OhUlIihgvM_Kznfa88n9V4W2_XnzcuiqgmDBQMUtYec00WO3XqAndd7OUvXkt7j6Uup5vqRx6NJziOL8SPLNU.ZVy19Q.4DkVxu-LSF11uREkn6YIwHbn_0U'
)
import.meta.env.VITE_API_URL = 'api-url/'
const wrapper = shallowMount(Header, {
@@ -116,7 +118,7 @@ describe('Template', () => {
expect(wrapper.html()).contains('general.header.upload_text')
expect(wrapper.html()).contains('data-test="link-logged-upload"')
expect(wrapper.html()).contains('<account-button')
expect(wrapper.html()).contains('username="UI"')
expect(wrapper.html()).contains('username="J"')
})
})
})

View File

@@ -11,7 +11,6 @@ describe('Template', () => {
}
})
expect(wrapper.vm.text).toBe(null)
expect(wrapper.vm.title).toBe(null)
expect(wrapper.vm.look).toBe('')
})
test('should have all the props filled', () => {
@@ -21,11 +20,9 @@ describe('Template', () => {
},
props: {
text: 'my text',
title: 'my title',
look: 'my-look'
}
})
expect(wrapper.html()).contains('my title</h3>')
expect(wrapper.html()).contains('my text</p>')
expect(wrapper.html()).contains('class="information-block my-look"')
})

View File

@@ -26,11 +26,10 @@ describe('Template', () => {
}
}
})
expect(wrapper.vm.uploadErrors).toEqual([])
expect(wrapper.vm.title).toEqual('')
})
it('should render the props filled', async () => {
document.body.innerHTML = '<div id="bs-modal"></div>'
const uploadErrors = [{ message: 'my message', name: 'my name' }]
const wrapper = shallowMount(Modal, {
global: {
plugins: [i18n],
@@ -39,13 +38,12 @@ describe('Template', () => {
}
},
props: {
uploadErrors
title: 'My title'
}
})
expect(wrapper.vm.uploadErrors).toEqual(uploadErrors)
expect(wrapper.html()).contains('my name - ')
expect(wrapper.html()).contains('my message')
expect(wrapper.vm.title).toEqual('My title')
expect(wrapper.html()).contains('My title')
})
})
})

View File

@@ -0,0 +1,74 @@
import { it, describe, expect } from 'vitest'
import { shallowMount } from '@vue/test-utils'
import PanelOrientationManagement from '../../../../components/sequence/PanelOrientationManagement.vue'
import i18n from '../../config'
describe('Template', () => {
describe('Props', () => {
it('should have default props', () => {
const wrapper = shallowMount(PanelOrientationManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
}
})
expect(wrapper.vm.roadDegrees).toBe(0)
expect(wrapper.vm.seqBruteDeg).toBe(0)
})
describe('When the component have props filled', () => {
it('should render the component all the element', () => {
const wrapper = shallowMount(PanelOrientationManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
},
props: {
roadDegrees: 45,
seqBruteDeg: 22
}
})
expect(wrapper.html()).contains(
'pages.sequence.orientation_panel_title'
)
expect(wrapper.html()).contains(
'pages.sequence.orientation_input_label'
)
expect(wrapper.html()).contains(
'pages.sequence.orientation_input_placeholder'
)
expect(wrapper.html()).contains('<widget-orientation')
expect(wrapper.html()).contains('<information-card')
expect(wrapper.html()).contains('<input')
expect(wrapper.html()).contains('<button')
expect(wrapper.html()).contains(
'type="number" min="-180" max="180" text="-23"'
)
})
})
describe('Emit functions', () => {
it('should emit triggerAngle event', async () => {
const wrapper = shallowMount(PanelOrientationManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
},
props: {
roadDegrees: 45,
seqBruteDeg: 22
}
})
const valueToEmit = 22 - 45
await wrapper.vm.triggerAngle(valueToEmit)
expect(wrapper.emitted('triggerAngle')).toHaveLength(1)
expect(wrapper.emitted('triggerAngle')[0]).toEqual([valueToEmit])
})
})
})
})

View File

@@ -0,0 +1,347 @@
import { it, describe, expect } from 'vitest'
import { shallowMount } from '@vue/test-utils'
import PanelPhotosManagement from '../../../../components/sequence/PanelPhotosManagement.vue'
import i18n from '../../config'
import { createPinia } from 'pinia'
const pinia = createPinia()
describe('Template', () => {
describe('Props', () => {
it('should have default props', () => {
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
}
})
expect(wrapper.vm.isSequenceOwner).toBe(false)
expect(wrapper.vm.imagesSelectedHaveDifferentStatus).toBe(false)
expect(wrapper.vm.itemSelected).toBe('')
expect(wrapper.vm.menuHeight).toBe('0')
expect(wrapper.vm.fullImagesToDelete).toStrictEqual([])
expect(wrapper.vm.selfLink).toStrictEqual([])
expect(wrapper.vm.paginationLinks).toStrictEqual([])
expect(wrapper.vm.pictures).toStrictEqual([])
expect(wrapper.vm.picturesToDelete).toStrictEqual([])
expect(wrapper.vm.sequence).toStrictEqual({})
})
describe('When the component have props filled', () => {
it('should render the component with images selected', () => {
const pictures = [
{
assets: { thumb: { href: 'thumbHref' }, hd: { href: 'hdHref' } },
properties: { datetime: new Date(), 'geovisio:status': 'ready' },
id: 'pictureId',
bbox: [1, 2, 3, 4]
}
]
const sequence = [
{
id: 'seqId',
title: 'title',
description: 'descr',
license: 'license',
created: new Date(),
taken: 'taken date',
location: 'location',
imageCount: 4,
duration: 'duration',
camera: 'camera',
cameraModel: 'camera model',
status: 'ready',
providers: [{ name: 'provider', roles: ['role1'] }],
extent: {
temporal: { interval: ['date'] },
spatial: { bbox: ['1', '2'] }
}
}
]
const paginationLinks = [
{
href: 'href',
rel: 'rel',
title: 'title',
type: 'type'
}
]
const selfLink = [
{
href: 'href',
rel: 'self',
title: 'title',
type: 'type'
}
]
const fullImagesToDelete = [
{
assets: { thumb: { href: 'thumbHref' }, hd: { href: 'hdHref' } },
properties: { datetime: new Date(), 'geovisio:status': 'ready' },
id: 'pictureId',
bbox: [1, 2, 3, 4]
}
]
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
},
props: {
isSequenceOwner: true,
imagesSelectedHaveDifferentStatus: true,
itemSelected: 'pictureId',
menuHeight: '10px',
pictures,
picturesToDelete: ['1', '2'],
sequence,
paginationLinks,
selfLink,
fullImagesToDelete
}
})
expect(wrapper.html()).contains('<image-item')
expect(wrapper.html()).contains('selectedonmap="true"')
expect(wrapper.html()).contains('href="thumbHref"')
expect(wrapper.html()).contains('hrefhd="hdHref"')
expect(wrapper.html()).contains('ischecked="false"')
expect(wrapper.html()).contains('isindeterminate="true"')
expect(wrapper.html()).contains('pages.sequence.picture_selected')
expect(wrapper.html()).contains(
'icon="bi bi-eye" disabled="false" isloading="false"'
)
expect(wrapper.html()).contains(
'icon="bi bi-trash" disabled="false" isloading="false"'
)
expect(wrapper.html()).contains('pages.sequence.hide_photo_tooltip')
expect(wrapper.html()).contains('pages.sequence.delete_photo_tooltip')
expect(wrapper.html()).contains('<pagination')
expect(wrapper.html()).contains('selflink="')
})
it('should render the component with no images', () => {
const pictures = []
const sequence = [
{
id: 'seqId',
title: 'title',
description: 'descr',
license: 'license',
created: new Date(),
taken: 'taken date',
location: 'location',
imageCount: 4,
duration: 'duration',
camera: 'camera',
cameraModel: 'camera model',
status: 'ready',
providers: [{ name: 'provider', roles: ['role1'] }],
extent: {
temporal: { interval: ['date'] },
spatial: { bbox: ['1', '2'] }
}
}
]
const paginationLinks = []
const selfLink = [
{
href: 'href',
rel: 'self',
title: 'title',
type: 'type'
}
]
const fullImagesToDelete = []
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
},
props: {
isSequenceOwner: true,
imagesSelectedHaveDifferentStatus: false,
itemSelected: '',
menuHeight: '10px',
pictures,
picturesToDelete: [],
sequence,
paginationLinks,
selfLink,
fullImagesToDelete
}
})
expect(wrapper.html()).contains('class="no-photo"')
expect(wrapper.html()).contains('pages.sequence.no_image')
})
it('should render the component with all the images selected', () => {
const pictures = [
{
assets: { thumb: { href: 'thumbHref' }, hd: { href: 'hdHref' } },
properties: { datetime: new Date(), 'geovisio:status': 'ready' },
id: 'pictureId',
bbox: [1, 2, 3, 4]
}
]
const sequence = [
{
id: 'seqId',
title: 'title',
description: 'descr',
license: 'license',
created: new Date(),
taken: 'taken date',
location: 'location',
imageCount: 4,
duration: 'duration',
camera: 'camera',
cameraModel: 'camera model',
status: 'ready',
providers: [{ name: 'provider', roles: ['role1'] }],
extent: {
temporal: { interval: ['date'] },
spatial: { bbox: ['1', '2'] }
}
}
]
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
},
props: {
isSequenceOwner: true,
pictures,
picturesToDelete: [1],
sequence
}
})
expect(wrapper.html()).contains(
'ischecked="true" isindeterminate="false"></input'
)
})
it('should render the component with images hidden', () => {
const pictures = [
{
assets: { thumb: { href: 'thumbHref' }, hd: { href: 'hdHref' } },
properties: { datetime: new Date(), 'geovisio:status': 'hidden' },
id: 'pictureId',
bbox: [1, 2, 3, 4]
}
]
const sequence = [
{
id: 'seqId',
title: 'title',
description: 'descr',
license: 'license',
created: new Date(),
taken: 'taken date',
location: 'location',
imageCount: 4,
duration: 'duration',
camera: 'camera',
cameraModel: 'camera model',
status: 'ready',
providers: [{ name: 'provider', roles: ['role1'] }],
extent: {
temporal: { interval: ['date'] },
spatial: { bbox: ['1', '2'] }
}
}
]
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
},
props: {
isSequenceOwner: true,
pictures,
picturesToDelete: [],
sequence
}
})
expect(wrapper.html()).contains('status="hidden"></image-item')
})
})
})
describe('Emit functions', () => {
it('should emit triggerInputCheck event', async () => {
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
}
})
await wrapper.vm.triggerInputCheck({
isChecked: true,
isIndeterminate: false
})
expect(wrapper.emitted('triggerInputCheck')).toHaveLength(1)
expect(wrapper.emitted('triggerInputCheck')[0]).toEqual([
{ isChecked: true, isIndeterminate: false }
])
})
it('should emit triggerGoToNextPage event', async () => {
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
}
})
await wrapper.vm.triggerGoToNextPage('nextPage')
expect(wrapper.emitted('triggerGoToNextPage')).toHaveLength(1)
expect(wrapper.emitted('triggerGoToNextPage')[0]).toEqual(['nextPage'])
})
it('should emit triggerSelectImageAndMove event', async () => {
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
}
})
const picture = {
assets: { thumb: { href: 'thumbHref' }, hd: { href: 'hdHref' } },
properties: { datetime: new Date(), 'geovisio:status': 'ready' },
id: 'pictureId',
bbox: [1, 2, 3, 4]
}
await wrapper.vm.triggerSelectImageAndMove(picture)
expect(wrapper.emitted('triggerSelectImageAndMove')).toHaveLength(1)
expect(wrapper.emitted('triggerSelectImageAndMove')[0]).toEqual([picture])
})
it('should emit triggerPatchOrDeleteCollectionItems event', async () => {
const wrapper = shallowMount(PanelPhotosManagement, {
global: {
plugins: [i18n, pinia],
mocks: {
$t: (msg) => msg
}
}
})
await wrapper.vm.triggerPatchOrDeleteCollectionItems('itemToDelete')
expect(
wrapper.emitted('triggerPatchOrDeleteCollectionItems')
).toHaveLength(1)
expect(wrapper.emitted('triggerPatchOrDeleteCollectionItems')[0]).toEqual(
['itemToDelete']
)
})
})
})

View File

@@ -0,0 +1,83 @@
import { it, describe, expect } from 'vitest'
import { shallowMount } from '@vue/test-utils'
import PanelSortManagement from '../../../../components/sequence/PanelSortManagement.vue'
import i18n from '../../config'
describe('Template', () => {
describe('Props', () => {
it('should have default props', () => {
const wrapper = shallowMount(PanelSortManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
}
})
expect(wrapper.vm.sequenceSorted).toBe(null)
})
describe('When the component have props filled', () => {
it('should render the component all the element', () => {
const wrapper = shallowMount(PanelSortManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
}
})
expect(wrapper.html()).contains('pages.sequence.sort_panel_title')
expect(wrapper.html()).contains('pages.sequence.sort_panel_settings')
expect(wrapper.html()).contains(
'name="sort" id="gpsdate" label="pages.sequence.sort_panel_check_gps" value=""'
)
expect(wrapper.html()).contains(
'name="sort" id="filedate" label="pages.sequence.sort_panel_check_file" value=""'
)
expect(wrapper.html()).contains(
'name="sort" id="filename" label="pages.sequence.sort_panel_check_name" value=""'
)
expect(wrapper.html()).contains(
'pages.sequence.sort_panel_settings_order'
)
expect(wrapper.html()).contains('increased="true"></input-switch')
})
it('should render the component with gpsdate selected', () => {
const wrapper = shallowMount(PanelSortManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
},
props: {
sequenceSorted: '-gpsdate'
}
})
expect(wrapper.html()).contains(
'name="sort" id="gpsdate" label="pages.sequence.sort_panel_check_gps" value="gpsdate"'
)
expect(wrapper.html()).contains('increased="false"></input-switch')
})
})
})
describe('Emit functions', () => {
it('should emit triggerSort event', async () => {
const wrapper = shallowMount(PanelSortManagement, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
},
props: {
sequenceSorted: '-gpsdate'
}
})
await wrapper.vm.triggerSort('-gpsdate')
expect(wrapper.emitted('triggerSort')).toHaveLength(1)
expect(wrapper.emitted('triggerSort')[0]).toEqual(['-gpsdate'])
})
})
})

View File

@@ -0,0 +1,53 @@
import { it, describe, expect } from 'vitest'
import { shallowMount } from '@vue/test-utils'
import WidgetOrientation from '../../../../components/sequence/WidgetOrientation.vue'
import i18n from '../../config'
describe('Template', () => {
describe('Props', () => {
it('should have default props', () => {
const wrapper = shallowMount(WidgetOrientation, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
}
})
expect(wrapper.vm.roadDegrees).toBe(0)
expect(wrapper.vm.seqBruteDeg).toBe(0)
})
describe('When the component have props filled', () => {
it('should render the component all the element', () => {
const wrapper = shallowMount(WidgetOrientation, {
global: {
plugins: [i18n],
mocks: {
$t: (msg) => msg
}
},
props: {
roadDegrees: 45,
seqBruteDeg: 22
}
})
expect(wrapper.html()).contains(
'class="wrapper-img-road" style="transform: rotate(45deg);"'
)
expect(wrapper.html()).contains(
'src="/assets/images/car.svg" alt="" style="transform: rotate(45deg);" class="car-img"'
)
expect(wrapper.html()).contains(
'style="transform: rotate(22deg);" id="rotateWrapper" class="rotate-wrapper"'
)
expect(wrapper.html()).contains(
'src="/assets/images/icon/cursor-arrow.svg"'
)
expect(wrapper.html()).contains('class="arrow-img arrow-img-1"')
expect(wrapper.html()).contains('class="arrow-img arrow-img-2"')
})
})
})
// TODO TEST -> All Events
})

View File

@@ -1,4 +1,4 @@
import { it, describe, expect } from 'vitest'
import { it, describe, expect, vi, beforeEach } from 'vitest'
import {
imageStatus,
photoToDeleteOrPatchSelected,
@@ -6,10 +6,25 @@ import {
formatPaginationItems
} from '../../views/utils/sequence/index'
import { sortByName } from '../../views/utils/upload/index'
import { getAuthRoute } from '../../utils/auth'
import {
getAuthRoute,
decodingFlaskCookie,
hasASessionCookieDecoded
} from '../../utils/auth'
import { img } from '../../utils/image'
import { title } from '../../utils/index'
import { useCookies } from 'vue3-cookies'
vi.mock('vue3-cookies', () => {
const mockCookies = {
get: vi.fn(),
remove: vi.fn(),
keys: vi.fn()
}
return {
useCookies: () => ({
cookies: mockCookies
})
}
})
describe('imageStatus', () => {
it('should render the "status" value', () => {
const sequenceStatus = 'hidden'
@@ -126,6 +141,42 @@ describe('getAuthRoute', () => {
})
})
describe('decodingFlaskCookie', () => {
it('should return a decoded cookie', () => {
const cookie =
'.eJw9y0EKgzAQQNG7zLoDJpmYxMuUySRDra0pooUi3r3SRZcf_tuBRdo2rzDsMBYYgFxRytljkeyQrK0YVT16m6OhUlIihgvM_Kznfa88n9V4W2_XnzcuiqgmDBQMUtYec00WO3XqAndd7OUvXkt7j6Uup5vqRx6NJziOL8SPLNU.ZVy19Q.4DkVxu-LSF11uREkn6YIwHbn_0U'
expect(decodingFlaskCookie(cookie)).toEqual(
JSON.stringify({
account: {
id: '43df4bb5-dcb3-422e-8ff5-52b814dd994a',
name: 'jean',
oauth_id: '138ccff9-7471-4bf6-be92-0f3f37a0086c',
oauth_provider: 'keycloak'
}
})
)
})
})
describe('hasASessionCookieDecoded', () => {
it('should return a cookie parsed', () => {
vi.spyOn(useCookies().cookies, 'get').mockReturnValue(
'.eJw9y0EKgzAQQNG7zLoDJpmYxMuUySRDra0pooUi3r3SRZcf_tuBRdo2rzDsMBYYgFxRytljkeyQrK0YVT16m6OhUlIihgvM_Kznfa88n9V4W2_XnzcuiqgmDBQMUtYec00WO3XqAndd7OUvXkt7j6Uup5vqRx6NJziOL8SPLNU.ZVy19Q.4DkVxu-LSF11uREkn6YIwHbn_0U'
)
expect(hasASessionCookieDecoded()).toEqual({
account: {
id: '43df4bb5-dcb3-422e-8ff5-52b814dd994a',
name: 'jean',
oauth_id: '138ccff9-7471-4bf6-be92-0f3f37a0086c',
oauth_provider: 'keycloak'
}
})
})
it('should return null', () => {
vi.spyOn(useCookies().cookies, 'get').mockReturnValue(null)
expect(hasASessionCookieDecoded()).toBe(null)
})
})
describe('img', () => {
it('should render the formated img path', () => {
const name = 'my-img'
@@ -133,19 +184,6 @@ describe('img', () => {
})
})
describe('title', () => {
it('should return the formated title with instance name', () => {
import.meta.env.VITE_INSTANCE_NAME = 'my instance'
const myTitle = 'my title'
expect(title(myTitle)).toEqual('my title my instance')
})
it('should return the formated title without instance name', () => {
import.meta.env.VITE_INSTANCE_NAME = ''
const myTitle = 'my title'
expect(title(myTitle)).toEqual('my title')
})
})
describe('sortByName', () => {
it('should return the the list sorted by name', () => {
const list1 = [

View File

@@ -81,7 +81,7 @@ describe('Template', () => {
spyPicture.mockReturnValue({ data: {} })
const sequenceTitle = `Séquence du ${formatDate(
new Date(),
'Do MMMM YYYY, hh:mm:ss'
'Do MMMM YYYY, HH:mm:ss'
)}`
const body = new FormData()
body.append('position', '1')

View File

@@ -1,3 +1,7 @@
import pako from 'pako'
import { useCookies } from 'vue3-cookies'
const { cookies } = useCookies()
function getAuthRoute(authRoute: string, nextRoute: string): string {
const next = `${location.protocol}//${location.host}${nextRoute}`
return `${
@@ -5,4 +9,25 @@ function getAuthRoute(authRoute: string, nextRoute: string): string {
}api/${authRoute}?next_url=${encodeURIComponent(`${next}`)}`
}
export { getAuthRoute }
// This function to decode the flask cookie and have the user information like username
function decodingFlaskCookie(cookie: string): string {
const cookieFormatted = cookie
.split('.')[1]
.replace(/_/g, '/')
.replace(/-/g, '+')
const binaryString = atob(cookieFormatted)
const bytes = new Uint8Array(binaryString.length)
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i)
}
return pako.inflate(bytes.buffer, { to: 'string' })
}
function hasASessionCookieDecoded(): { account: { name: string } } | null {
if (cookies.get('session')) {
return JSON.parse(decodingFlaskCookie(cookies.get('session')))
}
return null
}
export { getAuthRoute, hasASessionCookieDecoded, decodingFlaskCookie }

View File

@@ -1,7 +1,7 @@
import moment from 'moment'
import 'moment/dist/locale/fr'
function formatDate(date: Date, formatType: string): string {
function formatDate(date: Date | null | string, formatType: string): string {
const formatDate = moment(date)
return formatDate.locale(window.navigator.language).format(formatType)
}

View File

@@ -1,9 +1,3 @@
export function title(title: string): string {
const instanceName = import.meta.env.VITE_INSTANCE_NAME
if (instanceName) return `${title} ${instanceName}`
return title
}
export function createUrlLink(picId: string): string {
return encodeURIComponent(`${window.location.origin}/#focus=pic&pic=${picId}`)
}

View File

@@ -1,21 +1,29 @@
import axios from 'axios'
async function getIgnTiles(): Promise<object> {
const { data } = await axios.get(
'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/attenue.json'
)
data.sources.plan_ign.scheme = 'xyz'
data.sources.plan_ign.attribution = 'Données cartographiques : © IGN'
const objIndex = data.layers.findIndex(
(el: any) => el.id === 'toponyme - parcellaire - adresse'
)
data.layers[objIndex].layout = {
...data.layers[objIndex].layout,
'text-field': ['concat', ['get', 'numero'], ['get', 'indice_de_repetition']]
async function getIgnTiles(): Promise<object | string> {
try {
const { data } = await axios.get(
'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/attenue.json'
)
data.sources.plan_ign.scheme = 'xyz'
data.sources.plan_ign.attribution = 'Données cartographiques : © IGN'
const objIndex = data.layers.findIndex(
(el: { id: string }) => el.id === 'toponyme - parcellaire - adresse'
)
data.layers[objIndex].layout = {
...data.layers[objIndex].layout,
'text-field': [
'concat',
['get', 'numero'],
['get', 'indice_de_repetition']
]
}
// Patch tms scheme to xyz to make it compatible for Maplibre GL JS / Mapbox GL JS
// Patch num_repetition
return data
} catch (error) {
return 'https://tile-vect.openstreetmap.fr/styles/basic/style.json'
}
// Patch tms scheme to xyz to make it compatible for Maplibre GL JS / Mapbox GL JS
// Patch num_repetition
return data
}
export { getIgnTiles }

View File

@@ -1,7 +1,7 @@
<template>
<main class="entry-page">
<main id="homePage" class="entry-page">
<section class="entry-section">
<Viewer ref="viewerRef" />
<Viewer ref="viewerRef"> </Viewer>
</section>
</main>
</template>
@@ -9,7 +9,8 @@
<script lang="ts" setup>
import { ref } from 'vue'
import Viewer from '@/components/Viewer.vue'
const viewerRef = ref<unknown>(null)
import type ViewerType from '@/components/Viewer.vue'
const viewerRef = ref<InstanceType<typeof ViewerType>>()
</script>
<style scoped lang="scss">
.entry-page {
@@ -19,10 +20,18 @@ const viewerRef = ref<unknown>(null)
width: 100%;
height: calc(100vh - #{toRem(13.2)});
}
.mobile {
display: none;
}
.focus-pic,
.logged .entry-section {
height: calc(100vh - #{toRem(8)});
}
.full-viewer {
.entry-section {
height: 100vh;
}
}
.gvs-focus-map .entry-report-button {
display: none;
}
@@ -34,5 +43,17 @@ const viewerRef = ref<unknown>(null)
.entry-section {
height: calc(100dvh - #{toRem(18)});
}
.full-viewer {
height: 100vh;
padding-top: 0;
}
}
@media (max-width: toRem(50)) {
.mobile {
display: block;
}
.desktop {
display: none;
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -118,11 +118,13 @@
<span>{{ $t('pages.share_pictures.information_text3') }}</span>
</div>
<div class="entry-information-card">
<InformationCard
:title="$t('pages.share_pictures.information_about_title')"
:text="formatTextInfoCard"
look="blue"
/>
<InformationCard :text="formatTextInfoCard" look="blue">
<template v-slot:title>
<h3 class="subtitle">
{{ $t('pages.upload.title') }}
</h3>
</template>
</InformationCard>
</div>
</section>
<section class="section">
@@ -268,7 +270,7 @@ ul {
.subtitle {
@include text(h2);
color: var(--blue-dark);
margin-bottom: toRem(2);
margin-bottom: 0;
}
.upload-button {
display: flex;
@@ -282,6 +284,10 @@ ul {
.entry-information-card {
margin-top: toRem(2);
}
.subtitle {
@include text(h2);
color: var(--blue-dark);
}
.icon-block {
display: flex;
align-items: center;

View File

@@ -4,15 +4,19 @@
<InformationCard
v-if="informationCardDisplayed"
:text="$t('pages.upload.description')"
:title="$t('pages.upload.title')"
>
<template v-slot:cross>
<Button
icon="bi bi-x-lg"
look="no-text"
look="no-text-blue-dark"
@trigger="informationCardDisplayed = false"
/>
</template>
<template v-slot:title>
<h3 class="subtitle">
{{ $t('pages.upload.title') }}
</h3>
</template>
<template v-slot:button>
<div class="button-know-more">
<Link
@@ -39,10 +43,14 @@
<p class="import-text">
{{ $t('pages.upload.description_title_sequence') }}
</p>
<EditText
:default-text="newSequenceTitle || sequenceTitle"
@triggerNewText="setNewSequenceTitle"
/>
<div class="wrapper-edit-text">
<EditText
:default-text="newSequenceTitle || sequenceTitle"
:is-loading="isLoading"
:is-loaded="isLoaded"
@triggerNewText="setNewSequenceTitle"
/>
</div>
<form>
<div class="wrapper-form">
<InputUpload
@@ -61,6 +69,13 @@
class="uploading-img"
/>
<span>{{ $t('pages.upload.uploading_process') }}</span>
<div class="cancel-button">
<Button
:text="$t('pages.upload.uploading_cancel')"
look="button--red"
@trigger="cancelUpload"
/>
</div>
<span class="loader-text-warning">{{
$t('pages.upload.leave_message')
}}</span>
@@ -88,7 +103,20 @@
v-if="uploadedSequence && uploadedSequence.picturesOnError"
ref="modal"
:upload-errors="uploadedSequence.picturesOnError"
/>
:title="$t('pages.upload.modal_error_title')"
>
<template v-slot:body>
<ul>
<li
v-for="item in uploadedSequence.picturesOnError"
class="error-item"
>
<span>{{ item.name }} - </span>
<span>{{ item.details.error }}</span>
</li>
</ul>
</template>
</Modal>
</main>
</template>
@@ -112,6 +140,7 @@ import {
} from '@/views/utils/upload/request'
import { sortByName } from '@/views/utils/upload/index'
import authConfig from '../composables/auth'
import { deleteACollection } from '@/views/utils/sequence/request'
const { authConf } = authConfig()
const { t } = useI18n()
@@ -148,7 +177,7 @@ onUnmounted(() => {
window.onbeforeunload = null
})
onBeforeRouteLeave((to, from, next) => {
if (isLoading.value) {
if (!isLoaded.value && isLoading.value) {
const answer = window.confirm(t('pages.upload.leave_message'))
if (answer) return next()
return next(false)
@@ -167,7 +196,7 @@ function setNewSequenceTitle(value: string | null): void {
function formatSequenceTitle(): string {
return `${t('pages.upload.sequence_title')}${formatDate(
new Date(),
'Do MMMM YYYY, hh:mm:ss'
'Do MMMM YYYY, HH:mm:ss'
)}`
}
function picturesToUploadSizeText(): void {
@@ -198,6 +227,16 @@ function addPictures(value: FileList): void {
loadPercentage.value = '0%'
uploadPicture()
}
async function cancelUpload(): Promise<void> {
const answer = window.confirm(t('pages.upload.cancel_message'))
if (answer) {
pictures.value = []
isLoading.value = false
if (uploadedSequence.value) {
await deleteACollection(uploadedSequence.value.id)
}
}
}
async function uploadPicture(): Promise<void> {
if (!pictures.value || !pictures.value.length) {
return
@@ -221,13 +260,16 @@ async function uploadPicture(): Promise<void> {
}
let i = 0
for (let el of picturesToUpload) {
if (pictures.value.length === 0) {
break
}
const body = new FormData()
i++
body.append('position', i.toString())
body.append('picture', el)
try {
const pictureUploaded = await createAPictureToASequence(data.id, body)
const pictures = { ...pictureUploaded.data, name: el.name }
const pictures = { ...pictureUploaded, name: el.name }
picturesUploadingSize.value = picturesUploadingSize.value + el.size
uploadedSequence.value.pictures = [
...uploadedSequence.value.pictures,
@@ -238,6 +280,7 @@ async function uploadPicture(): Promise<void> {
picturesUploadingSize.value = picturesUploadingSize.value + el.size
const picturesOnError = {
message: err.response.data.message,
details: { error: err.response.data.details.error },
name: el.name
}
uploadedSequence.value.picturesOnError = [
@@ -264,7 +307,6 @@ h3 {
.entry-page {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: calc(100vh - #{toRem(13.82)});
background-color: var(--grey);
@@ -282,6 +324,10 @@ h3 {
margin-right: toRem(3);
margin-bottom: toRem(1);
}
.subtitle {
@include text(h2);
color: var(--blue-dark);
}
.wrapper-section {
display: flex;
width: 100%;
@@ -297,6 +343,12 @@ h3 {
margin-right: toRem(2);
}
}
.error-item {
padding: toRem(1);
&:nth-child(odd) {
background-color: var(--grey);
}
}
.subtitle {
@include text(h3);
color: var(--blue-dark);
@@ -304,6 +356,9 @@ h3 {
.import-text {
@include text(m-r-regular);
}
.wrapper-edit-text {
margin-bottom: toRem(2);
}
.entry-license {
margin-bottom: toRem(1);
}
@@ -322,10 +377,13 @@ h3 {
.uploading-img {
height: toRem(20);
}
.cancel-button {
margin-top: toRem(1);
}
.loader-text-warning {
text-align: center;
@include text(s-r-regular);
color: var(--orange);
color: var(--red-pale);
margin-top: toRem(1);
width: toRem(31);
}
@@ -337,6 +395,9 @@ h3 {
align-items: center;
}
@media (max-width: toRem(76.8)) {
.section {
display: none;
}
.entry-page {
padding-top: toRem(15);
}

View File

@@ -0,0 +1,5 @@
export interface ExtendedHtmlEl extends HTMLElement {
mozRequestFullScreen?: () => void
webkitRequestFullScreen?: () => void
msRequestFullscreen?: () => void
}

View File

@@ -27,6 +27,7 @@ export interface UserSequenceInterface {
status: string
providers: [{ name: string; roles: [string] }]
extent: { temporal: { interval: [Date[]] }; spatial: { bbox: string[] } }
['geovisio:sorted-by']?: string
}
export interface ResponseUserSequenceInterface extends UserSequenceInterface {
@@ -39,5 +40,6 @@ export interface ResponseUserSequenceInterface extends UserSequenceInterface {
export interface CheckboxInterface {
isChecked: boolean
isIndeterminate: boolean
isIndeterminate?: boolean
name: string
}

View File

@@ -5,14 +5,22 @@ export interface SequenceLinkInterface {
title: string
type: string
created: Date
extent: { temporal: { interval: [Date[]] } }
extent: { temporal: { interval: [Date[]] }; spatial: { bbox: [number[]] } }
['stats:items']: { count: number }
['geovisio:status']: string
}
export interface ExtentSequenceLinkInterface {
extent: { temporal: { interval: [Date[]] } }
['stats:items']: { count: number }
title: string
created: Date
export interface PositionInterface {
bottom: number
top: number
right: number
left: number
y: number
x: number
}
export interface DateInterface {
end: string | null
start: string | null
type: string
}

View File

@@ -8,5 +8,6 @@ export interface SequenceInterface {
}
export interface uploadErrorInterface {
message: string
details: { error: string }
name: string
}

View File

@@ -1,11 +1,18 @@
export interface MapInterface {
startWide?: boolean
users?: string[]
maxZoom?: number
minZoom?: number
style?: object | string
zoom?: number
center?: number[]
bounds?: number[]
raster?: {
type: string
tiles: string[]
attribution: string
tileSize: number
}
}
export interface ViewerInterface {

View File

@@ -0,0 +1,43 @@
import type { ExtendedHtmlEl } from '@/views/interfaces/HomeView'
interface ExtendedDocument extends Document {
webkitFullscreenElement?: Element
mozFullScreenElement?: Element
msFullscreenElement?: Element
mozCancelFullScreen?: () => void
webkitExitFullscreen?: () => void
msExitFullscreen?: () => void
}
export function toggleFullscreen(element: ExtendedHtmlEl) {
const documentWithExtensions = document as ExtendedDocument
const isInFullScreen =
(documentWithExtensions.fullscreenElement &&
documentWithExtensions.fullscreenElement !== null) ||
(documentWithExtensions.webkitFullscreenElement &&
documentWithExtensions.webkitFullscreenElement !== null) ||
(documentWithExtensions.mozFullScreenElement &&
documentWithExtensions.mozFullScreenElement !== null) ||
(documentWithExtensions.msFullscreenElement &&
documentWithExtensions.msFullscreenElement !== null)
if (!isInFullScreen) {
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen()
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen()
}
} else {
if (documentWithExtensions.exitFullscreen) {
documentWithExtensions.exitFullscreen()
} else if (documentWithExtensions.webkitExitFullscreen) {
documentWithExtensions.webkitExitFullscreen()
} else if (documentWithExtensions.mozCancelFullScreen) {
documentWithExtensions.mozCancelFullScreen()
} else if (documentWithExtensions.msExitFullscreen) {
documentWithExtensions.msExitFullscreen()
}
}
}

View File

@@ -7,9 +7,8 @@ function imageStatus(imageStatus: string, sequenceStatus: string): string {
if (sequenceStatus === 'hidden') return sequenceStatus
return imageStatus
}
//TODO REMOVE ANY
function scrollIntoSelected(id: string, userPhotos: any): void {
const itemPosition = userPhotos.map((el: any) => el.id).indexOf(id)
function scrollIntoSelected(id: string, userPhotos: string[]): void {
const itemPosition = userPhotos.map((el: string) => el).indexOf(id)
const elementTarget = document.querySelector(`#el-list${itemPosition}`)
if (elementTarget) elementTarget.scrollIntoView({ behavior: 'smooth' })
}

View File

@@ -11,9 +11,9 @@ function deleteACollection(collectionId: string | string[]): Promise<unknown> {
function patchACollection(
collectionId: string | string[],
visible: string
fieldObject: object
): Promise<unknown> {
return axios.patch(`api/collections/${collectionId}`, { visible: visible })
return axios.patch(`api/collections/${collectionId}`, fieldObject)
}
function deleteACollectionItem(

View File

@@ -19,12 +19,32 @@ interface SequenceCreatedInterface {
}
}
interface PictureCreatedInterface {
data: {
assets: object
bbox: number[]
collection: string
geometry: object
id: string
links: object[]
properties: object
providers: object[]
stac_extensions: string[]
stac_version: string
type: string
}
}
function createASequence(title: string): Promise<SequenceCreatedInterface> {
return axios.post('api/collections', { title: title })
}
async function createAPictureToASequence(id: string, body: any): Promise<any> {
return await axios.post(`api/collections/${id}/items`, body)
async function createAPictureToASequence(
id: string,
body: FormData
): Promise<PictureCreatedInterface> {
const { data } = await axios.post(`api/collections/${id}/items`, body)
return data
}
export { createASequence, createAPictureToASequence }

BIN
static/meta-img.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

1
v-calendar.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'v-calendar'

View File

@@ -1,33 +1,51 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import eslintPlugin from 'vite-plugin-eslint'
import { createHtmlPlugin } from 'vite-plugin-html'
// https://vitejs.dev/config/
export default defineConfig({
server: {
host: true,
port: 5173,
strictPort: true,
hmr: {
clientPort: 5173,
overlay: false
}
},
base: '/',
plugins: [vue(), eslintPlugin()],
css: {
preprocessorOptions: {
scss: {
additionalData:
'@import "@/assets/font-size.scss"; @import "@/assets/rem-calc.scss";'
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }
return defineConfig({
server: {
host: true,
port: 5173,
strictPort: true,
hmr: {
clientPort: 5173,
overlay: false
}
},
base: '/',
plugins: [
vue(),
eslintPlugin(),
createHtmlPlugin({
minify: true,
/**
* Data that needs to be injected into the index.html ejs template
*/
inject: {
data: {
instanceName: process.env.VITE_INSTANCE_NAME,
frontUrl: process.env.VITE_FRONT_URL
}
}
})
],
css: {
preprocessorOptions: {
scss: {
additionalData:
'@import "@/assets/font-size.scss"; @import "@/assets/rem-calc.scss"; @import "@/assets/components/index.scss";'
}
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}
}
})
})
}

1
vue-matomo.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'vue-matomo'

7312
yarn.lock

File diff suppressed because it is too large Load Diff