Differential D15915 Diff 38331 src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
previous paths. | previous paths. | ||||
Generally, you will call `owners.search` first to get a list of current paths | Generally, you will call `owners.search` first to get a list of current paths | ||||
(which are provided in the same format), make changes, then update them by | (which are provided in the same format), make changes, then update them by | ||||
applying a transaction of this type. | applying a transaction of this type. | ||||
EOTEXT | EOTEXT | ||||
); | ); | ||||
$autoreview_map = PhabricatorOwnersPackage::getAutoreviewOptionsMap(); | |||||
$autoreview_map = ipull($autoreview_map, 'name'); | |||||
return array( | return array( | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('name') | ->setKey('name') | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setDescription(pht('Name of the package.')) | ->setDescription(pht('Name of the package.')) | ||||
->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_NAME) | ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_NAME) | ||||
->setIsRequired(true) | ->setIsRequired(true) | ||||
->setValue($object->getName()), | ->setValue($object->getName()), | ||||
id(new PhabricatorDatasourceEditField()) | id(new PhabricatorDatasourceEditField()) | ||||
->setKey('owners') | ->setKey('owners') | ||||
->setLabel(pht('Owners')) | ->setLabel(pht('Owners')) | ||||
->setDescription(pht('Users and projects which own the package.')) | ->setDescription(pht('Users and projects which own the package.')) | ||||
->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_OWNERS) | ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_OWNERS) | ||||
->setDatasource(new PhabricatorProjectOrUserDatasource()) | ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||
->setIsCopyable(true) | ->setIsCopyable(true) | ||||
->setValue($object->getOwnerPHIDs()), | ->setValue($object->getOwnerPHIDs()), | ||||
id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
->setKey('autoReview') | |||||
->setLabel(pht('Auto Review')) | |||||
->setDescription( | |||||
pht( | |||||
'Automatically trigger reviews for commits affecting files in '. | |||||
'this package.')) | |||||
->setTransactionType( | |||||
PhabricatorOwnersPackageTransaction::TYPE_AUTOREVIEW) | |||||
->setIsCopyable(true) | |||||
->setValue($object->getAutoReview()) | |||||
->setOptions($autoreview_map), | |||||
id(new PhabricatorSelectEditField()) | |||||
->setKey('auditing') | ->setKey('auditing') | ||||
->setLabel(pht('Auditing')) | ->setLabel(pht('Auditing')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Automatically trigger audits for commits affecting files in '. | 'Automatically trigger audits for commits affecting files in '. | ||||
'this package.')) | 'this package.')) | ||||
->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_AUDITING) | ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_AUDITING) | ||||
->setIsCopyable(true) | ->setIsCopyable(true) | ||||
Show All 35 Lines |