mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Implement more Differential fields on ApplicationTransaction/CustomField
Summary: Ref T2222. Ref T3886. Gets the storage-based fields working. This requires future changes to actually do anything, all this code is inactive. Test Plan: {F118863} Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3886, T2222 Differential Revision: https://secure.phabricator.com/D8357
This commit is contained in:
parent
cd7171ec6e
commit
8297c2131c
12 changed files with 427 additions and 11 deletions
|
@ -331,6 +331,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php',
|
||||
'DifferentialAuthorFieldSpecification' => 'applications/differential/field/specification/DifferentialAuthorFieldSpecification.php',
|
||||
'DifferentialAuxiliaryField' => 'applications/differential/storage/DifferentialAuxiliaryField.php',
|
||||
'DifferentialBlameRevisionField' => 'applications/differential/customfield/DifferentialBlameRevisionField.php',
|
||||
'DifferentialBlameRevisionFieldSpecification' => 'applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php',
|
||||
'DifferentialBranchFieldSpecification' => 'applications/differential/field/specification/DifferentialBranchFieldSpecification.php',
|
||||
'DifferentialCCWelcomeMail' => 'applications/differential/mail/DifferentialCCWelcomeMail.php',
|
||||
|
@ -404,6 +405,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialFreeformFieldSpecification' => 'applications/differential/field/specification/DifferentialFreeformFieldSpecification.php',
|
||||
'DifferentialGetWorkingCopy' => 'applications/differential/DifferentialGetWorkingCopy.php',
|
||||
'DifferentialGitSVNIDFieldSpecification' => 'applications/differential/field/specification/DifferentialGitSVNIDFieldSpecification.php',
|
||||
'DifferentialHostField' => 'applications/differential/customfield/DifferentialHostField.php',
|
||||
'DifferentialHostFieldSpecification' => 'applications/differential/field/specification/DifferentialHostFieldSpecification.php',
|
||||
'DifferentialHovercardEventListener' => 'applications/differential/event/DifferentialHovercardEventListener.php',
|
||||
'DifferentialHunk' => 'applications/differential/storage/DifferentialHunk.php',
|
||||
|
@ -436,6 +438,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialPHIDTypeRevision' => 'applications/differential/phid/DifferentialPHIDTypeRevision.php',
|
||||
'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php',
|
||||
'DifferentialParseRenderTestCase' => 'applications/differential/__tests__/DifferentialParseRenderTestCase.php',
|
||||
'DifferentialPathField' => 'applications/differential/customfield/DifferentialPathField.php',
|
||||
'DifferentialPathFieldSpecification' => 'applications/differential/field/specification/DifferentialPathFieldSpecification.php',
|
||||
'DifferentialPrimaryPaneView' => 'applications/differential/view/DifferentialPrimaryPaneView.php',
|
||||
'DifferentialProjectReviewersField' => 'applications/differential/customfield/DifferentialProjectReviewersField.php',
|
||||
|
@ -448,6 +451,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialRepositoryFieldSpecification' => 'applications/differential/field/specification/DifferentialRepositoryFieldSpecification.php',
|
||||
'DifferentialRepositoryLookup' => 'applications/differential/query/DifferentialRepositoryLookup.php',
|
||||
'DifferentialResultsTableView' => 'applications/differential/view/DifferentialResultsTableView.php',
|
||||
'DifferentialRevertPlanField' => 'applications/differential/customfield/DifferentialRevertPlanField.php',
|
||||
'DifferentialRevertPlanFieldSpecification' => 'applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php',
|
||||
'DifferentialReviewRequestMail' => 'applications/differential/mail/DifferentialReviewRequestMail.php',
|
||||
'DifferentialReviewedByFieldSpecification' => 'applications/differential/field/specification/DifferentialReviewedByFieldSpecification.php',
|
||||
|
@ -475,6 +479,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/DifferentialRevisionUpdateHistoryView.php',
|
||||
'DifferentialRevisionViewController' => 'applications/differential/controller/DifferentialRevisionViewController.php',
|
||||
'DifferentialSearchIndexer' => 'applications/differential/search/DifferentialSearchIndexer.php',
|
||||
'DifferentialStoredCustomField' => 'applications/differential/customfield/DifferentialStoredCustomField.php',
|
||||
'DifferentialSubscribersField' => 'applications/differential/customfield/DifferentialSubscribersField.php',
|
||||
'DifferentialSummaryField' => 'applications/differential/customfield/DifferentialSummaryField.php',
|
||||
'DifferentialSummaryFieldSpecification' => 'applications/differential/field/specification/DifferentialSummaryFieldSpecification.php',
|
||||
|
@ -2891,6 +2896,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialAuditorsFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialAuthorField' => 'DifferentialCustomField',
|
||||
'DifferentialAuthorFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialBlameRevisionField' => 'DifferentialStoredCustomField',
|
||||
'DifferentialBlameRevisionFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialBranchFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialCCWelcomeMail' => 'DifferentialReviewRequestMail',
|
||||
|
@ -2962,6 +2968,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialFieldValidationException' => 'Exception',
|
||||
'DifferentialFreeformFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialGitSVNIDFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialHostField' => 'DifferentialCustomField',
|
||||
'DifferentialHostFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialHovercardEventListener' => 'PhabricatorEventListener',
|
||||
'DifferentialHunk' => 'DifferentialDAO',
|
||||
|
@ -2973,7 +2980,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController',
|
||||
'DifferentialInlineCommentQuery' => 'PhabricatorOffsetPagedQuery',
|
||||
'DifferentialInlineCommentView' => 'AphrontView',
|
||||
'DifferentialJIRAIssuesField' => 'DifferentialCustomField',
|
||||
'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField',
|
||||
'DifferentialJIRAIssuesFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialLandingActionMenuEventListener' => 'PhabricatorEventListener',
|
||||
'DifferentialLandingToGitHub' => 'DifferentialLandingStrategy',
|
||||
|
@ -2990,6 +2997,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialPHIDTypeRevision' => 'PhabricatorPHIDType',
|
||||
'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||
'DifferentialParseRenderTestCase' => 'PhabricatorTestCase',
|
||||
'DifferentialPathField' => 'DifferentialCustomField',
|
||||
'DifferentialPathFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialPrimaryPaneView' => 'AphrontView',
|
||||
'DifferentialProjectReviewersField' => 'DifferentialCustomField',
|
||||
|
@ -3001,6 +3009,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialRepositoryFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialRepositoryLookup' => 'Phobject',
|
||||
'DifferentialResultsTableView' => 'AphrontView',
|
||||
'DifferentialRevertPlanField' => 'DifferentialStoredCustomField',
|
||||
'DifferentialRevertPlanFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
'DifferentialReviewRequestMail' => 'DifferentialMail',
|
||||
'DifferentialReviewedByFieldSpecification' => 'DifferentialFieldSpecification',
|
||||
|
@ -3038,6 +3047,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialRevisionUpdateHistoryView' => 'AphrontView',
|
||||
'DifferentialRevisionViewController' => 'DifferentialController',
|
||||
'DifferentialSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
|
||||
'DifferentialStoredCustomField' => 'DifferentialCustomField',
|
||||
'DifferentialSubscribersField' => 'DifferentialCoreCustomField',
|
||||
'DifferentialSummaryField' => 'DifferentialCoreCustomField',
|
||||
'DifferentialSummaryFieldSpecification' => 'DifferentialFreeformFieldSpecification',
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialBlameRevisionField
|
||||
extends DifferentialStoredCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'phabricator:blame-revision';
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
return pht('Blame Revision');
|
||||
}
|
||||
|
||||
public function getFieldDescription() {
|
||||
return pht('Stores a reference to what this fixes.');
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function shouldAppearInEditView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAppearInApplicationTransactions() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getOldValueForApplicationTransactions() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function getNewValueForApplicationTransactions() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function readValueFromRequest(AphrontRequest $request) {
|
||||
$this->setValue($request->getStr($this->getFieldKey()));
|
||||
}
|
||||
|
||||
public function renderEditControl(array $handles) {
|
||||
return id(new AphrontFormTextControl())
|
||||
->setName($this->getFieldKey())
|
||||
->setValue($this->getValue())
|
||||
->setLabel($this->getFieldName());
|
||||
}
|
||||
|
||||
public function getApplicationTransactionTitle(
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
$author_phid = $xaction->getAuthorPHID();
|
||||
$old = $xaction->getOldValue();
|
||||
$new = $xaction->getNewValue();
|
||||
|
||||
return pht(
|
||||
'%s updated the blame revision for this revision.',
|
||||
$xaction->renderHandleLink($author_phid));
|
||||
}
|
||||
|
||||
public function getApplicationTransactionTitleForFeed(
|
||||
PhabricatorApplicationTransaction $xaction,
|
||||
PhabricatorFeedStory $story) {
|
||||
|
||||
$object_phid = $xaction->getObjectPHID();
|
||||
$author_phid = $xaction->getAuthorPHID();
|
||||
$old = $xaction->getOldValue();
|
||||
$new = $xaction->getNewValue();
|
||||
|
||||
return pht(
|
||||
'%s updated the blame revision for %s.',
|
||||
$xaction->renderHandleLink($author_phid),
|
||||
$xaction->renderHandleLink($object_phid));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialHostField
|
||||
extends DifferentialCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'differential:host';
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
return pht('Host');
|
||||
}
|
||||
|
||||
public function getFieldDescription() {
|
||||
return pht('Shows the local host where the diff came from.');
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
$host = $this->getObject()->getActiveDiff()->getSourceMachine();
|
||||
if (!$host) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $host;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +1,19 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialJIRAIssuesField
|
||||
extends DifferentialCustomField {
|
||||
|
||||
// TODO: This field needs to actually read storage!
|
||||
private $value = null;
|
||||
|
||||
extends DifferentialStoredCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'differential:jira-issues';
|
||||
return 'phabricator:jira-issues';
|
||||
}
|
||||
|
||||
public function getValueForStorage() {
|
||||
return json_encode($this->getValue());
|
||||
}
|
||||
|
||||
public function setValueFromStorage($value) {
|
||||
$this->setValue(json_decode($value, true));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
|
@ -46,8 +51,8 @@ final class DifferentialJIRAIssuesField
|
|||
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
|
||||
|
||||
$refs = array();
|
||||
if ($this->value) {
|
||||
foreach ($this->value as $jira_key) {
|
||||
if ($this->getValue()) {
|
||||
foreach ($this->getValue() as $jira_key) {
|
||||
$refs[] = id(new DoorkeeperObjectRef())
|
||||
->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA)
|
||||
->setApplicationDomain($provider->getProviderDomain())
|
||||
|
@ -66,11 +71,13 @@ final class DifferentialJIRAIssuesField
|
|||
}
|
||||
|
||||
$xobjs = id(new DoorkeeperExternalObjectQuery())
|
||||
->setViewer($this->getUser())
|
||||
->setViewer($this->getViewer())
|
||||
->withObjectKeys(mpull($refs, 'getObjectKey'))
|
||||
->execute();
|
||||
|
||||
return $xobjs;
|
||||
}
|
||||
|
||||
// TODO: Implement edit; this field is readonly for now.
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialPathField
|
||||
extends DifferentialCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'differential:path';
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
return pht('Path');
|
||||
}
|
||||
|
||||
public function getFieldDescription() {
|
||||
return pht('Shows the local path where the diff came from.');
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
$path = $this->getObject()->getActiveDiff()->getSourcePath();
|
||||
if (!$path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialRevertPlanField
|
||||
extends DifferentialStoredCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'phabricator:revert-plan';
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
return pht('Revert Plan');
|
||||
}
|
||||
|
||||
public function getFieldDescription() {
|
||||
return pht('Instructions for reverting/undoing this change.');
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function getStyleForPropertyView() {
|
||||
return 'block';
|
||||
}
|
||||
|
||||
public function getIconForPropertyView() {
|
||||
return PHUIPropertyListView::ICON_TESTPLAN;
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
if (!strlen($this->getValue())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return PhabricatorMarkupEngine::renderOneObject(
|
||||
id(new PhabricatorMarkupOneOff())
|
||||
->setPreserveLinebreaks(true)
|
||||
->setContent($this->getValue()),
|
||||
'default',
|
||||
$this->getViewer());
|
||||
}
|
||||
|
||||
public function shouldAppearInGlobalSearch() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function updateAbstractDocument(
|
||||
PhabricatorSearchAbstractDocument $document) {
|
||||
if (strlen($this->getValue())) {
|
||||
$document->addField('rvrt', $this->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public function shouldAppearInEditView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAppearInApplicationTransactions() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getOldValueForApplicationTransactions() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function getNewValueForApplicationTransactions() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function readValueFromRequest(AphrontRequest $request) {
|
||||
$this->setValue($request->getStr($this->getFieldKey()));
|
||||
}
|
||||
|
||||
public function renderEditControl(array $handles) {
|
||||
return id(new PhabricatorRemarkupControl())
|
||||
->setName($this->getFieldKey())
|
||||
->setValue($this->getValue())
|
||||
->setLabel($this->getFieldName());
|
||||
}
|
||||
|
||||
public function getApplicationTransactionTitle(
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
$author_phid = $xaction->getAuthorPHID();
|
||||
$old = $xaction->getOldValue();
|
||||
$new = $xaction->getNewValue();
|
||||
|
||||
return pht(
|
||||
'%s updated the revert plan for this revision.',
|
||||
$xaction->renderHandleLink($author_phid));
|
||||
}
|
||||
|
||||
public function getApplicationTransactionTitleForFeed(
|
||||
PhabricatorApplicationTransaction $xaction,
|
||||
PhabricatorFeedStory $story) {
|
||||
|
||||
$object_phid = $xaction->getObjectPHID();
|
||||
$author_phid = $xaction->getAuthorPHID();
|
||||
$old = $xaction->getOldValue();
|
||||
$new = $xaction->getNewValue();
|
||||
|
||||
return pht(
|
||||
'%s updated the revert plan for %s.',
|
||||
$xaction->renderHandleLink($author_phid),
|
||||
$xaction->renderHandleLink($object_phid));
|
||||
}
|
||||
|
||||
public function getApplicationTransactionHasChangeDetails(
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getApplicationTransactionChangeDetails(
|
||||
PhabricatorApplicationTransaction $xaction,
|
||||
PhabricatorUser $viewer) {
|
||||
return $xaction->renderTextCorpusChangeDetails(
|
||||
$viewer,
|
||||
$xaction->getOldValue(),
|
||||
$xaction->getNewValue());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
abstract class DifferentialStoredCustomField
|
||||
extends DifferentialCustomField {
|
||||
|
||||
private $value;
|
||||
|
||||
public function setValue($value) {
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function shouldUseStorage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function newStorageObject() {
|
||||
return new DifferentialCustomFieldStorage();
|
||||
}
|
||||
|
||||
protected function newStringIndexStorage() {
|
||||
return new DifferentialCustomFieldStringIndex();
|
||||
}
|
||||
|
||||
protected function newNumericIndexStorage() {
|
||||
return new DifferentialCustomFieldNumericIndex();
|
||||
}
|
||||
|
||||
public function getValueForStorage() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValueFromStorage($value) {
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
|
@ -89,4 +89,33 @@ final class DifferentialSummaryField
|
|||
}
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function getStyleForPropertyView() {
|
||||
return 'block';
|
||||
}
|
||||
|
||||
public function getIconForPropertyView() {
|
||||
return PHUIPropertyListView::ICON_SUMMARY;
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
if (!strlen($this->getValue())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return PhabricatorMarkupEngine::renderOneObject(
|
||||
id(new PhabricatorMarkupOneOff())
|
||||
->setPreserveLinebreaks(true)
|
||||
->setContent($this->getValue()),
|
||||
'default',
|
||||
$this->getViewer());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -104,4 +104,33 @@ final class DifferentialTestPlanField
|
|||
}
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getFieldName();
|
||||
}
|
||||
|
||||
public function getStyleForPropertyView() {
|
||||
return 'block';
|
||||
}
|
||||
|
||||
public function getIconForPropertyView() {
|
||||
return PHUIPropertyListView::ICON_TESTPLAN;
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue(array $handles) {
|
||||
if (!strlen($this->getValue())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return PhabricatorMarkupEngine::renderOneObject(
|
||||
id(new PhabricatorMarkupOneOff())
|
||||
->setPreserveLinebreaks(true)
|
||||
->setContent($this->getValue()),
|
||||
'default',
|
||||
$this->getViewer());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -73,6 +73,11 @@ final class DifferentialRevision extends DifferentialDAO
|
|||
) + parent::getConfiguration();
|
||||
}
|
||||
|
||||
public function getMonogram() {
|
||||
$id = $this->getID();
|
||||
return "D{$id}";
|
||||
}
|
||||
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
if (!$this->getID()) {
|
||||
|
|
|
@ -278,6 +278,10 @@ abstract class PhabricatorCustomField {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function shouldDisableByDefault() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an index string which uniquely identifies this field.
|
||||
|
@ -1070,6 +1074,17 @@ abstract class PhabricatorCustomField {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @task view
|
||||
*/
|
||||
public function getIconForPropertyView() {
|
||||
if ($this->proxy) {
|
||||
return $this->proxy->getIconForPropertyView();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @task view
|
||||
*/
|
||||
|
|
|
@ -199,9 +199,10 @@ final class PhabricatorCustomFieldList extends Phobject {
|
|||
$view->addProperty($label, $value);
|
||||
break;
|
||||
case 'block':
|
||||
$icon = $field->getIconForPropertyView();
|
||||
$view->invokeWillRenderEvent();
|
||||
if ($label !== null) {
|
||||
$view->addSectionHeader($label);
|
||||
$view->addSectionHeader($label, $icon);
|
||||
}
|
||||
$view->addTextContent($value);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue