mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Add a "Revision status" field to Herald for Differential revisions
Summary: See PHI280. We have a similar field for tasks already, this is generally a reasonable sort of thing to support, and the addition of "draft" states means there are some pretty reasonable use cases. Test Plan: - Wrote a status-based ("status is needs revision") Herald rule. - Tested it against a "Needs Revision" revision (passed) and a "Changes Planned" revision (failed). Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18938
This commit is contained in:
parent
d606eb1c38
commit
3a2d337679
2 changed files with 31 additions and 0 deletions
|
@ -590,6 +590,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialRevisionStatus' => 'applications/differential/constants/DifferentialRevisionStatus.php',
|
'DifferentialRevisionStatus' => 'applications/differential/constants/DifferentialRevisionStatus.php',
|
||||||
'DifferentialRevisionStatusDatasource' => 'applications/differential/typeahead/DifferentialRevisionStatusDatasource.php',
|
'DifferentialRevisionStatusDatasource' => 'applications/differential/typeahead/DifferentialRevisionStatusDatasource.php',
|
||||||
'DifferentialRevisionStatusFunctionDatasource' => 'applications/differential/typeahead/DifferentialRevisionStatusFunctionDatasource.php',
|
'DifferentialRevisionStatusFunctionDatasource' => 'applications/differential/typeahead/DifferentialRevisionStatusFunctionDatasource.php',
|
||||||
|
'DifferentialRevisionStatusHeraldField' => 'applications/differential/herald/DifferentialRevisionStatusHeraldField.php',
|
||||||
'DifferentialRevisionStatusTransaction' => 'applications/differential/xaction/DifferentialRevisionStatusTransaction.php',
|
'DifferentialRevisionStatusTransaction' => 'applications/differential/xaction/DifferentialRevisionStatusTransaction.php',
|
||||||
'DifferentialRevisionSummaryHeraldField' => 'applications/differential/herald/DifferentialRevisionSummaryHeraldField.php',
|
'DifferentialRevisionSummaryHeraldField' => 'applications/differential/herald/DifferentialRevisionSummaryHeraldField.php',
|
||||||
'DifferentialRevisionSummaryTransaction' => 'applications/differential/xaction/DifferentialRevisionSummaryTransaction.php',
|
'DifferentialRevisionSummaryTransaction' => 'applications/differential/xaction/DifferentialRevisionSummaryTransaction.php',
|
||||||
|
@ -5701,6 +5702,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialRevisionStatus' => 'Phobject',
|
'DifferentialRevisionStatus' => 'Phobject',
|
||||||
'DifferentialRevisionStatusDatasource' => 'PhabricatorTypeaheadDatasource',
|
'DifferentialRevisionStatusDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||||
'DifferentialRevisionStatusFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
'DifferentialRevisionStatusFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||||
|
'DifferentialRevisionStatusHeraldField' => 'DifferentialRevisionHeraldField',
|
||||||
'DifferentialRevisionStatusTransaction' => 'DifferentialRevisionTransactionType',
|
'DifferentialRevisionStatusTransaction' => 'DifferentialRevisionTransactionType',
|
||||||
'DifferentialRevisionSummaryHeraldField' => 'DifferentialRevisionHeraldField',
|
'DifferentialRevisionSummaryHeraldField' => 'DifferentialRevisionHeraldField',
|
||||||
'DifferentialRevisionSummaryTransaction' => 'DifferentialRevisionTransactionType',
|
'DifferentialRevisionSummaryTransaction' => 'DifferentialRevisionTransactionType',
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class DifferentialRevisionStatusHeraldField
|
||||||
|
extends DifferentialRevisionHeraldField {
|
||||||
|
|
||||||
|
const FIELDCONST = 'revision.status';
|
||||||
|
|
||||||
|
public function getHeraldFieldName() {
|
||||||
|
return pht('Revision status');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHeraldFieldValue($object) {
|
||||||
|
return $object->getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getHeraldFieldStandardType() {
|
||||||
|
return self::STANDARD_PHID;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getDatasource() {
|
||||||
|
return new DifferentialRevisionStatusDatasource();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getDatasourceValueMap() {
|
||||||
|
$map = DifferentialRevisionStatus::getAll();
|
||||||
|
return mpull($map, 'getDisplayName', 'getKey');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue