1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Tokens added to Repository Commits and Pastes

Summary: Ref T3023

Test Plan: Tokens visible when awarded to these applications and notifications successful.

Reviewers: epriestley, AnhNhan

Reviewed By: AnhNhan

CC: aran, Korvin, AnhNhan

Maniphest Tasks: T3023

Differential Revision: https://secure.phabricator.com/D5859
This commit is contained in:
deedydas 2013-05-09 14:21:21 -07:00 committed by epriestley
parent 961c2c0108
commit 78a8079f59
4 changed files with 26 additions and 5 deletions

View file

@ -86,7 +86,9 @@ final class DiffusionCommitController extends DiffusionController {
$commit_data, $commit_data,
$parent_query->loadParents()); $parent_query->loadParents());
$property_list = id(new PhabricatorPropertyListView()) $property_list = id(new PhabricatorPropertyListView())
->setHasKeyboardShortcuts(true); ->setHasKeyboardShortcuts(true)
->setUser($user)
->setObject($commit);
foreach ($commit_properties as $key => $value) { foreach ($commit_properties as $key => $value) {
$property_list->addProperty($key, $value); $property_list->addProperty($key, $value);
} }
@ -98,6 +100,7 @@ final class DiffusionCommitController extends DiffusionController {
$message = $engine->markupText($message); $message = $engine->markupText($message);
$property_list->invokeWillRenderEvent();
$property_list->addTextContent( $property_list->addTextContent(
phutil_tag( phutil_tag(
'div', 'div',
@ -105,7 +108,6 @@ final class DiffusionCommitController extends DiffusionController {
'class' => 'diffusion-commit-message phabricator-remarkup', 'class' => 'diffusion-commit-message phabricator-remarkup',
), ),
$message)); $message));
$content[] = $top_anchor; $content[] = $top_anchor;
$content[] = $headsup_view; $content[] = $headsup_view;
$content[] = $headsup_actions; $content[] = $headsup_actions;

View file

@ -120,7 +120,9 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
array $child_phids) { array $child_phids) {
$user = $this->getRequest()->getUser(); $user = $this->getRequest()->getUser();
$properties = new PhabricatorPropertyListView(); $properties = id(new PhabricatorPropertyListView())
->setUser($user)
->setObject($paste);
$properties->addProperty( $properties->addProperty(
pht('Author'), pht('Author'),

View file

@ -1,7 +1,7 @@
<?php <?php
final class PhabricatorPaste extends PhabricatorPasteDAO final class PhabricatorPaste extends PhabricatorPasteDAO
implements PhabricatorPolicyInterface { implements PhabricatorTokenReceiverInterface, PhabricatorPolicyInterface {
protected $phid; protected $phid;
protected $title; protected $title;
@ -79,4 +79,12 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
return $this; return $this;
} }
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */
public function getUsersToNotifyOfTokenGiven() {
return array(
$this->getAuthorPHID(),
);
}
} }

View file

@ -2,7 +2,8 @@
final class PhabricatorRepositoryCommit final class PhabricatorRepositoryCommit
extends PhabricatorRepositoryDAO extends PhabricatorRepositoryDAO
implements PhabricatorPolicyInterface { implements PhabricatorPolicyInterface,
PhabricatorTokenReceiverInterface {
protected $repositoryID; protected $repositoryID;
protected $phid; protected $phid;
@ -171,4 +172,12 @@ final class PhabricatorRepositoryCommit
return $this->getRepository()->hasAutomaticCapability($capability, $viewer); return $this->getRepository()->hasAutomaticCapability($capability, $viewer);
} }
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */
public function getUsersToNotifyOfTokenGiven() {
return array(
$this->getAuthorPHID(),
);
}
} }