1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

When an object has been imported from an external source, show a curtain panel

Summary: Ref T10537. Show when an object is bridged to something external.

Test Plan: {F1190099}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10537

Differential Revision: https://secure.phabricator.com/D15520
This commit is contained in:
epriestley 2016-03-25 05:29:19 -07:00
parent 4dc857e36d
commit 0856a36e97
2 changed files with 33 additions and 0 deletions

View file

@ -845,6 +845,7 @@ phutil_register_library_map(array(
'DoorkeeperBridgeGitHubIssue' => 'applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php', 'DoorkeeperBridgeGitHubIssue' => 'applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php',
'DoorkeeperBridgeJIRA' => 'applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php', 'DoorkeeperBridgeJIRA' => 'applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php',
'DoorkeeperBridgeJIRATestCase' => 'applications/doorkeeper/bridge/__tests__/DoorkeeperBridgeJIRATestCase.php', 'DoorkeeperBridgeJIRATestCase' => 'applications/doorkeeper/bridge/__tests__/DoorkeeperBridgeJIRATestCase.php',
'DoorkeeperBridgedObjectCurtainExtension' => 'applications/doorkeeper/engineextension/DoorkeeperBridgedObjectCurtainExtension.php',
'DoorkeeperBridgedObjectInterface' => 'applications/doorkeeper/bridge/DoorkeeperBridgedObjectInterface.php', 'DoorkeeperBridgedObjectInterface' => 'applications/doorkeeper/bridge/DoorkeeperBridgedObjectInterface.php',
'DoorkeeperDAO' => 'applications/doorkeeper/storage/DoorkeeperDAO.php', 'DoorkeeperDAO' => 'applications/doorkeeper/storage/DoorkeeperDAO.php',
'DoorkeeperExternalObject' => 'applications/doorkeeper/storage/DoorkeeperExternalObject.php', 'DoorkeeperExternalObject' => 'applications/doorkeeper/storage/DoorkeeperExternalObject.php',
@ -5001,6 +5002,7 @@ phutil_register_library_map(array(
'DoorkeeperBridgeGitHubIssue' => 'DoorkeeperBridgeGitHub', 'DoorkeeperBridgeGitHubIssue' => 'DoorkeeperBridgeGitHub',
'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge', 'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge',
'DoorkeeperBridgeJIRATestCase' => 'PhabricatorTestCase', 'DoorkeeperBridgeJIRATestCase' => 'PhabricatorTestCase',
'DoorkeeperBridgedObjectCurtainExtension' => 'PHUICurtainExtension',
'DoorkeeperDAO' => 'PhabricatorLiskDAO', 'DoorkeeperDAO' => 'PhabricatorLiskDAO',
'DoorkeeperExternalObject' => array( 'DoorkeeperExternalObject' => array(
'DoorkeeperDAO', 'DoorkeeperDAO',

View file

@ -0,0 +1,31 @@
<?php
final class DoorkeeperBridgedObjectCurtainExtension
extends PHUICurtainExtension {
const EXTENSIONKEY = 'doorkeeper.bridged-object';
public function shouldEnableForObject($object) {
return ($object instanceof DoorkeeperBridgedObjectInterface);
}
public function getExtensionApplication() {
return new PhabricatorDoorkeeperApplication();
}
public function buildCurtainPanel($object) {
$xobj = $object->getBridgedObject();
if (!$xobj) {
return null;
}
$tag = id(new DoorkeeperTagView())
->setExternalObject($xobj);
return $this->newPanel()
->setHeaderText(pht('Imported From'))
->setOrder(5000)
->appendChild($tag);
}
}