Convert all tokenizers to take token/scalar inputs
Summary: Ref T7689. Ref T4100. This advances the goals of removing `loadViewerHandles()` (only 67 callsites remain!) and letting tokenizers some day take token functions like `viewer()` and `members(differential)`. Test Plan: - Sent a new message; used "To". - I simplified the cancel URI construction slightly because it's moot in all normal cases. - Edited a thread; used "Add Participants". - Searched rooms; used "Participants". - Searched countdowns; used "Authors". - Created a diff; used "Repository". - Edited a revision; edited "Projects"; edited "Reveiwers"; edited "Subscribers". - Searched for revisions; edited "responsible users"; "authors"; "reviwers"; "subscribers"; "repositories". - Added revision comments; edited "Add Reveiwers"; "Add Subscribers". - Commented on a commit; edited "Add Auditors"; "Add subscribers". - Edited a commit; edited "Projects". - Edited a repository; edited "Projects". - Searched feed, used "include Users"; "include Proejcts". - Searched files, used "authors". - Edited initiative; edited "Projects". - Searched backers; used "Backers". - Searched initiatives; used "Owners". - Edited build plans; edited "Run Command". - Searched Herald; used "Authors". - Added signature exemption in Legalpad. - Searhced legalpad; used "creators"; used "contributors". - Searched signatures; used "documents"; used "signers". - Created meme. - Searched macros; used "Authors". - Used "Projects" in Maniphest reports. - Used Maniphest comment actions. - Edited Maniphest tasks; edited "Assigned To"; edited "CC"; edited "projects". - Used "parent" in Maniphest task creation workflow. - Searched for projects; used "assigned to"; "in any projec"; "in all projects"; "not in projects"; "in users' projects"; "authors"; "subscribers". - Edited Maniphest bug filing domains, used "Default Author". - Searched for OAuth applications, used "Creators". - Edited Owners pacakge; edited "Primary Owner"; edited "Owners". - Searched for Owners packages; used "Owner". - OMG this UI is OLD - Edited a paste; edited "Projects". - Searched for paste; used "Authors". - Searched user activity log; used "Actors"; used "Users". - Edited a mock; edited "Projects"; edited "CC". - Searched for mocks; used "Authors". - Edited Phortune account; edited "Members". - Edited Phortune merchant account; edited "Members". - Searched Phrequent; used "Users". - Edited Ponder question; sued "projects". - Searched Ponder; used "Authors"; used "Answered By". - Added project members. - Searched for projects; used "Members". - Edited a Releeph product; edited "Pushers". - Searched pull requests; searched "Requestors". - Edited an arcanist project; used "Uses Symbols From". - Searhced push logs; used "Repositories"; used "Pushers". - Searched repositories; used "In nay project". - Used global search; used Authors/owners/Subscribers/In Any Project. - Edited a slowvote; used "Projects". - Searched slovotes; used "Authors". - Created a custom "Users" field; edited and searched for it. - Made a whole lot of typos in this list. ^^^^^^ Did not test: - Lint is nontrivial to test locally, I'll test it in production. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T4100, T7689 Differential Revision: https://secure.phabricator.com/D12224
This commit is contained in:
@@ -320,13 +320,14 @@ final class ManiphestReportController extends ManiphestController {
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($user)
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource(new PhabricatorProjectDatasource())
|
||||
->setLabel(pht('Project'))
|
||||
->setLimit(1)
|
||||
->setName('set_project')
|
||||
->setValue($tokens));
|
||||
// TODO: This is silly, but this is Maniphest reports.
|
||||
->setValue(mpull($tokens, 'getPHID')));
|
||||
|
||||
if ($has_window) {
|
||||
list($window_str, $ignored, $window_error) = $this->getWindow();
|
||||
|
||||
@@ -202,7 +202,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
||||
->setControlID('resolution')
|
||||
->setControlStyle('display: none')
|
||||
->setOptions($resolution_types))
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Assign To'))
|
||||
->setName('assign_to')
|
||||
@@ -210,7 +210,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
||||
->setControlStyle('display: none')
|
||||
->setID('assign-tokenizer')
|
||||
->setDisableBehavior(true))
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('CCs'))
|
||||
->setName('ccs')
|
||||
@@ -226,7 +226,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
||||
->setControlID('priority')
|
||||
->setControlStyle('display: none')
|
||||
->setValue($task->getPriority()))
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Projects'))
|
||||
->setName('projects')
|
||||
|
||||
@@ -506,20 +506,6 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
}
|
||||
}
|
||||
|
||||
$phids = array_merge(
|
||||
array($task->getOwnerPHID()),
|
||||
$task->getSubscriberPHIDs(),
|
||||
$task->getProjectPHIDs());
|
||||
|
||||
if ($parent_task) {
|
||||
$phids[] = $parent_task->getPHID();
|
||||
}
|
||||
|
||||
$phids = array_filter($phids);
|
||||
$phids = array_unique($phids);
|
||||
|
||||
$handles = $this->loadViewerHandles($phids);
|
||||
|
||||
$error_view = null;
|
||||
if ($errors) {
|
||||
$error_view = new PHUIInfoView();
|
||||
@@ -529,19 +515,19 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
||||
|
||||
if ($task->getOwnerPHID()) {
|
||||
$assigned_value = array($handles[$task->getOwnerPHID()]);
|
||||
$assigned_value = array($task->getOwnerPHID());
|
||||
} else {
|
||||
$assigned_value = array();
|
||||
}
|
||||
|
||||
if ($task->getSubscriberPHIDs()) {
|
||||
$cc_value = array_select_keys($handles, $task->getSubscriberPHIDs());
|
||||
$cc_value = $task->getSubscriberPHIDs();
|
||||
} else {
|
||||
$cc_value = array();
|
||||
}
|
||||
|
||||
if ($task->getProjectPHIDs()) {
|
||||
$projects_value = array_select_keys($handles, $task->getProjectPHIDs());
|
||||
$projects_value = $task->getProjectPHIDs();
|
||||
} else {
|
||||
$projects_value = array();
|
||||
}
|
||||
@@ -583,7 +569,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel(pht('Parent Task'))
|
||||
->setValue($handles[$parent_task->getPHID()]->getFullName()))
|
||||
->setValue($user->renderHandle($parent_task->getPHID())))
|
||||
->addHiddenInput('parent', $parent_task->getID());
|
||||
}
|
||||
|
||||
@@ -620,7 +606,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
->execute();
|
||||
|
||||
if ($can_edit_assign) {
|
||||
$form->appendChild(
|
||||
$form->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Assigned To'))
|
||||
->setName('assigned_to')
|
||||
@@ -631,7 +617,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
}
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('CC'))
|
||||
->setName('cc')
|
||||
@@ -680,7 +666,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||
pht('Create New Project'));
|
||||
}
|
||||
$form
|
||||
->appendChild(
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Projects'))
|
||||
->setName('projects')
|
||||
|
||||
Reference in New Issue
Block a user