mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +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:
parent
961c2c0108
commit
78a8079f59
4 changed files with 26 additions and 5 deletions
|
@ -86,7 +86,9 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
$commit_data,
|
||||
$parent_query->loadParents());
|
||||
$property_list = id(new PhabricatorPropertyListView())
|
||||
->setHasKeyboardShortcuts(true);
|
||||
->setHasKeyboardShortcuts(true)
|
||||
->setUser($user)
|
||||
->setObject($commit);
|
||||
foreach ($commit_properties as $key => $value) {
|
||||
$property_list->addProperty($key, $value);
|
||||
}
|
||||
|
@ -98,6 +100,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
|
||||
$message = $engine->markupText($message);
|
||||
|
||||
$property_list->invokeWillRenderEvent();
|
||||
$property_list->addTextContent(
|
||||
phutil_tag(
|
||||
'div',
|
||||
|
@ -105,7 +108,6 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
'class' => 'diffusion-commit-message phabricator-remarkup',
|
||||
),
|
||||
$message));
|
||||
|
||||
$content[] = $top_anchor;
|
||||
$content[] = $headsup_view;
|
||||
$content[] = $headsup_actions;
|
||||
|
|
|
@ -120,7 +120,9 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
|
|||
array $child_phids) {
|
||||
|
||||
$user = $this->getRequest()->getUser();
|
||||
$properties = new PhabricatorPropertyListView();
|
||||
$properties = id(new PhabricatorPropertyListView())
|
||||
->setUser($user)
|
||||
->setObject($paste);
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Author'),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorPaste extends PhabricatorPasteDAO
|
||||
implements PhabricatorPolicyInterface {
|
||||
implements PhabricatorTokenReceiverInterface, PhabricatorPolicyInterface {
|
||||
|
||||
protected $phid;
|
||||
protected $title;
|
||||
|
@ -79,4 +79,12 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
|||
return $this;
|
||||
}
|
||||
|
||||
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */
|
||||
|
||||
public function getUsersToNotifyOfTokenGiven() {
|
||||
return array(
|
||||
$this->getAuthorPHID(),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
final class PhabricatorRepositoryCommit
|
||||
extends PhabricatorRepositoryDAO
|
||||
implements PhabricatorPolicyInterface {
|
||||
implements PhabricatorPolicyInterface,
|
||||
PhabricatorTokenReceiverInterface {
|
||||
|
||||
protected $repositoryID;
|
||||
protected $phid;
|
||||
|
@ -171,4 +172,12 @@ final class PhabricatorRepositoryCommit
|
|||
return $this->getRepository()->hasAutomaticCapability($capability, $viewer);
|
||||
}
|
||||
|
||||
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */
|
||||
|
||||
public function getUsersToNotifyOfTokenGiven() {
|
||||
return array(
|
||||
$this->getAuthorPHID(),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue