From 3bc6595f5833d15150ecfc915b93310436262c20 Mon Sep 17 00:00:00 2001 From: nobohan Date: Sat, 26 Oct 2024 12:09:00 +0200 Subject: [PATCH 1/5] add a zoom button for zooming to the document --- .../Resources/public/types.ts | 9 ++ .../public/vuejs/DocumentSignature/App.vue | 103 +++++++++++++++--- 2 files changed, 99 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types.ts index 2a998fb63..ba7369661 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types.ts @@ -130,3 +130,12 @@ export interface CheckSignature { } export type CanvasEvent = "select" | "add"; + +export interface ZoomLevel { + id: number; + zoom: number; + label: { + fr?: string, + nl?: string + }; +} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue index a7c222cce..3572aa323 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue @@ -29,6 +29,17 @@
+ {{ page }}/{{ pageCount }}
-
+
-
-
+ |
-
+
-
-
{{ page }} / {{ pageCount }}
-
-
+ | -
-
+ |
-
+
-
-
-
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts index c6ae996b2..49b0f6f79 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts @@ -12,7 +12,6 @@ const appMessages = { sign: 'Signer', choose_another_signature: 'Choisir une autre zone', cancel: 'Annuler', - cancel_signing: 'Refuser de signer', last_sign_zone: 'Zone de signature précédente', next_sign_zone: 'Zone de signature suivante', add_sign_zone: 'Ajouter une zone de signature', From 5447ad29614be43d4d701d82af46cd8e98fb7b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Nov 2024 19:31:01 +0100 Subject: [PATCH 4/5] Fix casting zoom level from string to floatInt Changed the type of the zoomLevel parameter from number to string and updated the assignment to parse the zoomLevel as a float. This ensures that the zoom functionality properly handles string inputs by converting them to numerical values. --- .../Resources/public/vuejs/DocumentSignature/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue index 7b62f3fa7..52c33b0f8 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue @@ -331,8 +331,8 @@ const $toast = useToast(); const signature = window.signature; -const setZoomLevel = (zoomLevel: number) => { - zoom.value = zoomLevel; +const setZoomLevel = (zoomLevel: string) => { + zoom.value = Number.parseFloat(zoomLevel); setPage(page.value); setTimeout(() => drawAllZones(page.value), 200); }; From b2f6dbbe3014956207cfca4b42f0a4793a8d4229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Nov 2024 19:32:12 +0100 Subject: [PATCH 5/5] Show the zoom level also if there is only one page in the document --- .../public/vuejs/DocumentSignature/App.vue | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue index 52c33b0f8..b223882b2 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue @@ -28,7 +28,7 @@
-
+
- - {{ page }}/{{ pageCount }} - +
-
+
- - {{ page }} / {{ pageCount }} - +