From 4223a9d522227fe5a342e942e9adc07937020242 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:08:53 +0200 Subject: [PATCH 1/9] disable observer --- src/components/project/PdfViewer.vue | 69 +++++++++++++--------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/src/components/project/PdfViewer.vue b/src/components/project/PdfViewer.vue index 0fd8f77..4acd480 100644 --- a/src/components/project/PdfViewer.vue +++ b/src/components/project/PdfViewer.vue @@ -50,43 +50,38 @@ const currentPageIndex = ref(1); // Functions const onPdfLoaded = () => { - const wrapper = document.querySelector('.vpv-pages-inner-container'); - - const observer = new IntersectionObserver( - (entries) => { - entries.forEach((entry, index) => { - if (entry.intersectionRatio > 0.5) { - currentPageIndex.value = parseInt( - entry.target.getAttribute('aria-label').split(' ')[1] - ); - } - }); - }, - { - root: wrapper, - threshold: [0.5], - } - ); - - const observePages = () => { - const pages = document.querySelectorAll('.vpv-page-inner-container'); - pages.forEach((page) => { - if (!page.__observed__) { - observer.observe(page); - page.__observed__ = true; - } - }); - }; - - const mutationObserver = new MutationObserver(() => { - observePages(); - }); - - if (wrapper) { - mutationObserver.observe(wrapper, { childList: true, subtree: true }); - } - - observePages(); + // const wrapper = document.querySelector('.vpv-pages-inner-container'); + // const observer = new IntersectionObserver( + // (entries) => { + // entries.forEach((entry, index) => { + // if (entry.intersectionRatio > 0.5) { + // currentPageIndex.value = parseInt( + // entry.target.getAttribute('aria-label').split(' ')[1] + // ); + // } + // }); + // }, + // { + // root: wrapper, + // threshold: [0.5], + // } + // ); + // const observePages = () => { + // const pages = document.querySelectorAll('.vpv-page-inner-container'); + // pages.forEach((page) => { + // if (!page.__observed__) { + // observer.observe(page); + // page.__observed__ = true; + // } + // }); + // }; + // const mutationObserver = new MutationObserver(() => { + // observePages(); + // }); + // if (wrapper) { + // mutationObserver.observe(wrapper, { childList: true, subtree: true }); + // } + // observePages(); }; From 1e890cfa2e3c70227e021b6516da6baefa030ae3 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:15:38 +0200 Subject: [PATCH 2/9] uncomment observers --- src/components/project/PdfViewer.vue | 69 +++++++++++++++------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/src/components/project/PdfViewer.vue b/src/components/project/PdfViewer.vue index 4acd480..0fd8f77 100644 --- a/src/components/project/PdfViewer.vue +++ b/src/components/project/PdfViewer.vue @@ -50,38 +50,43 @@ const currentPageIndex = ref(1); // Functions const onPdfLoaded = () => { - // const wrapper = document.querySelector('.vpv-pages-inner-container'); - // const observer = new IntersectionObserver( - // (entries) => { - // entries.forEach((entry, index) => { - // if (entry.intersectionRatio > 0.5) { - // currentPageIndex.value = parseInt( - // entry.target.getAttribute('aria-label').split(' ')[1] - // ); - // } - // }); - // }, - // { - // root: wrapper, - // threshold: [0.5], - // } - // ); - // const observePages = () => { - // const pages = document.querySelectorAll('.vpv-page-inner-container'); - // pages.forEach((page) => { - // if (!page.__observed__) { - // observer.observe(page); - // page.__observed__ = true; - // } - // }); - // }; - // const mutationObserver = new MutationObserver(() => { - // observePages(); - // }); - // if (wrapper) { - // mutationObserver.observe(wrapper, { childList: true, subtree: true }); - // } - // observePages(); + const wrapper = document.querySelector('.vpv-pages-inner-container'); + + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry, index) => { + if (entry.intersectionRatio > 0.5) { + currentPageIndex.value = parseInt( + entry.target.getAttribute('aria-label').split(' ')[1] + ); + } + }); + }, + { + root: wrapper, + threshold: [0.5], + } + ); + + const observePages = () => { + const pages = document.querySelectorAll('.vpv-page-inner-container'); + pages.forEach((page) => { + if (!page.__observed__) { + observer.observe(page); + page.__observed__ = true; + } + }); + }; + + const mutationObserver = new MutationObserver(() => { + observePages(); + }); + + if (wrapper) { + mutationObserver.observe(wrapper, { childList: true, subtree: true }); + } + + observePages(); }; From 5e78e67fc8a76117345db823611e4448607ab80e Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:34:53 +0200 Subject: [PATCH 3/9] remove cache busting --- public/site/snippets/header.php | 4 +-- vite.config.js | 58 ++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/public/site/snippets/header.php b/public/site/snippets/header.php index f8e4f54..a35fc34 100644 --- a/public/site/snippets/header.php +++ b/public/site/snippets/header.php @@ -25,8 +25,8 @@ - - + + diff --git a/vite.config.js b/vite.config.js index 53268a1..154116f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,33 +1,37 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; -export default defineConfig({ - plugins: [vue()], - base: '/', - build: { - outDir: 'dist', - rollupOptions: { - output: { - entryFileNames: 'assets/dist/[name].js', - assetFileNames: 'assets/dist/[name].[ext]', +export default defineConfig(({ mode }) => { + return { + plugins: [vue()], + base: '/', + build: { + outDir: 'dist', + rollupOptions: { + output: { + entryFileNames: 'assets/dist/[name].js', + assetFileNames: 'assets/dist/[name].[ext]', + }, + }, + sourcemap: mode === 'staging', + minify: mode === 'production', + }, + server: { + watch: { + ignored: [ + '**/node_modules/**', + '**/.git/**', + '**/.cache/**', + '**/.vite/**', + '**/dist/**', + '**/*.log', + '**/.idea/**', + '**/.vscode/**', + '**/public/assets/**', + '**/local/**', + '/public/**', + ], }, }, - }, - server: { - watch: { - ignored: [ - '**/node_modules/**', - '**/.git/**', - '**/.cache/**', - '**/.vite/**', - '**/dist/**', - '**/*.log', - '**/.idea/**', - '**/.vscode/**', - '**/public/assets/**', - '**/local/**', - '/public/**', - ], - }, - }, + }; }); From 95bdf4615d149635d13f6ae7f6ac41184d7763a2 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:47:45 +0200 Subject: [PATCH 4/9] fix CI --- .gitlab-ci.yml | 79 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8617d19..c5d58cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,13 @@ stages: - build - deploy - variables: COMPOSER_ALLOW_SUPERUSER: '1' -build: +build_prod: stage: build + only: + - prod image: composer:2 script: - apk add --no-cache nodejs npm @@ -23,7 +24,27 @@ build: paths: - node_modules/ -deploy: +build_preprod: + stage: build + only: + - preprod + image: composer:2 + script: + - apk add --no-cache nodejs npm + - npm install + - npm run build:preprod + - cd dist - + composer install --no-dev --optimize-autoloader --ignore-platform-req=ext-gd + - cd .. + artifacts: + paths: + - dist/ + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + +deploy_prod: stage: deploy image: node:latest only: @@ -33,18 +54,44 @@ deploy: script: - cd dist - | - rsync_deploy() { - local src=$1 - local dst=$2 - local exclude=$3 - cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O" - [[ -n $exclude ]] && cmd="$cmd $exclude" - cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst" - echo "$cmd" - eval $cmd - } + rsync_deploy() { + local src=$1 + local dst=$2 + local exclude=$3 + cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O" + [[ -n $exclude ]] && cmd="$cmd $exclude" + cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst" + echo "$cmd" + eval $cmd + } - rsync_deploy site/ "$PROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'" - rsync_deploy vendor/ "$PROD_PATH/vendor/" - rsync_deploy kirby/ "$PROD_PATH/kirby/" + rsync_deploy site/ "$PROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'" + rsync_deploy vendor/ "$PROD_PATH/vendor/" + rsync_deploy kirby/ "$PROD_PATH/kirby/" rsync_deploy assets/ "$PROD_PATH/assets/" "--exclude 'tiles/'" + +deploy_preprod: + stage: deploy + image: node:latest + only: + - preprod + before_script: + - apt-get update -qq && apt-get install -y rsync sshpass + script: + - cd dist + - | + rsync_deploy() { + local src=$1 + local dst=$2 + local exclude=$3 + cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O" + [[ -n $exclude ]] && cmd="$cmd $exclude" + cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst" + echo "$cmd" + eval $cmd + } + + rsync_deploy site/ "$PREPROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'" + rsync_deploy vendor/ "$PREPROD_PATH/vendor/" + rsync_deploy kirby/ "$PREPROD_PATH/kirby/" + rsync_deploy assets/ "$PREPROD_PATH/assets/" "--exclude 'tiles/'" From 729d72e18a473804f0ee82b75fecacb1a1630d87 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:48:35 +0200 Subject: [PATCH 5/9] fix CI --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c5d58cb..5fa295d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,10 +39,10 @@ build_preprod: artifacts: paths: - dist/ - cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - node_modules/ + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ deploy_prod: stage: deploy From d7e96541a0df51db4e41bbb0c759ef7b0980f2d8 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:50:25 +0200 Subject: [PATCH 6/9] remove cache busting based on query string --- public/site/snippets/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/site/snippets/header.php b/public/site/snippets/header.php index f8e4f54..a35fc34 100644 --- a/public/site/snippets/header.php +++ b/public/site/snippets/header.php @@ -25,8 +25,8 @@ - - + + From 186f7b80ba3bc5af1f81b6497a612a1aeab38915 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:56:15 +0200 Subject: [PATCH 7/9] fix CI --- .gitlab-ci.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d6fd61..aa30802 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - deploy + variables: COMPOSER_ALLOW_SUPERUSER: '1' @@ -82,18 +83,18 @@ deploy_prod: script: - cd dist - | - rsync_deploy() { - local src=$1 - local dst=$2 - local exclude=$3 - cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O" - [[ -n $exclude ]] && cmd="$cmd $exclude" - cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst" - echo "$cmd" - eval $cmd - } + rsync_deploy() { + local src=$1 + local dst=$2 + local exclude=$3 + cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O" + [[ -n $exclude ]] && cmd="$cmd $exclude" + cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst" + echo "$cmd" + eval $cmd + } - rsync_deploy site/ "$PROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'" - rsync_deploy vendor/ "$PROD_PATH/vendor/" - rsync_deploy kirby/ "$PROD_PATH/kirby/" + rsync_deploy site/ "$PROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'" + rsync_deploy vendor/ "$PROD_PATH/vendor/" + rsync_deploy kirby/ "$PROD_PATH/kirby/" rsync_deploy assets/ "$PROD_PATH/assets/" "--exclude 'tiles/'" From d590c9ac458bcc17bb7d68b9003d7e6c688554b5 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 8 Oct 2025 15:58:25 +0200 Subject: [PATCH 8/9] fix CI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa30802..6e95c05 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,7 +56,7 @@ deploy_preprod: build_prod: stage: build only: - - prod + - main image: composer:2 script: - apk add --no-cache nodejs npm From c9aefe7ecfcdb9b9988176f3f0a9dd4290b3a7f6 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 15 Oct 2025 16:17:30 +0200 Subject: [PATCH 9/9] #179 --- public/site/models/project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/site/models/project.php b/public/site/models/project.php index 1152945..df39ff1 100644 --- a/public/site/models/project.php +++ b/public/site/models/project.php @@ -159,7 +159,7 @@ class ProjectPage extends NotificationsPage { "physicalSample" => "échantillon physique", ]; - return $stepsLabel[$this->currentStep()->value()]; + return $stepsLabel[$this->currentStep()->value()] ?? "brief"; } // public function printManagers() {