Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15412132
D20801.id49605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D20801.id49605.diff
View Options
diff --git a/src/applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php b/src/applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php
--- a/src/applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php
+++ b/src/applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php
@@ -52,15 +52,12 @@
}
public function getTitle() {
- $old = $this->renderApplicationPolicy($this->getOldValue());
- $new = $this->renderApplicationPolicy($this->getNewValue());
-
return pht(
- '%s changed the "%s" policy from "%s" to "%s".',
+ '%s changed the %s policy from %s to %s.',
$this->renderAuthor(),
$this->renderCapability(),
- $old,
- $new);
+ $this->renderOldPolicy(),
+ $this->renderNewPolicy());
}
public function getTitleForFeed() {
@@ -68,12 +65,12 @@
$new = $this->renderApplicationPolicy($this->getNewValue());
return pht(
- '%s changed the "%s" policy for application %s from "%s" to "%s".',
+ '%s changed the %s policy for application %s from %s to %s.',
$this->renderAuthor(),
$this->renderCapability(),
$this->renderObject(),
- $old,
- $new);
+ $this->renderOldPolicy(),
+ $this->renderNewPolicy());
}
public function validateTransactions($object, array $xactions) {
@@ -165,38 +162,11 @@
return $errors;
}
- private function renderApplicationPolicy($name) {
- $policies = $this->getAllPolicies();
- if (empty($policies[$name])) {
- // Not a standard policy, check for a custom policy.
- $policy = id(new PhabricatorPolicyQuery())
- ->setViewer($this->getViewer())
- ->withPHIDs(array($name))
- ->executeOne();
- $policies[$name] = $policy;
- }
-
- $policy = idx($policies, $name);
- return $this->renderValue($policy->getFullName());
- }
-
- private function getAllPolicies() {
- if (!$this->policies) {
- $viewer = $this->getViewer();
- $application = $this->getObject();
- $this->policies = id(new PhabricatorPolicyQuery())
- ->setViewer($viewer)
- ->setObject($application)
- ->execute();
- }
-
- return $this->policies;
- }
-
private function renderCapability() {
$application = $this->getObject();
$capability = $this->getCapabilityName();
- return $application->getCapabilityLabel($capability);
+ $label = $application->getCapabilityLabel($capability);
+ return $this->renderValue($label);
}
private function getCapabilityName() {
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php
@@ -33,6 +33,7 @@
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
case PhabricatorRepositoryPushPolicyTransaction::TRANSACTIONTYPE:
+ case PhabricatorApplicationPolicyChangeTransaction::TRANSACTIONTYPE:
break;
default:
return new Aphront404Response();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 11:25 AM (2 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7683223
Default Alt Text
D20801.id49605.diff (3 KB)
Attached To
Mode
D20801: Update rendering of policy edit transactions in Applications
Attached
Detach File
Event Timeline
Log In to Comment