mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 23:32:40 +01:00
Allow custom fields to be ordered ascending or descending
Summary: Fixes T6864. This creates a sort of busy menu but I think that's proably fine -- users are opting into activating these fields for search anyway. In the future, we could refine this as, e.g.: - don't show these options in the dropdown; - do show them on some new "http prefilling" sort of page; - then you access them as an advanced user with `?order=secret-magic`. But I'm not going to bother for now. Test Plan: Ordered by an int field, then reversed the order. Reviewers: chad Reviewed By: chad Maniphest Tasks: T6864 Differential Revision: https://secure.phabricator.com/D14800
This commit is contained in:
parent
36bfff3898
commit
a5d23c9f3e
1 changed files with 5 additions and 0 deletions
|
@ -724,6 +724,11 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
||||||
'name' => $field->getFieldName(),
|
'name' => $field->getFieldName(),
|
||||||
'aliases' => array($legacy_key),
|
'aliases' => array($legacy_key),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$orders['-'.$modern_key] = array(
|
||||||
|
'vector' => array('-'.$modern_key, '-id'),
|
||||||
|
'name' => pht('%s (Reversed)', $field->getFieldName()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue