diff --git a/administrator/components/com_media/resources/scripts/app/Api.es6.js b/administrator/components/com_media/resources/scripts/app/Api.es6.js index 783f46fa5a4a2..cc536ba37388e 100644 --- a/administrator/components/com_media/resources/scripts/app/Api.es6.js +++ b/administrator/components/com_media/resources/scripts/app/Api.es6.js @@ -51,6 +51,18 @@ function handleError(error) { const response = JSON.parse(error.response); if (response.message) { notifications.error(response.message); + // Check for App messages queue + if (response.messages) { + Object.keys(response.messages).forEach((type) => { + response.messages[type].forEach((message) => { + if (type === 'error') { + notifications.error(message); + } else { + notifications.notify(message); + } + }); + }); + } } else { switch (error.status) { case 409: diff --git a/administrator/components/com_media/resources/scripts/app/Notifications.es6.js b/administrator/components/com_media/resources/scripts/app/Notifications.es6.js index fd663763d0f34..d12b27ee9cc2c 100644 --- a/administrator/components/com_media/resources/scripts/app/Notifications.es6.js +++ b/administrator/components/com_media/resources/scripts/app/Notifications.es6.js @@ -20,7 +20,7 @@ function notify(message, options) { } const notifications = { - /* Send and success notification */ + /* Send a success notification */ success: (message, options) => { notify(message, { type: 'message', // @todo rename it to success @@ -38,6 +38,15 @@ const notifications = { }); }, + /* Send a general notification */ + notify: (message, options) => { + notify(message, { + type: 'message', + dismiss: true, + ...options, + }); + }, + /* Ask the user a question */ ask: (message) => window.confirm(message), }; diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index a961fdbeb6e83..4ffb5eb628ea3 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -683,7 +683,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file." JLIB_MEDIA_ERROR_WARNFILENAME="File name must only have alphanumeric characters and no spaces." JLIB_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload. You can change the limits for your site in the component options." JLIB_MEDIA_ERROR_WARNFILETYPE="This file type is not supported." -JLIB_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found." +JLIB_MEDIA_ERROR_WARNIEXSS="The file looks suspicious, therefore cannot be uploaded." JLIB_MEDIA_ERROR_WARNINVALID_IMG="Not a valid image." JLIB_MEDIA_ERROR_WARNINVALID_MIME="Invalid mime type detected." JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE="Illegal mime type detected: %s" diff --git a/language/en-GB/lib_joomla.ini b/language/en-GB/lib_joomla.ini index f26ca5605820f..d9ce4cba49bb2 100644 --- a/language/en-GB/lib_joomla.ini +++ b/language/en-GB/lib_joomla.ini @@ -680,7 +680,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file." JLIB_MEDIA_ERROR_WARNFILENAME="File name must only have alphanumeric characters and no spaces." JLIB_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload." JLIB_MEDIA_ERROR_WARNFILETYPE="This file type is not supported." -JLIB_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found." +JLIB_MEDIA_ERROR_WARNIEXSS="The file looks suspicious, therefore cannot be uploaded." JLIB_MEDIA_ERROR_WARNINVALID_IMG="Not a valid image." JLIB_MEDIA_ERROR_WARNINVALID_MIME="Invalid mime type detected." JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE="Illegal mime type detected: %s"