1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-08 22:01:03 +01:00
phorge-phorge/src/applications/diffusion/herald/DiffusionPreCommitRefChangeHeraldField.php
epriestley ed3dfd491f Further modularize Herald values
Summary: Ref T8726. Modularize action values. Fully modularize "text", "none" and "select" controls. Only tokenizers remain.

Test Plan:
  - Used all affected value types in UI.
  - Reviewed rules using new modular rendering, saw sensible output.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8726

Differential Revision: https://secure.phabricator.com/D13614
2015-07-16 14:12:23 -07:00

31 lines
787 B
PHP

<?php
final class DiffusionPreCommitRefChangeHeraldField
extends DiffusionPreCommitRefHeraldField {
const FIELDCONST = 'diffusion.pre.ref.change';
public function getHeraldFieldName() {
return pht('Ref change type');
}
public function getHeraldFieldValue($object) {
return $object->getChangeFlags();
}
public function getHeraldFieldConditions() {
return array(
HeraldAdapter::CONDITION_HAS_BIT,
HeraldAdapter::CONDITION_NOT_BIT,
);
}
public function getHeraldFieldValueType($condition) {
return id(new HeraldSelectFieldValue())
->setKey(self::FIELDCONST)
->setOptions(
PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions())
->setDefault(PhabricatorRepositoryPushLog::CHANGEFLAG_ADD);
}
}