From 4f018115bfb3be3a78fef36b03c989de0ee0341c Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Mon, 16 Feb 2026 15:53:17 +0900 Subject: [PATCH 2/2] Improve attachment upload error visibility --- app/assets/javascripts/attachments.js | 3 +++ app/assets/stylesheets/application.css | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/app/assets/javascripts/attachments.js b/app/assets/javascripts/attachments.js index 1650386b8..11e104b89 100644 --- a/app/assets/javascripts/attachments.js +++ b/app/assets/javascripts/attachments.js @@ -50,6 +50,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { function onLoadstart(e) { fileSpan.removeClass('ajax-waiting'); fileSpan.addClass('ajax-loading'); + fileSpan.removeClass('attachment-upload-error'); attachmentIcon.addClass('svg-loader'); updateSVGIcon(attachmentIcon[0], 'loader') $('input:submit', $(this).parents('form')).attr('disabled', 'disabled'); @@ -73,11 +74,13 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { addInlineAttachmentMarkup(file); progressSpan.progressbar( 'value', 100 ).remove(); fileSpan.find('input.description, a').css('display', 'inline-flex'); + fileSpan.removeClass('attachment-upload-error'); updateSVGIcon(attachmentIcon[0], 'file'); }) .fail(function(result) { $('').insertAfter(progressSpan).text(result.statusText); progressSpan.remove(); + fileSpan.addClass('attachment-upload-error'); updateSVGIcon(attachmentIcon[0], 'warning'); }).always(function() { ajaxUpload.uploading--; diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3c01a73ff..161e7d589 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1259,6 +1259,13 @@ span.required {color: var(--oc-red-9);} /* ToDo: delete this line when legacy icons are deleted */ .attachments_fields .icon-attachment, #existing-attachments .icon-attachment {background-image: none; padding-inline-start: 0} .attachments_fields input.filename, #existing-attachments .filename {border: 0; inline-size: 250px; color: var(--oc-gray-7); background-color: inherit; } +.attachments_fields > span.attachment-upload-error, +.attachments_fields > span.attachment-upload-error input.filename { + color: var(--oc-pink-9); +} +.attachments_fields > span.attachment-upload-error svg.icon-svg { + stroke: currentColor; +} .tabular input.filename {max-inline-size: 75% !important;} .attachments_fields div.ui-progressbar { inline-size: 100px; -- 2.50.1