mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Replace Differential Edit controller with EditEngine-driven EditPro controller
Summary: Ref T11114. This replaces the old edit controller with a new one based entirely on EditEngine. This removes the CustomFieldEditEngineExtension hack for Differential, since remaining field types are fairly straightforward and work with existing EditEngine support, as far as I can tell. Test Plan: - Created a revision via web diffs. - Updated a revision via web diffs. - Edited a revision via web. - Edited nonstandard custom fields ("Blame Revision", "JIRA Issues"). - Created a revision via CLI. - Updated a revision via CLI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17054
This commit is contained in:
parent
32ce21a181
commit
102ea3cfa4
14 changed files with 42 additions and 275 deletions
|
@ -517,7 +517,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialRevisionControlSystem' => 'applications/differential/constants/DifferentialRevisionControlSystem.php',
|
'DifferentialRevisionControlSystem' => 'applications/differential/constants/DifferentialRevisionControlSystem.php',
|
||||||
'DifferentialRevisionDependedOnByRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php',
|
'DifferentialRevisionDependedOnByRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php',
|
||||||
'DifferentialRevisionDependsOnRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php',
|
'DifferentialRevisionDependsOnRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php',
|
||||||
'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php',
|
|
||||||
'DifferentialRevisionEditEngine' => 'applications/differential/editor/DifferentialRevisionEditEngine.php',
|
'DifferentialRevisionEditEngine' => 'applications/differential/editor/DifferentialRevisionEditEngine.php',
|
||||||
'DifferentialRevisionEditProController' => 'applications/differential/controller/DifferentialRevisionEditProController.php',
|
'DifferentialRevisionEditProController' => 'applications/differential/controller/DifferentialRevisionEditProController.php',
|
||||||
'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php',
|
'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php',
|
||||||
|
@ -5173,7 +5172,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialRevisionControlSystem' => 'Phobject',
|
'DifferentialRevisionControlSystem' => 'Phobject',
|
||||||
'DifferentialRevisionDependedOnByRevisionEdgeType' => 'PhabricatorEdgeType',
|
'DifferentialRevisionDependedOnByRevisionEdgeType' => 'PhabricatorEdgeType',
|
||||||
'DifferentialRevisionDependsOnRevisionEdgeType' => 'PhabricatorEdgeType',
|
'DifferentialRevisionDependsOnRevisionEdgeType' => 'PhabricatorEdgeType',
|
||||||
'DifferentialRevisionEditController' => 'DifferentialController',
|
|
||||||
'DifferentialRevisionEditEngine' => 'PhabricatorEditEngine',
|
'DifferentialRevisionEditEngine' => 'PhabricatorEditEngine',
|
||||||
'DifferentialRevisionEditProController' => 'DifferentialController',
|
'DifferentialRevisionEditProController' => 'DifferentialController',
|
||||||
'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine',
|
'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||||
|
|
|
@ -65,8 +65,6 @@ final class PhabricatorDifferentialApplication extends PhabricatorApplication {
|
||||||
),
|
),
|
||||||
'changeset/' => 'DifferentialChangesetViewController',
|
'changeset/' => 'DifferentialChangesetViewController',
|
||||||
'revision/' => array(
|
'revision/' => array(
|
||||||
'edit/(?:(?P<id>[1-9]\d*)/)?'
|
|
||||||
=> 'DifferentialRevisionEditController',
|
|
||||||
$this->getEditRoutePattern('editpro/')
|
$this->getEditRoutePattern('editpro/')
|
||||||
=> 'DifferentialRevisionEditProController',
|
=> 'DifferentialRevisionEditProController',
|
||||||
$this->getEditRoutePattern('attach/(?P<diffID>[^/]+)/to/')
|
$this->getEditRoutePattern('attach/(?P<diffID>[^/]+)/to/')
|
||||||
|
|
|
@ -23,6 +23,20 @@ final class DifferentialDiffViewController extends DifferentialController {
|
||||||
->setURI('/D'.$diff->getRevisionID().'?id='.$diff->getID());
|
->setURI('/D'.$diff->getRevisionID().'?id='.$diff->getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->isFormPost()) {
|
||||||
|
$diff_id = $diff->getID();
|
||||||
|
$revision_id = $request->getInt('revisionID');
|
||||||
|
if ($revision_id) {
|
||||||
|
$attach_uri = "/revision/attach/{$diff_id}/to/{$revision_id}/";
|
||||||
|
} else {
|
||||||
|
$attach_uri = "/revision/attach/{$diff_id}/to/";
|
||||||
|
}
|
||||||
|
$attach_uri = $this->getApplicationURI($attach_uri);
|
||||||
|
|
||||||
|
return id(new AphrontRedirectResponse())
|
||||||
|
->setURI($attach_uri);
|
||||||
|
}
|
||||||
|
|
||||||
$diff_phid = $diff->getPHID();
|
$diff_phid = $diff->getPHID();
|
||||||
$buildables = id(new HarbormasterBuildableQuery())
|
$buildables = id(new HarbormasterBuildableQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
|
@ -78,13 +92,7 @@ final class DifferentialDiffViewController extends DifferentialController {
|
||||||
$select);
|
$select);
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($request->getUser())
|
->setViewer($viewer)
|
||||||
->setAction('/differential/revision/edit/')
|
|
||||||
->addHiddenInput('diffID', $diff->getID())
|
|
||||||
->addHiddenInput('viaDiffView', 1)
|
|
||||||
->addHiddenInput(
|
|
||||||
id(new DifferentialRepositoryField())->getFieldKey(),
|
|
||||||
$diff->getRepositoryPHID())
|
|
||||||
->appendRemarkupInstructions(
|
->appendRemarkupInstructions(
|
||||||
pht(
|
pht(
|
||||||
'Review the diff for correctness. When you are satisfied, either '.
|
'Review the diff for correctness. When you are satisfied, either '.
|
||||||
|
@ -98,7 +106,7 @@ final class DifferentialDiffViewController extends DifferentialController {
|
||||||
->setValue(pht('Continue')));
|
->setValue(pht('Continue')));
|
||||||
|
|
||||||
$props = id(new DifferentialDiffProperty())->loadAllWhere(
|
$props = id(new DifferentialDiffProperty())->loadAllWhere(
|
||||||
'diffID = %d',
|
'diffID = %d',
|
||||||
$diff->getID());
|
$diff->getID());
|
||||||
$props = mpull($props, 'getData', 'getName');
|
$props = mpull($props, 'getData', 'getName');
|
||||||
|
|
||||||
|
|
|
@ -1,214 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DifferentialRevisionEditController
|
|
||||||
extends DifferentialController {
|
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
|
||||||
$viewer = $this->getViewer();
|
|
||||||
$id = $request->getURIData('id');
|
|
||||||
|
|
||||||
if (!$id) {
|
|
||||||
$id = $request->getInt('revisionID');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($id) {
|
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->withIDs(array($id))
|
|
||||||
->needRelationships(true)
|
|
||||||
->needReviewerStatus(true)
|
|
||||||
->needActiveDiffs(true)
|
|
||||||
->requireCapabilities(
|
|
||||||
array(
|
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
|
||||||
PhabricatorPolicyCapability::CAN_EDIT,
|
|
||||||
))
|
|
||||||
->executeOne();
|
|
||||||
if (!$revision) {
|
|
||||||
return new Aphront404Response();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$revision = DifferentialRevision::initializeNewRevision($viewer);
|
|
||||||
$revision->attachReviewerStatus(array());
|
|
||||||
}
|
|
||||||
|
|
||||||
$diff_id = $request->getInt('diffID');
|
|
||||||
if ($diff_id) {
|
|
||||||
$diff = id(new DifferentialDiffQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->withIDs(array($diff_id))
|
|
||||||
->executeOne();
|
|
||||||
if (!$diff) {
|
|
||||||
return new Aphront404Response();
|
|
||||||
}
|
|
||||||
if ($diff->getRevisionID()) {
|
|
||||||
// TODO: Redirect?
|
|
||||||
throw new Exception(
|
|
||||||
pht('This diff is already attached to a revision!'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$diff = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$diff) {
|
|
||||||
if (!$revision->getID()) {
|
|
||||||
throw new Exception(
|
|
||||||
pht('You can not create a new revision without a diff!'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// TODO: It would be nice to show the diff being attached in the UI.
|
|
||||||
}
|
|
||||||
|
|
||||||
$field_list = PhabricatorCustomField::getObjectFields(
|
|
||||||
$revision,
|
|
||||||
PhabricatorCustomField::ROLE_EDIT);
|
|
||||||
$field_list
|
|
||||||
->setViewer($viewer)
|
|
||||||
->readFieldsFromStorage($revision);
|
|
||||||
|
|
||||||
if ($request->getStr('viaDiffView') && $diff) {
|
|
||||||
$repo_key = id(new DifferentialRepositoryField())->getFieldKey();
|
|
||||||
$repository_field = idx(
|
|
||||||
$field_list->getFields(),
|
|
||||||
$repo_key);
|
|
||||||
if ($repository_field) {
|
|
||||||
$repository_field->setValue($request->getStr($repo_key));
|
|
||||||
}
|
|
||||||
$view_policy_key = id(new DifferentialViewPolicyField())->getFieldKey();
|
|
||||||
$view_policy_field = idx(
|
|
||||||
$field_list->getFields(),
|
|
||||||
$view_policy_key);
|
|
||||||
if ($view_policy_field) {
|
|
||||||
$view_policy_field->setValue($diff->getViewPolicy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$validation_exception = null;
|
|
||||||
if ($request->isFormPost() && !$request->getStr('viaDiffView')) {
|
|
||||||
|
|
||||||
$editor = id(new DifferentialTransactionEditor())
|
|
||||||
->setActor($viewer)
|
|
||||||
->setContentSourceFromRequest($request)
|
|
||||||
->setContinueOnNoEffect(true);
|
|
||||||
|
|
||||||
$xactions = $field_list->buildFieldTransactionsFromRequest(
|
|
||||||
new DifferentialTransaction(),
|
|
||||||
$request);
|
|
||||||
|
|
||||||
if ($diff) {
|
|
||||||
$repository_phid = null;
|
|
||||||
$repository_tokenizer = $request->getArr(
|
|
||||||
id(new DifferentialRepositoryField())->getFieldKey());
|
|
||||||
if ($repository_tokenizer) {
|
|
||||||
$repository_phid = reset($repository_tokenizer);
|
|
||||||
}
|
|
||||||
|
|
||||||
$xactions[] = id(new DifferentialTransaction())
|
|
||||||
->setTransactionType(DifferentialTransaction::TYPE_UPDATE)
|
|
||||||
->setNewValue($diff->getPHID());
|
|
||||||
|
|
||||||
$editor->setRepositoryPHIDOverride($repository_phid);
|
|
||||||
}
|
|
||||||
|
|
||||||
$comments = $request->getStr('comments');
|
|
||||||
if (strlen($comments)) {
|
|
||||||
$xactions[] = id(new DifferentialTransaction())
|
|
||||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
|
||||||
->attachComment(
|
|
||||||
id(new DifferentialTransactionComment())
|
|
||||||
->setContent($comments));
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$editor->applyTransactions($revision, $xactions);
|
|
||||||
$revision_uri = '/D'.$revision->getID();
|
|
||||||
return id(new AphrontRedirectResponse())->setURI($revision_uri);
|
|
||||||
} catch (PhabricatorApplicationTransactionValidationException $ex) {
|
|
||||||
$validation_exception = $ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$form = new AphrontFormView();
|
|
||||||
$form->setUser($request->getUser());
|
|
||||||
if ($diff) {
|
|
||||||
$form->addHiddenInput('diffID', $diff->getID());
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($revision->getID()) {
|
|
||||||
$form->setAction('/differential/revision/edit/'.$revision->getID().'/');
|
|
||||||
} else {
|
|
||||||
$form->setAction('/differential/revision/edit/');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($diff && $revision->getID()) {
|
|
||||||
$form
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTextAreaControl())
|
|
||||||
->setLabel(pht('Comments'))
|
|
||||||
->setName('comments')
|
|
||||||
->setCaption(pht("Explain what's new in this diff."))
|
|
||||||
->setValue($request->getStr('comments')))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormSubmitControl())
|
|
||||||
->setValue(pht('Save')))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormDividerControl()));
|
|
||||||
}
|
|
||||||
|
|
||||||
$field_list->appendFieldsToForm($form);
|
|
||||||
|
|
||||||
$submit = id(new AphrontFormSubmitControl())
|
|
||||||
->setValue('Save');
|
|
||||||
if ($diff) {
|
|
||||||
$submit->addCancelButton('/differential/diff/'.$diff->getID().'/');
|
|
||||||
} else {
|
|
||||||
$submit->addCancelButton('/D'.$revision->getID());
|
|
||||||
}
|
|
||||||
|
|
||||||
$form->appendChild($submit);
|
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
|
||||||
if ($revision->getID()) {
|
|
||||||
if ($diff) {
|
|
||||||
$header_icon = 'fa-upload';
|
|
||||||
$title = pht('Update Revision');
|
|
||||||
$crumbs->addTextCrumb(
|
|
||||||
'D'.$revision->getID(),
|
|
||||||
'/differential/diff/'.$diff->getID().'/');
|
|
||||||
} else {
|
|
||||||
$header_icon = 'fa-pencil';
|
|
||||||
$title = pht('Edit Revision: %s', $revision->getTitle());
|
|
||||||
$crumbs->addTextCrumb(
|
|
||||||
'D'.$revision->getID(),
|
|
||||||
'/D'.$revision->getID());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$header_icon = 'fa-plus-square';
|
|
||||||
$title = pht('Create New Differential Revision');
|
|
||||||
}
|
|
||||||
|
|
||||||
$form_box = id(new PHUIObjectBoxView())
|
|
||||||
->setHeaderText('Revision')
|
|
||||||
->setValidationException($validation_exception)
|
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
|
||||||
->setForm($form);
|
|
||||||
|
|
||||||
$crumbs->addTextCrumb($title);
|
|
||||||
$crumbs->setBorder(true);
|
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
|
||||||
->setHeader($title)
|
|
||||||
->setHeaderIcon($header_icon);
|
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
|
||||||
->setHeader($header)
|
|
||||||
->setFooter($form_box);
|
|
||||||
|
|
||||||
return $this->newPage()
|
|
||||||
->setTitle($title)
|
|
||||||
->setCrumbs($crumbs)
|
|
||||||
->appendChild($view);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -570,7 +570,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$curtain->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-pencil')
|
->setIcon('fa-pencil')
|
||||||
->setHref("/differential/revision/edit/{$revision_id}/")
|
->setHref("/differential/revision/editpro/{$revision_id}/")
|
||||||
->setName(pht('Edit Revision'))
|
->setName(pht('Edit Revision'))
|
||||||
->setDisabled(!$can_edit)
|
->setDisabled(!$can_edit)
|
||||||
->setWorkflow(!$can_edit));
|
->setWorkflow(!$can_edit));
|
||||||
|
|
|
@ -118,10 +118,6 @@ abstract class DifferentialCoreCustomField
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearInEditView() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function readValueFromObject(PhabricatorCustomFieldInterface $object) {
|
public function readValueFromObject(PhabricatorCustomFieldInterface $object) {
|
||||||
if ($this->isCoreFieldRequired()) {
|
if ($this->isCoreFieldRequired()) {
|
||||||
$this->setFieldError(true);
|
$this->setFieldError(true);
|
||||||
|
|
|
@ -15,10 +15,6 @@ final class DifferentialManiphestTasksField
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearInEditView() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFieldName() {
|
public function getFieldName() {
|
||||||
return pht('Maniphest Tasks');
|
return pht('Maniphest Tasks');
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,6 @@ final class DifferentialProjectsField
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearInEditView() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function shouldAppearInApplicationTransactions() {
|
public function shouldAppearInApplicationTransactions() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,6 @@ final class DifferentialRequiredSignaturesField
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearInEditView() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function readValueFromRevision(DifferentialRevision $revision) {
|
protected function readValueFromRevision(DifferentialRevision $revision) {
|
||||||
return self::loadForRevision($revision);
|
return self::loadForRevision($revision);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,6 @@ final class DifferentialReviewedByField
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearInEditView() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function canDisableField() {
|
public function canDisableField() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,23 +95,26 @@ final class DifferentialRevisionEditEngine
|
||||||
$diff_phid = null;
|
$diff_phid = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_update = ($diff && $object->getID());
|
$is_create = $this->getIsCreate();
|
||||||
|
$is_update = ($diff && !$is_create);
|
||||||
|
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
|
||||||
$fields[] = id(new PhabricatorHandlesEditField())
|
if ($diff || $is_create) {
|
||||||
->setKey('update')
|
$fields[] = id(new PhabricatorHandlesEditField())
|
||||||
->setLabel(pht('Update Diff'))
|
->setKey('update')
|
||||||
->setDescription(pht('New diff to create or update the revision with.'))
|
->setLabel(pht('Update Diff'))
|
||||||
->setConduitDescription(pht('Create or update a revision with a diff.'))
|
->setDescription(pht('New diff to create or update the revision with.'))
|
||||||
->setConduitTypeDescription(pht('PHID of the diff.'))
|
->setConduitDescription(pht('Create or update a revision with a diff.'))
|
||||||
->setTransactionType(DifferentialTransaction::TYPE_UPDATE)
|
->setConduitTypeDescription(pht('PHID of the diff.'))
|
||||||
->setHandleParameterType(new AphrontPHIDListHTTPParameterType())
|
->setTransactionType(DifferentialTransaction::TYPE_UPDATE)
|
||||||
->setSingleValue($diff_phid)
|
->setHandleParameterType(new AphrontPHIDListHTTPParameterType())
|
||||||
->setIsReorderable(false)
|
->setSingleValue($diff_phid)
|
||||||
->setIsDefaultable(false)
|
->setIsReorderable(false)
|
||||||
->setIsInvisible(true)
|
->setIsDefaultable(false)
|
||||||
->setIsLockable(false);
|
->setIsInvisible(true)
|
||||||
|
->setIsLockable(false);
|
||||||
|
}
|
||||||
|
|
||||||
if ($is_update) {
|
if ($is_update) {
|
||||||
$fields[] = id(new PhabricatorInstructionsEditField())
|
$fields[] = id(new PhabricatorInstructionsEditField())
|
||||||
|
@ -194,7 +197,7 @@ final class DifferentialRevisionEditEngine
|
||||||
private function isCustomFieldEnabled(DifferentialRevision $revision, $key) {
|
private function isCustomFieldEnabled(DifferentialRevision $revision, $key) {
|
||||||
$field_list = PhabricatorCustomField::getObjectFields(
|
$field_list = PhabricatorCustomField::getObjectFields(
|
||||||
$revision,
|
$revision,
|
||||||
PhabricatorCustomField::ROLE_EDIT);
|
PhabricatorCustomField::ROLE_VIEW);
|
||||||
|
|
||||||
$fields = $field_list->getFields();
|
$fields = $field_list->getFields();
|
||||||
return isset($fields[$key]);
|
return isset($fields[$key]);
|
||||||
|
|
|
@ -70,6 +70,7 @@ final class DifferentialRevision extends DifferentialDAO
|
||||||
->setAuthorPHID($actor->getPHID())
|
->setAuthorPHID($actor->getPHID())
|
||||||
->attachRelationships(array())
|
->attachRelationships(array())
|
||||||
->attachRepository(null)
|
->attachRepository(null)
|
||||||
|
->attachReviewerStatus(array())
|
||||||
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
|
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,14 +47,13 @@ final class PhabricatorCustomFieldEditField
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function newEditType() {
|
protected function newEditType() {
|
||||||
$conduit_type = $this->newConduitParameterType();
|
|
||||||
if (!$conduit_type) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$type = id(new PhabricatorCustomFieldEditType())
|
$type = id(new PhabricatorCustomFieldEditType())
|
||||||
->setCustomField($this->getCustomField())
|
->setCustomField($this->getCustomField());
|
||||||
->setConduitParameterType($conduit_type);
|
|
||||||
|
$conduit_type = $this->newConduitParameterType();
|
||||||
|
if ($conduit_type) {
|
||||||
|
$type->setConduitParameterType($conduit_type);
|
||||||
|
}
|
||||||
|
|
||||||
return $type;
|
return $type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,6 @@ final class PhabricatorCustomFieldEditEngineExtension
|
||||||
PhabricatorEditEngine $engine,
|
PhabricatorEditEngine $engine,
|
||||||
PhabricatorApplicationTransactionInterface $object) {
|
PhabricatorApplicationTransactionInterface $object) {
|
||||||
|
|
||||||
// TODO: Remove this hack once Differential modernizes more fully. Today,
|
|
||||||
// its custom fields are too custom to interact cleanly with EditEngine.
|
|
||||||
if ($object instanceof DifferentialRevision) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$field_list = PhabricatorCustomField::getObjectFields(
|
$field_list = PhabricatorCustomField::getObjectFields(
|
||||||
|
|
Loading…
Reference in a new issue