mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-11 16:16:14 +01:00
2a5cf5e1b7
Summary: Fixes T5138. Some of the "revision" properties are really "diff" properties, but we only show the properties for the most recent / current diff. - Immediately, this makes it hard or impossible to review, e.g., lint/unit results for older diffs. - Longer-term, these limits will become more problematic with more data on diffs after Harbormaster. Instead, separate "revision" from "diff" properties. (In the long term, it might make sense to show more diffs in this panel -- e.g., tabs for the 8 most recent updates or something -- but I went with the simplest approach for now since I don't have a clean way to deal with 100-update revisions offhand.) Test Plan: {F500480} Reviewers: btrahan Reviewed By: btrahan Subscribers: cburroughs, epriestley Maniphest Tasks: T5138 Differential Revision: https://secure.phabricator.com/D13282
47 lines
909 B
PHP
47 lines
909 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 renderPropertyViewValue(array $handles) {
|
|
return null;
|
|
}
|
|
|
|
public function shouldAppearInDiffPropertyView() {
|
|
return true;
|
|
}
|
|
|
|
public function renderDiffPropertyViewLabel(DifferentialDiff $diff) {
|
|
return $this->getFieldName();
|
|
}
|
|
|
|
public function renderDiffPropertyViewValue(DifferentialDiff $diff) {
|
|
$path = $diff->getSourcePath();
|
|
if (!$path) {
|
|
return null;
|
|
}
|
|
|
|
return $path;
|
|
}
|
|
|
|
}
|