mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-22 11:39:03 +01:00
Preserve "Autoclose?" information on new Commit edit flow
Summary: Ref T10978. The current "Edit" flow has some autoclose info. This isn't necessarily the best place to put it in the long run, but preseve it for now since the documentation refers to it. Test Plan: {F2340658} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10978 Differential Revision: https://secure.phabricator.com/D17176
This commit is contained in:
parent
a27c824da6
commit
5e07358826
1 changed files with 44 additions and 2 deletions
|
@ -30,7 +30,8 @@ final class DiffusionCommitEditEngine
|
|||
}
|
||||
|
||||
protected function newObjectQuery() {
|
||||
return new DiffusionCommitQuery();
|
||||
return id(new DiffusionCommitQuery())
|
||||
->needCommitData(true);
|
||||
}
|
||||
|
||||
protected function getObjectCreateTitleText($object) {
|
||||
|
@ -63,8 +64,49 @@ final class DiffusionCommitEditEngine
|
|||
|
||||
protected function buildCustomEditFields($object) {
|
||||
$viewer = $this->getViewer();
|
||||
$data = $object->getCommitData();
|
||||
|
||||
return array();
|
||||
$fields = array();
|
||||
|
||||
$reason = $data->getCommitDetail('autocloseReason', false);
|
||||
$reason = PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED;
|
||||
if ($reason !== false) {
|
||||
switch ($reason) {
|
||||
case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING:
|
||||
$desc = pht('No, Repository Importing');
|
||||
break;
|
||||
case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED:
|
||||
$desc = pht('No, Autoclose Disabled');
|
||||
break;
|
||||
case PhabricatorRepository::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH:
|
||||
$desc = pht('No, Not On Autoclose Branch');
|
||||
break;
|
||||
case PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED:
|
||||
$desc = pht('Yes, Forced Via bin/repository CLI Tool.');
|
||||
break;
|
||||
case null:
|
||||
$desc = pht('Yes');
|
||||
break;
|
||||
default:
|
||||
$desc = pht('Unknown');
|
||||
break;
|
||||
}
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Autoclose');
|
||||
$doc_link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $doc_href,
|
||||
'target' => '_blank',
|
||||
),
|
||||
pht('Learn More'));
|
||||
|
||||
$fields[] = id(new PhabricatorStaticEditField())
|
||||
->setLabel(pht('Autoclose?'))
|
||||
->setValue(array($desc, " \xC2\xB7 ", $doc_link));
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue