プロジェクト

全般

プロフィール

Vote #79412

完了

Add link to container on attachment preview

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

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

0%

予定工数:
category_id:
19
version_id:
99
issue_org_id:
29190
author_id:
14446
assigned_to_id:
332
comments:
7
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

h4. Status quo

When displaying the attachment preview, there's currently no on-page way to navigate back to the attachment container. We're relying on the browser back button here, which might be impossible, if somebody followed a direct link to the attachment.

The reason, why this is currently not implemented, is probably because attachments may belong to many different Redmine records types and generating a link is therefore not straight forward. Also, plugins may bring their own attachable objects, which need to be considered.

h4. Proposal

The attached patch, adds a general @link_to_record@ helper, which would generate general purpose links to any object within in Redmine. This is further refined with the @link_to_attachment_container@ helper, which behaves slightly different for projects and versions. @link_to_record@ for projects links to the project overview, @link_to_attachment_container@ links to the files tab.

This method can then be used on the attachment view, to link to the proper container.

These new methods are currently implemented for all records within Redmine core, which are either attachable or customizable (since Redmine 4.0 will also support file custom fields).

h4. Extensibility

The methods are implemented via an Hash of Procs. This should enable plugin authors to extend them easily, if their records can have attachments as well.

In the future, @link_to_record@ may be further extended to support all Redmine records. It may then become a general purpose helper for whenever a generic link to an object is needed.

h4. Tests

The patch provides tests for the new helpers. Futhermore, one other integration test needed to change, since the tested view is now slightly different.

h4. Preview

This is how it would look like:

!link-to-container.png!


journals

This patch also handles file custom field attachments for groups. In theory this would not be necessary, since there is no UI to navigate to such an attachment. Therefore I've also proposed #29189, which would add this UI.
--------------------------------------------------------------------------------
It is a nice improvement! I have been annoyed for a long time that there is no way to know/see the container object of an attachment.
--------------------------------------------------------------------------------
Yes, this was also a common source of questions for "Planio":https://plan.io/ customers.
--------------------------------------------------------------------------------
+ 1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed. Thank you for improving Redmine.
--------------------------------------------------------------------------------

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


related_issues

duplicates,Closed,20422,Backlink for thumbnail-macro

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

  • カテゴリAttachments_19 にセット
  • 対象バージョン4.0.0_99 にセット

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

いいね!0
いいね!0