プロジェクト

全般

プロフィール

Vote #80091

完了

Add "<< me >>" option to user format issue custom fields

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

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

0%

予定工数:
category_id:
14
version_id:
127
issue_org_id:
31444
author_id:
332
assigned_to_id:
1
comments:
7
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Currently, user format custom fields list member of the project, but "<< me >>" option which you can see in the Assignee field is not included in the list.

I think custom fields should have "<< me >>" option like the Assignee field for better usability and UI consistency.


journals

I attached a patch to add this feature.
Add "<< me >>" only when login user is included in the options.
!{width: 500px; border: 1px solid #ccc}result.png!
--------------------------------------------------------------------------------
LGTM. Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
confirmed.
I think there is no problem.
--------------------------------------------------------------------------------
akitani ryo wrote:
> confirmed.
> I think there is no problem.

Thank you for confirming!
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------
The test fails randomly.

<pre>
Failure:
Redmine::UserFieldFormatTest#test_possible_values_options_should_return_project_members_and_me_if_logged_in [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/sqlite3/RUBY_VER/ruby-2.6/test/unit/lib/redmine/field_format/user_field_format_test.rb:89]:
--- expected
+++ actual
@@ -1 +1 @@
-["<< me >>", "Dave Lopper", "John Smith"]
+["<< moi >>", "Dave Lopper", "John Smith"]

bin/rails test test/unit/lib/redmine/field_format/user_field_format_test.rb:84
</pre>

It can be fixed with the following patch.

<pre><code class="diff">
Index: test/unit/lib/redmine/field_format/user_field_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/user_field_format_test.rb (リビジョン 18300)
+++ test/unit/lib/redmine/field_format/user_field_format_test.rb (作業コピー)
@@ -82,6 +82,7 @@
end

def test_possible_values_options_should_return_project_members_and_me_if_logged_in
+ ::I18n.locale = 'en'
User.current = User.find(2)
field = IssueCustomField.new(:field_format => 'user')
project = Project.find(1)
</code></pre>
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------

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

いいね!0
いいね!0