プロジェクト

全般

プロフィール

Vote #80397

完了

Add download buttons in Files columns of the issues list

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues list_58
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
58
version_id:
152
issue_org_id:
32240
author_id:
332
assigned_to_id:
332
comments:
12
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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:
!{width: 823px; border: 1px solid #ccc;}.before@2x.png!

After:
!{width: 823px; border: 1px solid #ccc;}.after@2x.png!


journals

+1 ofc ;-)
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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).
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
LGTM. Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
The patch breaks a test.

<pre>
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
</pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> The patch breaks a test.
>
> [...]

Sorry, I fixed the test as follows.

<pre><code class="diff">
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

</code></pre>
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
Committed the patch. Thank you for your contribution.
--------------------------------------------------------------------------------

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0