@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add drydock.blueprint.edit Conduit method

Summary:
Ref: https://admin.phacility.com/PHI243

Since our use case primarily focuses on transaction editing, this patch implements the `drydock.blueprint.edit` api method with the understanding that:
a) this is a work in progress
b) object editing is supported, but object creation is not yet implemented

Test Plan:
* updated existing blueprints via Conduit UI
* regression tested `maniphest.edit` by creating new and updating existing tasks

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, yelirekim, jcox

Differential Revision: https://secure.phabricator.com/D18822

+43 -1
+2
src/__phutil_library_map__.php
··· 1004 1004 'DrydockBlueprintCustomField' => 'applications/drydock/customfield/DrydockBlueprintCustomField.php', 1005 1005 'DrydockBlueprintDatasource' => 'applications/drydock/typeahead/DrydockBlueprintDatasource.php', 1006 1006 'DrydockBlueprintDisableController' => 'applications/drydock/controller/DrydockBlueprintDisableController.php', 1007 + 'DrydockBlueprintEditConduitAPIMethod' => 'applications/drydock/conduit/DrydockBlueprintEditConduitAPIMethod.php', 1007 1008 'DrydockBlueprintEditController' => 'applications/drydock/controller/DrydockBlueprintEditController.php', 1008 1009 'DrydockBlueprintEditEngine' => 'applications/drydock/editor/DrydockBlueprintEditEngine.php', 1009 1010 'DrydockBlueprintEditor' => 'applications/drydock/editor/DrydockBlueprintEditor.php', ··· 6090 6091 'DrydockBlueprintCustomField' => 'PhabricatorCustomField', 6091 6092 'DrydockBlueprintDatasource' => 'PhabricatorTypeaheadDatasource', 6092 6093 'DrydockBlueprintDisableController' => 'DrydockBlueprintController', 6094 + 'DrydockBlueprintEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 6093 6095 'DrydockBlueprintEditController' => 'DrydockBlueprintController', 6094 6096 'DrydockBlueprintEditEngine' => 'PhabricatorEditEngine', 6095 6097 'DrydockBlueprintEditor' => 'PhabricatorApplicationTransactionEditor',
+20
src/applications/drydock/conduit/DrydockBlueprintEditConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class DrydockBlueprintEditConduitAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'drydock.blueprint.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new DrydockBlueprintEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'WARNING: Apply transactions to edit an existing blueprint. This method '. 17 + 'can not create new blueprints.'); 18 + } 19 + 20 + }
+11
src/applications/drydock/editor/DrydockBlueprintEditEngine.php
··· 51 51 return $blueprint; 52 52 } 53 53 54 + protected function newEditableObjectForDocumentation() { 55 + // In order to generate the proper list of fields/transactions for a 56 + // blueprint, a blueprint's type needs to be known upfront, and there's 57 + // currently no way to pre-specify the type. Hardcoding an implementation 58 + // here prevents the fatal on the Conduit API page and allows transactions 59 + // to be edited. 60 + $impl = new DrydockWorkingCopyBlueprintImplementation(); 61 + $this->setBlueprintImplementation($impl); 62 + return $this->newEditableObject(); 63 + } 64 + 54 65 protected function newObjectQuery() { 55 66 return new DrydockBlueprintQuery(); 56 67 }
+10 -1
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 630 630 return $this->isCreate; 631 631 } 632 632 633 + /** 634 + * Initialize a new object for documentation creation. 635 + * 636 + * @return object Newly initialized object. 637 + * @task load 638 + */ 639 + protected function newEditableObjectForDocumentation() { 640 + return $this->newEditableObject(); 641 + } 633 642 634 643 /** 635 644 * Flag this workflow as a create or edit. ··· 2198 2207 return array(); 2199 2208 } 2200 2209 2201 - $object = $this->newEditableObject(); 2210 + $object = $this->newEditableObjectForDocumentation(); 2202 2211 $fields = $this->buildEditFields($object); 2203 2212 return $this->getConduitEditTypesFromFields($fields); 2204 2213 }