From 59384a3d5caa98d6f44fb5a80f5d3186dd457283 Mon Sep 17 00:00:00 2001 From: Tamara Steinwender <tamara.steinwender@tugraz.at> Date: Wed, 13 Jul 2022 11:25:13 +0200 Subject: [PATCH] Make error messages red with an icon in nextcloud filepicker --- .../file-handling/src/nextcloud-file-picker.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js index 28aa479b..b020ffa1 100644 --- a/packages/file-handling/src/nextcloud-file-picker.js +++ b/packages/file-handling/src/nextcloud-file-picker.js @@ -1641,10 +1641,18 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { if(error.response && error.response.status) { switch (error.response.status) { case 403: - this.statusText = i18n.t('nextcloud-file-picker.forbidden'); + this.statusText = html` + <span class="error"> + <dbp-icon name="warning-high"></dbp-icon> + ${i18n.t('nextcloud-file-picker.forbidden')} + </span>`; return; case 415: - this.statusText = i18n.t('nextcloud-file-picker.file-error'); + this.statusText = html` + <span class="error"> + <dbp-icon name="warning-high"></dbp-icon> + ${i18n.t('nextcloud-file-picker.file-error')} + </span>`; this.sendSetPropertyEvent('analytics-event', { category: 'FileHandlingNextcloud', action: 'UploadFilesPutfilesError', @@ -1656,7 +1664,11 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { } } - this.statusText = i18n.t('nextcloud-file-picker.file-upload-error'); + this.statusText = html` + <span class="error"> + <dbp-icon name="warning-high"></dbp-icon> + ${i18n.t('nextcloud-file-picker.file-upload-error')} + </span>`; this.sendSetPropertyEvent('analytics-event', { category: 'FileHandlingNextcloud', action: 'UploadFilesPutfilesError', -- GitLab