Differential D18626 Diff 44738 src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public function getRevisionActionOrderVector() { | ||||
| return id(new PhutilSortVector()) | return id(new PhutilSortVector()) | ||||
| ->addInt($this->getRevisionActionOrder()); | ->addInt($this->getRevisionActionOrder()); | ||||
| } | } | ||||
| protected function getRevisionActionGroupKey() { | protected function getRevisionActionGroupKey() { | ||||
| return DifferentialRevisionEditEngine::ACTIONGROUP_REVISION; | return DifferentialRevisionEditEngine::ACTIONGROUP_REVISION; | ||||
| } | } | ||||
| protected function getRevisionActionDescription() { | protected function getRevisionActionDescription( | ||||
| DifferentialRevision $revision) { | |||||
| return null; | return null; | ||||
| } | } | ||||
| public static function loadAllActions() { | public static function loadAllActions() { | ||||
| return id(new PhutilClassMapQuery()) | return id(new PhutilClassMapQuery()) | ||||
| ->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
| ->setUniqueMethod('getRevisionActionKey') | ->setUniqueMethod('getRevisionActionKey') | ||||
| ->execute(); | ->execute(); | ||||
| Show All 34 Lines | $field = id(new PhabricatorApplyEditField()) | ||||
| ->setCanApplyWithoutEditCapability($is_review) | ->setCanApplyWithoutEditCapability($is_review) | ||||
| ->setValue(true); | ->setValue(true); | ||||
| if ($this->isActionAvailable($revision, $viewer)) { | if ($this->isActionAvailable($revision, $viewer)) { | ||||
| $label = $this->getRevisionActionLabel(); | $label = $this->getRevisionActionLabel(); | ||||
| if ($label !== null) { | if ($label !== null) { | ||||
| $field->setCommentActionLabel($label); | $field->setCommentActionLabel($label); | ||||
| $description = $this->getRevisionActionDescription(); | $description = $this->getRevisionActionDescription($revision); | ||||
| $field->setActionDescription($description); | $field->setActionDescription($description); | ||||
| $group_key = $this->getRevisionActionGroupKey(); | $group_key = $this->getRevisionActionGroupKey(); | ||||
| $field->setCommentActionGroupKey($group_key); | $field->setCommentActionGroupKey($group_key); | ||||
| // Currently, every revision action conflicts with every other | // Currently, every revision action conflicts with every other | ||||
| // revision action: for example, you can not simultaneously Accept and | // revision action: for example, you can not simultaneously Accept and | ||||
| // Reject a revision. | // Reject a revision. | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||