mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Add Marked With Any Flag search option
Summary: T3692 Test Plan: Search for macros with/without flags and then all flagged Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T3692 Differential Revision: https://secure.phabricator.com/D8976
This commit is contained in:
parent
572089c936
commit
01892e3808
1 changed files with 10 additions and 2 deletions
|
@ -30,7 +30,10 @@ final class PhabricatorMacroQuery
|
|||
|
||||
public static function getFlagColorsOptions() {
|
||||
|
||||
$options = array('-1' => pht('(No Filtering)'));
|
||||
$options = array(
|
||||
'-1' => pht('(No Filtering)'),
|
||||
'-2' => pht('(Marked With Any Flag)'),
|
||||
);
|
||||
|
||||
foreach (PhabricatorFlagColor::getColorNameMap() as $color => $name) {
|
||||
$options[$color] = $name;
|
||||
|
@ -169,10 +172,15 @@ final class PhabricatorMacroQuery
|
|||
}
|
||||
|
||||
if ($this->flagColor != '-1' && $this->flagColor !== null) {
|
||||
if ($this->flagColor == '-2') {
|
||||
$flag_colors = array_keys(PhabricatorFlagColor::getColorNameMap());
|
||||
} else {
|
||||
$flag_colors = array($this->flagColor);
|
||||
}
|
||||
$flags = id(new PhabricatorFlagQuery())
|
||||
->withOwnerPHIDs(array($this->getViewer()->getPHID()))
|
||||
->withTypes(array(PhabricatorMacroPHIDTypeMacro::TYPECONST))
|
||||
->withColors(array($this->flagColor))
|
||||
->withColors($flag_colors)
|
||||
->setViewer($this->getViewer())
|
||||
->execute();
|
||||
|
||||
|
|
Loading…
Reference in a new issue