mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
b2b739c709
Summary: Ref T8726. I want to modularize values and reduce how hard-coded / copypasta'd they are. - Rename `get...StandardCondition()` to `get...StandardType()`, since we can drive both conditions and values from it. - Rename `STANDARD_LIST` to `STANDARD_PHID_LIST` for consistency: all "lists" are lists of PHIDs. - For all standard types which don't require typehaeads, lift their logic into the base class. - I'll lift typeaheads soon, but need to generalize them first. Test Plan: Edited various Herald rules, saw value UI generate correctly. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8726 Differential Revision: https://secure.phabricator.com/D13612
30 lines
727 B
PHP
30 lines
727 B
PHP
<?php
|
|
|
|
final class DiffusionCommitReviewerHeraldField
|
|
extends DiffusionCommitHeraldField {
|
|
|
|
const FIELDCONST = 'diffusion.commit.reviewer';
|
|
|
|
public function getHeraldFieldName() {
|
|
return pht('Reviewer');
|
|
}
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
return $object->getCommitData()->getCommitDetail('reviewerPHID');
|
|
}
|
|
|
|
protected function getHeraldFieldStandardType() {
|
|
return self::STANDARD_PHID_NULLABLE;
|
|
}
|
|
|
|
public function getHeraldFieldValueType($condition) {
|
|
switch ($condition) {
|
|
case HeraldAdapter::CONDITION_EXISTS:
|
|
case HeraldAdapter::CONDITION_NOT_EXISTS:
|
|
return HeraldAdapter::VALUE_NONE;
|
|
default:
|
|
return HeraldAdapter::VALUE_USER;
|
|
}
|
|
}
|
|
|
|
}
|