Differential D12523 Diff 30082 src/applications/project/typeahead/PhabricatorProjectMembersDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/typeahead/PhabricatorProjectMembersDatasource.php
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | final class PhabricatorProjectMembersDatasource | ||||
public function renderFunctionTokens($function, array $argv_list) { | public function renderFunctionTokens($function, array $argv_list) { | ||||
$phids = array(); | $phids = array(); | ||||
foreach ($argv_list as $argv) { | foreach ($argv_list as $argv) { | ||||
$phids[] = head($argv); | $phids[] = head($argv); | ||||
} | } | ||||
$tokens = $this->renderTokens($phids); | $tokens = $this->renderTokens($phids); | ||||
foreach ($tokens as $token) { | foreach ($tokens as $token) { | ||||
// Remove any project color on this token. | |||||
$token->setColor(null); | |||||
btrahan: surprised this is necessary | |||||
Not Done Inline ActionsThe token is originally coming from the underlying Project tokenizer, which sets the color on it if the project has a color. If it was just freshly created we wouldn't have to do it. We could do something else like automatically ignore colors on function tokens, but it's possible that we'll want colored functions or something. This may end up getting cleaned up if we don't adjust the design much, though. epriestley: The token is originally coming from the underlying Project tokenizer, which sets the color on… | |||||
if ($token->isInvalid()) { | if ($token->isInvalid()) { | ||||
$token | $token | ||||
->setValue(pht('Members: Invalid Project')); | ->setValue(pht('Members: Invalid Project')); | ||||
} else { | } else { | ||||
$token | $token | ||||
->setIcon('fa-users') | ->setIcon('fa-users') | ||||
->setTokenType(PhabricatorTypeaheadTokenView::TYPE_FUNCTION) | ->setTokenType(PhabricatorTypeaheadTokenView::TYPE_FUNCTION) | ||||
->setKey('members('.$token->getKey().')') | ->setKey('members('.$token->getKey().')') | ||||
->setValue(pht('Members: %s', $token->getValue())); | ->setValue(pht('Members: %s', $token->getValue())); | ||||
} | } | ||||
} | } | ||||
return $tokens; | return $tokens; | ||||
} | } | ||||
} | } |
surprised this is necessary