Feature #32240

Add download buttons in Files columns of the issues list

Added by Go MAEDA 9 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues list
Target version:4.2.0
Resolution:Fixed

Description

You can add the "Files" column to the issues list. In the column, names of the attached files are shown and each filename is linked to the preview page of the file.

I think the UI can be improved to place a download icon beside the filename, like attachments on issue pages or wiki pages. Currently, you need to click twice to download the file (1. click the filename on the issues list, 2. click the download link on the preview page). If the column has download buttons, you can reduce an extra one click.

Before:

After:

before@2x.png (45.4 KB) Go MAEDA, 2019-10-11 07:16

after@2x.png (50.3 KB) Go MAEDA, 2019-10-11 07:16

32240_add_download_button.patch Magnifier (2.64 KB) Yuichi HARADA, 2019-11-07 06:06

32240_add_download_button_v2.patch Magnifier (2.79 KB) Yuichi HARADA, 2019-11-08 01:59

32240_add_download_button_v3.patch Magnifier (3.45 KB) Yuichi HARADA, 2020-02-05 02:56

32240_add_download_button_v4.patch Magnifier (3.51 KB) Go MAEDA, 2020-02-05 07:48

Associated revisions

Revision 19500
Added by Go MAEDA 5 months ago

Add download buttons in Files columns of the issues list (#32240).

Patch by Yuichi HARADA.

History

#1 Updated by Anonymous 9 months ago

+1 ofc ;-)

#2 Updated by Mischa The Evil 9 months ago

Go MAEDA wrote:

[...] Currently, you need to click twice to download the file [...]

I am not able to test this currently, but what about right-click -> save as? Doesn't that work in any way?

#3 Updated by Go MAEDA 9 months ago

Mischa The Evil wrote:

I am not able to test this currently, but what about right-click -> save as? Doesn't that work in any way?

Unfortunately, it does not work. It saves the HTML content of the preview page (AttachmentsController#show).

#4 Updated by Yuichi HARADA 8 months ago

Go MAEDA wrote:

If the column has download buttons, you can reduce an extra one click.

Added download buttons to "Files" column. I attached a patch.

#5 Updated by Marius BALTEANU 8 months ago

In my opinion, there are too many icons in the listing which make the "Files" column more obvious than the other columns (my first reaction is look on that column). If we really want to have the download links available in the listing, what about of showing the icon only on hover?

#6 Updated by Yuichi HARADA 8 months ago

Marius BALTEANU wrote:

In my opinion, there are too many icons in the listing which make the "Files" column more obvious than the other columns (my first reaction is look on that column). If we really want to have the download links available in the listing, what about of showing the icon only on hover?

Thank you for your feedback. Fixed to show the download icon only when hovering.

#7 Updated by Go MAEDA 8 months ago

  • Target version set to Candidate for next major release

#8 Updated by Go MAEDA 5 months ago

  • Target version changed from Candidate for next major release to 4.2.0

LGTM. Setting the target version to 4.2.0.

#9 Updated by Go MAEDA 5 months ago

The patch breaks a test.

F

Failure:
AttachmentFieldFormatTest#test_create_with_attachment [/Users/maeda/redmines/trunk/test/integration/lib/redmine/field_format/attachment_format_test.rb:85]:
Expected: 1
  Actual: 2

bin/rails test test/integration/lib/redmine/field_format/attachment_format_test.rb:54

#10 Updated by Yuichi HARADA 5 months ago

Go MAEDA wrote:

The patch breaks a test.

[...]

Sorry, I fixed the test as follows.

diff --git a/test/integration/lib/redmine/field_format/attachment_format_test.rb b/test/integration/lib/redmine/field_format/attachment_format_test.rb
index 61f439894..ccb33a9b6 100644
--- a/test/integration/lib/redmine/field_format/attachment_format_test.rb
+++ b/test/integration/lib/redmine/field_format/attachment_format_test.rb
@@ -81,7 +81,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
     assert_response :success

     # link to the attachment
-    link = css_select(".cf_#{@field.id} .value a")
+    link = css_select(".cf_#{@field.id} .value a:not(.icon-download)")
     assert_equal 1, link.size
     assert_equal "testfile.txt", link.text

#11 Updated by Go MAEDA 5 months ago

I have slightly updated the patch as follows:

  • Fixed a "Layout/ArgumentAlignment" RuboCop warning in app/helpers/application_helper.rb
  • Changed the CSS to hide the icon from "display: none;" from "visibility: hide;" in order to prevent the table cell width from changing on mouse hover

#12 Updated by Go MAEDA 5 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for your contribution.

Also available in: Atom PDF