mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 17:52:43 +01:00
f6a13fd1c7
Summary: Ref T2222. This will probably have some rough edges for a bit (e.g., weird cases I didn't remember or think of), but there's no change to the underlying data and we can easily revert if things get too messy. Test Plan: Looked at a variety of revisions and saw sensible output. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2222 Differential Revision: https://secure.phabricator.com/D8361
39 lines
744 B
PHP
39 lines
744 B
PHP
<?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 shouldDisableByDefault() {
|
|
return true;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
}
|