From a83bf2884a8f83ac46b460a86ce59cc5ec8459c7 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Mon, 30 Oct 2023 17:11:43 +0400 Subject: [PATCH 1/5] Fix file issues - Fix camera takes wrong width and height properties - Fix imageHeight/imageWidth behaviour for multiple preview - Fix actions are not visible in design mode - Fix choose button is not clickable - Fix empty space under image on mobile --- .../file/choose-file.component.html | 4 +- .../file/file-preview.component.html | 2 +- .../src/components/file/FileChooseButton.vue | 5 +- .../src/components/file/FilePreview.vue | 2 +- src/actions/action.ts | 4 + src/defaultCss/defaultV2Css.ts | 1 + src/defaultV2-theme/blocks/sd-action.scss | 4 + src/defaultV2-theme/blocks/sd-file.scss | 38 ++++++--- src/knockout/components/file/choose-file.html | 4 +- .../components/file/file-preview.html | 2 +- src/question_file.ts | 26 +++--- .../components/file/file-choose-button.tsx | 5 +- src/react/components/file/file-preview.tsx | 2 +- src/utils/camera.ts | 38 +++++---- .../components/file/file-choose-button.vue | 5 +- src/vue/components/file/file-preview.vue | 2 +- testCafe/questions/file.ts | 27 +++++++ tests/markup/snapshots/file-2-png.snap.html | 4 +- .../file-2-zip-png-file-navigator.snap.html | 6 +- .../snapshots/file-2-zip-png-ro.snap.html | 38 ++++++++- .../markup/snapshots/file-2-zip-png.snap.html | 6 +- tests/markup/snapshots/file-2-zip.snap.html | 6 +- tests/markup/snapshots/file-2.snap.html | 4 +- tests/markup/snapshots/file-camera.snap.html | 4 +- .../snapshots/file-image-size.snap.html | 4 +- .../markup/snapshots/file-mob2-png.snap.html | 4 +- .../snapshots/file-mob2-zip-png-ro.snap.html | 38 ++++++++- .../snapshots/file-mob2-zip-png.snap.html | 6 +- .../markup/snapshots/file-mob2-zip.snap.html | 6 +- tests/markup/snapshots/file-mob2.snap.html | 4 +- .../markup/snapshots/file-mode-both.snap.html | 4 +- .../snapshots/file-mode-camera.snap.html | 4 +- .../snapshots/file-modern-png.snap.html | 4 +- .../snapshots/file-modern-zip-png.snap.html | 4 +- .../snapshots/file-modern-zip.snap.html | 4 +- tests/markup/snapshots/file-modern.snap.html | 4 +- tests/markup/snapshots/file-png.snap.html | 4 +- tests/markup/snapshots/file-zip-png.snap.html | 4 +- tests/markup/snapshots/file-zip.snap.html | 4 +- tests/markup/snapshots/file.snap.html | 4 +- tests/questionFileTests.ts | 75 +++++++++++++++++- .../file-question-both-mode-answered.png | Bin 13935 -> 13939 bytes .../etalons/file-question-long-name.png | Bin 16630 -> 16640 bytes .../file-question-multiple-big-images.png | Bin 0 -> 53033 bytes .../file-question-multiple-navigator.png | Bin 56382 -> 56408 bytes .../file-question-multiple-small-images.png | Bin 0 -> 27871 bytes .../etalons/file-question-multiple.png | Bin 54503 -> 54526 bytes .../file-question-single-big-image.png | Bin 0 -> 122055 bytes .../etalons/file-question-single-file.png | Bin 14656 -> 14668 bytes .../file-question-single-small-image.png | Bin 0 -> 28507 bytes .../defaultV2/etalons/file-question-video.png | Bin 9662 -> 9606 bytes visualRegressionTests/tests/defaultV2/file.ts | 39 +++++++++ 52 files changed, 343 insertions(+), 112 deletions(-) create mode 100644 testCafe/questions/file.ts create mode 100644 visualRegressionTests/tests/defaultV2/etalons/file-question-multiple-big-images.png create mode 100644 visualRegressionTests/tests/defaultV2/etalons/file-question-multiple-small-images.png create mode 100644 visualRegressionTests/tests/defaultV2/etalons/file-question-single-big-image.png create mode 100644 visualRegressionTests/tests/defaultV2/etalons/file-question-single-small-image.png diff --git a/packages/survey-angular-ui/src/components/file/choose-file.component.html b/packages/survey-angular-ui/src/components/file/choose-file.component.html index 2e61f68897..2f11cb74ad 100644 --- a/packages/survey-angular-ui/src/components/file/choose-file.component.html +++ b/packages/survey-angular-ui/src/components/file/choose-file.component.html @@ -1,8 +1,8 @@ -
{{ question.chooseButtonText }} -
+
\ No newline at end of file diff --git a/packages/survey-angular-ui/src/components/file/file-preview.component.html b/packages/survey-angular-ui/src/components/file/file-preview.component.html index 5b00c0675e..de0fefb3ed 100644 --- a/packages/survey-angular-ui/src/components/file/file-preview.component.html +++ b/packages/survey-angular-ui/src/components/file/file-preview.component.html @@ -9,7 +9,7 @@ val.name }} -
+
File preview -
{{ question.chooseButtonText }} -
+