プロジェクト

全般

プロフィール

Vote #81226

完了

Filter list of recent projects in the project jump box

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

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

0%

予定工数:
category_id:
11
version_id:
162
issue_org_id:
34595
author_id:
2784
assigned_to_id:
332
comments:
7
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

The attached patch makes sure that only currently visible projects are included in the project jump box, removing archived projects and projects the user is not allowed to view anymore.

The patch should apply cleanly on current trunk.


journals

--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------
The patch lacks one dot after "visible". Here is an updated patch.

<pre><code class="diff">
Index: lib/redmine/project_jump_box.rb
===================================================================
--- lib/redmine/project_jump_box.rb (リビジョン 20737)
+++ lib/redmine/project_jump_box.rb (作業コピー)
@@ -31,6 +31,7 @@
def recently_used_projects
project_ids = recently_used_project_ids
Project.where(id: project_ids).
+ visible.
index_by(&:id).
values_at(*project_ids). # sort according to stored order
compact
</code></pre>
--------------------------------------------------------------------------------
Ah sorry :(

I extracted the patch from our internal Redmine version where we have other changes in this code area. Your updated patch should work.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Some tests fail:

<pre><code class="ruby">
root@d7a989d3c810:/work# ruby test/unit/lib/redmine/project_jump_box_test.rb
Run options: --seed 4246

# Running:

F

Failure:
Redmine::ProjectJumpBoxTest#test_should_limit_recently_used_projects [test/unit/lib/redmine/project_jump_box_test.rb:60]:
Expected: 1
Actual: 0

bin/rails test test/unit/lib/redmine/project_jump_box_test.rb:53

.F

Failure:
Redmine::ProjectJumpBoxTest#test_should_record_recently_used_projects_order [test/unit/lib/redmine/project_jump_box_test.rb:70]:
Expected: 2
Actual: 1

bin/rails test test/unit/lib/redmine/project_jump_box_test.rb:63

...F

Failure:
Redmine::ProjectJumpBoxTest#test_should_update_recents_list [test/unit/lib/redmine/project_jump_box_test.rb:134]:
Expected: 2
Actual: 1

bin/rails test test/unit/lib/redmine/project_jump_box_test.rb:118

Finished in 0.402722s, 17.3817 runs/s, 64.5606 assertions/s.
7 runs, 26 assertions, 3 failures, 0 errors, 0 skips
</code></pre>

The attached patches fix those failings tests and add a test to ensure that only visible projects are listed.

https://gitlab.com/redmine-org/redmine/-/pipelines/270899596
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

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

  • カテゴリProjects_11 にセット
  • 対象バージョン4.1.2_162 にセット

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

いいね!0
いいね!0