mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Fix confusing ordering of similar actions in transaction groups
Summary: Fixes T7250. Currently, if a display group of transactions (multiple transactions by the same author in a short period of time with no intervening comments) has several transactions of similar strength (e.g., several status change transactions) we can end up displaying them in reverse chronological order, which is confusing. Instead, make sure transactions of the same type/strength are always in logical order. Test Plan: - Merged a task into another task, then reopened the merged task. - Before patch: merge/reopen showed in wrong order. {F1014954} - After patch: merge/reopen show in correct order. {F1014955} Reviewers: chad Reviewed By: chad Maniphest Tasks: T7250 Differential Revision: https://secure.phabricator.com/D14680
This commit is contained in:
parent
0ce373a012
commit
77d33ec7be
1 changed files with 13 additions and 3 deletions
|
@ -383,9 +383,19 @@ class PhabricatorApplicationTransactionView extends AphrontView {
|
|||
}
|
||||
|
||||
foreach ($groups as $key => $group) {
|
||||
$group = msort($group, 'getActionStrength');
|
||||
$group = array_reverse($group);
|
||||
$groups[$key] = $group;
|
||||
$results = array();
|
||||
|
||||
// Sort transactions within the group by action strength, then by
|
||||
// within actions of similar strength.
|
||||
$strength_groups = mgroup($group, 'getActionStrength');
|
||||
krsort($strength_groups);
|
||||
foreach ($strength_groups as $strength_group) {
|
||||
foreach (msort($strength_group, 'getID') as $xaction) {
|
||||
$results[] = $xaction;
|
||||
}
|
||||
}
|
||||
|
||||
$groups[$key] = $results;
|
||||
}
|
||||
|
||||
return $groups;
|
||||
|
|
Loading…
Reference in a new issue