mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 11:52:40 +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
912 B
PHP
47 lines
912 B
PHP
<?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 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) {
|
|
$host = $diff->getSourceMachine();
|
|
if (!$host) {
|
|
return null;
|
|
}
|
|
|
|
return $host;
|
|
}
|
|
|
|
}
|