From 257c7fed2be2c632937983fac23418057d1776a0 Mon Sep 17 00:00:00 2001 From: Max Bischof Date: Thu, 24 Aug 2023 08:56:34 +0200 Subject: [PATCH 01/89] Call preview api for display of preview --- .../components/FileContentElement.vue | 109 +++++++++--------- .../components/FileContentElementDisplay.vue | 30 ++--- .../components/FileContentElementEdit.vue | 28 +++-- .../components/FileContentElementInit.vue | 4 +- .../components/ImageFileDisplay.vue | 28 +++-- .../components/types/file-properties.ts | 7 ++ src/utils/fileHelper.ts | 10 ++ src/utils/fileHelper.unit.ts | 33 +++++- 8 files changed, 156 insertions(+), 93 deletions(-) create mode 100644 src/components/feature-board-file-element/components/types/file-properties.ts diff --git a/src/components/feature-board-file-element/components/FileContentElement.vue b/src/components/feature-board-file-element/components/FileContentElement.vue index bb0d461ba1..c2266f6503 100644 --- a/src/components/feature-board-file-element/components/FileContentElement.vue +++ b/src/components/feature-board-file-element/components/FileContentElement.vue @@ -10,58 +10,54 @@ tabindex="0" @keydown.up.down="onKeydownArrow" > -
- -
-
+ + + diff --git a/src/components/feature-board-file-element/components/ImageFileDisplay.vue b/src/components/feature-board-file-element/components/ImageFileDisplay.vue index 5586ce46f6..273536849a 100644 --- a/src/components/feature-board-file-element/components/ImageFileDisplay.vue +++ b/src/components/feature-board-file-element/components/ImageFileDisplay.vue @@ -19,10 +19,7 @@ />
From 6cfa827e2ca06dbce0b09ef20d5f2aa667f9c3f6 Mon Sep 17 00:00:00 2001 From: Max Bischof Date: Thu, 24 Aug 2023 11:01:44 +0200 Subject: [PATCH 03/89] Generate file storage client --- src/fileStorageApi/v3/models/file-record-scan-status.ts | 1 + src/fileStorageApi/v3/models/preview-status.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/fileStorageApi/v3/models/file-record-scan-status.ts b/src/fileStorageApi/v3/models/file-record-scan-status.ts index 2a251ee6fb..357f7f87d3 100644 --- a/src/fileStorageApi/v3/models/file-record-scan-status.ts +++ b/src/fileStorageApi/v3/models/file-record-scan-status.ts @@ -23,6 +23,7 @@ export enum FileRecordScanStatus { PENDING = 'pending', VERIFIED = 'verified', BLOCKED = 'blocked', + WONT_CHECK = 'wont_check', ERROR = 'error' } diff --git a/src/fileStorageApi/v3/models/preview-status.ts b/src/fileStorageApi/v3/models/preview-status.ts index d0c85afcc0..a7e8fc59fa 100644 --- a/src/fileStorageApi/v3/models/preview-status.ts +++ b/src/fileStorageApi/v3/models/preview-status.ts @@ -23,6 +23,7 @@ export enum PreviewStatus { PREVIEW_POSSIBLE = 'preview_possible', AWAITING_SCAN_STATUS = 'awaiting_scan_status', PREVIEW_NOT_POSSIBLE_SCAN_STATUS_ERROR = 'preview_not_possible_scan_status_error', + PREVIEW_NOT_POSSIBLE_SCAN_STATUS_WONT_CHECK = 'preview_not_possible_scan_status_wont_check', PREVIEW_NOT_POSSIBLE_SCAN_STATUS_BLOCKED = 'preview_not_possible_scan_status_blocked', PREVIEW_NOT_POSSIBLE_WRONG_MIME_TYPE = 'preview_not_possible_wrong_mime_type' } From b9b84efceef1c92bed94b4c5385fde42e0611b05 Mon Sep 17 00:00:00 2001 From: Max Bischof Date: Thu, 24 Aug 2023 12:08:02 +0200 Subject: [PATCH 04/89] Add notification for preview status --- .../components/FileContentElement.vue | 5 +- .../components/FileContentElementAlert.vue | 62 ++++++++++++++++--- src/locales/de.json | 3 + 3 files changed, 58 insertions(+), 12 deletions(-) diff --git a/src/components/feature-board-file-element/components/FileContentElement.vue b/src/components/feature-board-file-element/components/FileContentElement.vue index c2266f6503..ff0430e895 100644 --- a/src/components/feature-board-file-element/components/FileContentElement.vue +++ b/src/components/feature-board-file-element/components/FileContentElement.vue @@ -10,7 +10,7 @@ tabindex="0" @keydown.up.down="onKeydownArrow" > - diff --git a/src/components/feature-board-file-element/components/FileContentElementAlert.vue b/src/components/feature-board-file-element/components/FileContentElementAlert.vue index a43fcdfd9f..1976277041 100644 --- a/src/components/feature-board-file-element/components/FileContentElementAlert.vue +++ b/src/components/feature-board-file-element/components/FileContentElementAlert.vue @@ -1,27 +1,71 @@ - diff --git a/src/components/feature-board-file-element/shared/types/file-properties.ts b/src/components/feature-board-file-element/shared/types/file-properties.ts index 2873a4f7d9..a62138b1c1 100644 --- a/src/components/feature-board-file-element/shared/types/file-properties.ts +++ b/src/components/feature-board-file-element/shared/types/file-properties.ts @@ -7,4 +7,5 @@ export interface FileProperties { previewUrl?: string; previewStatus: PreviewStatus; isDownloadAllowed: boolean; + alternativeText?: string; } diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index 48c7346b1b..4830164f12 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -1573,6 +1573,12 @@ export interface FileContentBody { * @memberof FileContentBody */ caption: string; + /** + * + * @type {string} + * @memberof FileContentBody + */ + alternativeText?: string; } /** * @@ -1586,6 +1592,12 @@ export interface FileElementContent { * @memberof FileElementContent */ caption: string; + /** + * + * @type {string} + * @memberof FileElementContent + */ + alternativeText: string; } /** * diff --git a/tests/test-utils/factory/fileElementContentFactory.ts b/tests/test-utils/factory/fileElementContentFactory.ts index f9a9c927c0..27b04029b8 100644 --- a/tests/test-utils/factory/fileElementContentFactory.ts +++ b/tests/test-utils/factory/fileElementContentFactory.ts @@ -4,5 +4,6 @@ import { Factory } from "fishery"; export const fileElementContent = Factory.define( ({ sequence }) => ({ caption: "caption", + alternativeText: "alternativeText", }) ); From b392836008e316a6960918576645d39762030632 Mon Sep 17 00:00:00 2001 From: KalliSfak Date: Fri, 8 Sep 2023 10:14:21 +0200 Subject: [PATCH 50/89] added fileelementresponse --- .../FileContentElement.vue | 2 +- .../content/display/FileDisplay.vue | 2 +- .../display/image-display/AlternativeText.vue | 26 +++++++++---------- .../display/image-display/ImageDisplay.vue | 10 +++---- .../shared/types/file-properties.ts | 3 ++- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/components/feature-board-file-element/FileContentElement.vue b/src/components/feature-board-file-element/FileContentElement.vue index 67cb936318..4122d0879d 100644 --- a/src/components/feature-board-file-element/FileContentElement.vue +++ b/src/components/feature-board-file-element/FileContentElement.vue @@ -98,7 +98,7 @@ export default defineComponent({ isDownloadAllowed: isDownloadAllowed( fileRecord.value.securityCheckStatus ), - alternativeText: props.element.content.alternativeText, + element: props.element, }; }); diff --git a/src/components/feature-board-file-element/content/display/FileDisplay.vue b/src/components/feature-board-file-element/content/display/FileDisplay.vue index 1c8e93757e..219ef68acf 100644 --- a/src/components/feature-board-file-element/content/display/FileDisplay.vue +++ b/src/components/feature-board-file-element/content/display/FileDisplay.vue @@ -5,7 +5,7 @@ :preview-url="fileProperties.previewUrl" :name="fileProperties.name" :is-edit-mode="isEditMode" - :alternativeText="fileProperties.alternativeText" + :element="fileProperties.element" /> diff --git a/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue b/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue index dae8746fba..8b28158fa5 100644 --- a/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue +++ b/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue @@ -1,12 +1,11 @@ diff --git a/src/components/feature-board-file-element/shared/types/file-properties.ts b/src/components/feature-board-file-element/shared/types/file-properties.ts index a62138b1c1..98f903fc1f 100644 --- a/src/components/feature-board-file-element/shared/types/file-properties.ts +++ b/src/components/feature-board-file-element/shared/types/file-properties.ts @@ -1,4 +1,5 @@ import { PreviewStatus } from "@/fileStorageApi/v3"; +import { FileElementResponse } from "@/serverApi/v3"; export interface FileProperties { name: string; @@ -7,5 +8,5 @@ export interface FileProperties { previewUrl?: string; previewStatus: PreviewStatus; isDownloadAllowed: boolean; - alternativeText?: string; + element: FileElementResponse; } From 9201ec0b81ce256a989c4e61ee6e60fe4172f4f7 Mon Sep 17 00:00:00 2001 From: KalliSfak Date: Fri, 8 Sep 2023 11:53:07 +0200 Subject: [PATCH 51/89] rename translation names --- src/locales/de.json | 4 ++-- src/locales/en.json | 4 ++-- src/locales/es.json | 4 ++-- src/locales/uk.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/locales/de.json b/src/locales/de.json index 91b9636339..4d64ab02f5 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -23,8 +23,6 @@ "common.actions.download.v1.3": "Herunterladen (CC v1.3)", "common.actions.logout": "Abmelden", "common.labels.admin": "Admin(s)", - "common.labels.alternativeText": "Alternativtext", - "common.labels.altDescription": "Beschreiben Sie dieses Bild für Personen mit Sehbehinderung.", "common.labels.updateAt": "Aktualisiert:", "common.labels.createAt": "Erstellt:", "common.labels.birthdate": "Geburtsdatum", @@ -784,6 +782,8 @@ "components.molecules.TaskItemMenu.labels.createdAt": "Erstellt", "components.cardElement.deleteElement": "löschen", "components.cardElement.dragElement": "verschieben", + "components.cardElement.fileElement.alternativeText": "Alternativtext", + "components.cardElement.fileElement.altDescription": "Beschreiben Sie dieses Bild für Personen mit Sehbehinderung.", "components.cardElement.fileElement.virusDetected": "Datei wurde aufgrund eines Virenverdachts gesperrt.", "components.cardElement.fileElement.awaitingScan": "Vorschau wird nach erfolgreicher Virenprüfung angezeigt. Aktuell wird die Datei gescannt.", "components.cardElement.fileElement.scanError": "Fehler bei der Virenprüfung. Vorschau kann nicht erstellt werden. Datei bitte erneut hochladen.", diff --git a/src/locales/en.json b/src/locales/en.json index 977472a7ca..7974e7a4e8 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -23,8 +23,6 @@ "common.actions.download.v1.3": "Download (CC v1.3)", "common.actions.logout": "Logout", "common.labels.admin": "", - "common.labels.alternativeText": "Alternative Text", - "common.labels.altDescription": "Describe this picture for people with visual impairments.", "common.labels.updateAt": "Updated:", "common.labels.createAt": "Created:", "common.labels.birthdate": "Date of birth", @@ -782,6 +780,8 @@ "components.molecules.TaskItemMenu.labels.createdAt": "Created", "components.cardElement.deleteElement": "Delete element", "components.cardElement.dragElement": "Move element", + "components.cardElement.fileElement.alternativeText": "Alternative Text", + "components.cardElement.fileElement.altDescription": "Describe this picture for people with visual impairments.", "components.cardElement.fileElement.virusDetected": "File has been locked due to a suspected virus.", "components.cardElement.fileElement.awaitingScan": "Preview is displayed after a successful virus scan. The file is currently being scanned.", "components.cardElement.fileElement.scanError": "Error during virus check. Preview cannot be created. Please upload the file again.", diff --git a/src/locales/es.json b/src/locales/es.json index bfeeb10560..5259341704 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -23,8 +23,6 @@ "common.actions.shareCourse": "Compartir copia de la cotización", "common.actions.scrollToTop": "Desplazarse hacia arriba", "common.labels.admin": "Admin(s)", - "common.labels.alternativeText": "Texto alternativo", - "common.labels.altDescription": "Describe esta imagen para personas con discapacidad visual.", "common.labels.updateAt": "Actualizado:", "common.labels.createAt": "Creado:", "common.labels.birthdate": "Fecha de nacimiento", @@ -792,6 +790,8 @@ "components.molecules.TaskItemMenu.labels.createdAt": "Creado", "components.cardElement.deleteElement": "Suprimir elemento", "components.cardElement.dragElement": "Mover elemento", + "components.cardElement.fileElement.alternativeText": "Texto alternativo", + "components.cardElement.fileElement.altDescription": "Describe esta imagen para personas con discapacidad visual.", "components.cardElement.fileElement.virusDetected": "Se ha bloqueado el archivo debido a un virus sospechoso.", "components.cardElement.fileElement.awaitingScan": "La vista previa se muestra después de una comprobación de virus correcta. El fichero se está analizando actualmente.", "components.cardElement.fileElement.scanError": "Error durante la comprobación de virus. No se puede crear la vista previa. Vuelva a cargar el archivo.", diff --git a/src/locales/uk.json b/src/locales/uk.json index e287d7e0b7..b504825561 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -23,8 +23,6 @@ "common.actions.download.v1.3": "Завантажити (CC v1.3)", "common.actions.logout": "Вийти з аккаунта", "common.labels.admin": "адміністратор(и)", - "common.labels.alternativeText": "альтернативний текст", - "common.labels.altDescription": "Опишіть цю картинку для людей з вадами зору.", "common.labels.birthdate": "Дата народження", "common.labels.updateAt": "Оновлено:", "common.labels.createAt": "Створено:", @@ -311,6 +309,8 @@ "components.molecules.VCustomChipTimeRemaining.hintMinutes": "", "components.cardElement.deleteElement": "Видалити елемент", "components.cardElement.dragElement": "Перемістити елемент", + "components.cardElement.fileElement.alternativeText": "альтернативний текст", + "components.cardElement.fileElement.altDescription": "Опишіть цю картинку для людей з вадами зору.", "components.cardElement.fileElement.virusDetected": "Файл було заблоковано через підозру на вірус.", "components.cardElement.fileElement.awaitingScan": "Попередній перегляд відображається після успішної перевірки на віруси. Наразі відбувається перевірка файлу.", "components.cardElement.fileElement.scanError": "Помилка під час перевірки на віруси. Неможливо створити попередній перегляд. Будь ласка, завантажте файл ще раз.", From 7d3d84f1423094d93d19b43c7b2ca1b3b97aff0d Mon Sep 17 00:00:00 2001 From: KalliSfak Date: Fri, 8 Sep 2023 11:55:01 +0200 Subject: [PATCH 52/89] add text for empty alt --- .../display/image-display/AlternativeText.vue | 8 +++----- .../display/image-display/ImageDisplay.vue | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue b/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue index 8b28158fa5..d1a52540b8 100644 --- a/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue +++ b/src/components/feature-board-file-element/content/display/image-display/AlternativeText.vue @@ -4,11 +4,9 @@ v-model="modelValue.alternativeText" class="pa-0 ma-0 v-secondary-lighten1" rows="1" - :label="$t('common.labels.alternativeText')" + :label="$t('components.cardElement.fileElement.altDescription')" + :placeholder="$t('components.cardElement.fileElement.alternativeText')" > - {{ - $t("common.labels.altDescription") - }} @@ -22,7 +20,7 @@ export default defineComponent({ props: { element: { type: Object as PropType, required: true }, }, - setup(props, { emit }) { + setup(props) { const { modelValue } = useContentElementState({ element: props.element, isEditMode: true, diff --git a/src/components/feature-board-file-element/content/display/image-display/ImageDisplay.vue b/src/components/feature-board-file-element/content/display/image-display/ImageDisplay.vue index 8065fc6971..59456d4f76 100644 --- a/src/components/feature-board-file-element/content/display/image-display/ImageDisplay.vue +++ b/src/components/feature-board-file-element/content/display/image-display/ImageDisplay.vue @@ -1,6 +1,6 @@