Differential D21595 Diff 51414 src/applications/differential/editor/DifferentialRevisionEditEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/editor/DifferentialRevisionEditEngine.php
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | $author_field = id(new PhabricatorDatasourceEditField()) | ||||
->setDatasource(new PhabricatorPeopleDatasource()) | ->setDatasource(new PhabricatorPeopleDatasource()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
DifferentialRevisionAuthorTransaction::TRANSACTIONTYPE) | DifferentialRevisionAuthorTransaction::TRANSACTIONTYPE) | ||||
->setDescription(pht('Foist this revision upon someone else.')) | ->setDescription(pht('Foist this revision upon someone else.')) | ||||
->setConduitDescription(pht('Foist this revision upon another user.')) | ->setConduitDescription(pht('Foist this revision upon another user.')) | ||||
->setConduitTypeDescription(pht('New author.')) | ->setConduitTypeDescription(pht('New author.')) | ||||
->setSingleValue($object->getAuthorPHID()); | ->setSingleValue($object->getAuthorPHID()); | ||||
// Don't show the "Author" field when creating a revision using the web | |||||
// workflow, since it adds more noise than signal to this workflow. | |||||
if ($this->getIsCreate()) { | |||||
$author_field->setIsHidden(true); | |||||
} | |||||
// Only show the "Foist Upon" comment action to the current revision | |||||
// author. Other users can use "Edit Revision", it's just very unlikley | |||||
// that they're interested in this action. | |||||
if ($viewer->getPHID() === $object->getAuthorPHID()) { | if ($viewer->getPHID() === $object->getAuthorPHID()) { | ||||
$author_field->setCommentActionLabel(pht('Foist Upon')); | $author_field->setCommentActionLabel(pht('Foist Upon')); | ||||
} | } | ||||
$fields[] = $author_field; | $fields[] = $author_field; | ||||
$fields[] = id(new PhabricatorRemarkupEditField()) | $fields[] = id(new PhabricatorRemarkupEditField()) | ||||
->setKey(DifferentialRevisionSummaryTransaction::EDITKEY) | ->setKey(DifferentialRevisionSummaryTransaction::EDITKEY) | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |