プロジェクト

全般

プロフィール

Vote #74946

未完了

Sort of version options

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

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

0%

予定工数:
category_id:
22
version_id:
0
issue_org_id:
16116
author_id:
61731
assigned_to_id:
1
comments:
2
status_id:
10
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Needs feedback]

説明

Hi there,

currently all versions are just sorted by an array.

This causes that our version field results in an unsorted order. Either id nor name or date (all dates are nil) is respected.

This way could improve the version sort.

See source:trunk/app/models/issue.rb#L743

Replace this line with


@assignable_versions = versions.uniq.sort_by{|v| [v.effective_date, v.name]}

This will sort the result in first place by effective date and otherwise by name.

Any regressions?

Best regards,
Daniel


journals

Daniel Felix wrote:

> See source:trunk/app/models/issue.rb#L743

I don't get it, @@assignable_versions = versions.uniq.sort@ should already sort versions by date and name because of Version#<=> defintion (see source:/tags/2.5.0/app/models/version.rb#L181). Doesn't work?
--------------------------------------------------------------------------------
Hi Jean-Philippe,

the point is, that uniq.sort distincs every version and sort the version by it's effective date and in the second point by the ID itself.

In this way, the versions are sorted by the effective date and in the second case (same date or no date) by the name.

Best regards,
Daniel
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリRoadmap_22 にセット

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

いいね!0
いいね!0