Project

General

Profile

Actions

Feature #32240

closed

Add download buttons in Files columns of the issues list

Added by Go MAEDA over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues list
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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:


Files

before@2x.png (45.4 KB) before@2x.png Go MAEDA, 2019-10-11 07:16
after@2x.png (50.3 KB) after@2x.png Go MAEDA, 2019-10-11 07:16
32240_add_download_button.patch (2.64 KB) 32240_add_download_button.patch Yuichi HARADA, 2019-11-07 06:06
32240_add_download_button_v2.patch (2.79 KB) 32240_add_download_button_v2.patch Yuichi HARADA, 2019-11-08 01:59
32240_add_download_button_v3.patch (3.45 KB) 32240_add_download_button_v3.patch Yuichi HARADA, 2020-02-05 02:56
32240_add_download_button_v4.patch (3.51 KB) 32240_add_download_button_v4.patch Go MAEDA, 2020-02-05 07:48
Actions #1

Updated by Anonymous over 4 years ago

+1 ofc ;-)

Actions #2

Updated by Mischa The Evil over 4 years 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?

Actions #3

Updated by Go MAEDA over 4 years 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).

Actions #4

Updated by Yuichi HARADA over 4 years 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.

Actions #5

Updated by Marius BÄ‚LTEANU over 4 years 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?

Actions #6

Updated by Yuichi HARADA over 4 years 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.

Actions #7

Updated by Go MAEDA over 4 years ago

  • Target version set to Candidate for next major release
Actions #8

Updated by Go MAEDA about 4 years ago

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

LGTM. Setting the target version to 4.2.0.

Actions #9

Updated by Go MAEDA about 4 years 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
Actions #10

Updated by Yuichi HARADA about 4 years 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

Actions #11

Updated by Go MAEDA about 4 years 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
Actions #12

Updated by Go MAEDA about 4 years ago

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

Committed the patch. Thank you for your contribution.

Actions

Also available in: Atom PDF