1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Add stub "harbormaster.build.edit" and "harbormaster.buildable.edit" API methods

Summary: Ref T13072. These don't do anything useful yet, but get the skeletons in.

Test Plan: Loaded documentation pages without fataling.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21695
This commit is contained in:
epriestley 2021-07-16 09:28:47 -07:00
parent 346ffc51e1
commit 2ff1d4b3b0
5 changed files with 219 additions and 0 deletions

View file

@ -1388,6 +1388,8 @@ phutil_register_library_map(array(
'HarbormasterBuildArtifactQuery' => 'applications/harbormaster/query/HarbormasterBuildArtifactQuery.php',
'HarbormasterBuildAutoplan' => 'applications/harbormaster/autoplan/HarbormasterBuildAutoplan.php',
'HarbormasterBuildDependencyDatasource' => 'applications/harbormaster/typeahead/HarbormasterBuildDependencyDatasource.php',
'HarbormasterBuildEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php',
'HarbormasterBuildEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildEditEngine.php',
'HarbormasterBuildEngine' => 'applications/harbormaster/engine/HarbormasterBuildEngine.php',
'HarbormasterBuildFailureException' => 'applications/harbormaster/exception/HarbormasterBuildFailureException.php',
'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php',
@ -1472,6 +1474,8 @@ phutil_register_library_map(array(
'HarbormasterBuildable' => 'applications/harbormaster/storage/HarbormasterBuildable.php',
'HarbormasterBuildableActionController' => 'applications/harbormaster/controller/HarbormasterBuildableActionController.php',
'HarbormasterBuildableAdapterInterface' => 'applications/harbormaster/herald/HarbormasterBuildableAdapterInterface.php',
'HarbormasterBuildableEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php',
'HarbormasterBuildableEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildableEditEngine.php',
'HarbormasterBuildableEngine' => 'applications/harbormaster/engine/HarbormasterBuildableEngine.php',
'HarbormasterBuildableInterface' => 'applications/harbormaster/interface/HarbormasterBuildableInterface.php',
'HarbormasterBuildableListController' => 'applications/harbormaster/controller/HarbormasterBuildableListController.php',
@ -7605,6 +7609,8 @@ phutil_register_library_map(array(
'HarbormasterBuildArtifactQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildAutoplan' => 'Phobject',
'HarbormasterBuildDependencyDatasource' => 'PhabricatorTypeaheadDatasource',
'HarbormasterBuildEditAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'HarbormasterBuildEditEngine' => 'PhabricatorEditEngine',
'HarbormasterBuildEngine' => 'Phobject',
'HarbormasterBuildFailureException' => 'Exception',
'HarbormasterBuildGraph' => 'AbstractDirectedGraph',
@ -7730,6 +7736,8 @@ phutil_register_library_map(array(
'PhabricatorDestructibleInterface',
),
'HarbormasterBuildableActionController' => 'HarbormasterController',
'HarbormasterBuildableEditAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'HarbormasterBuildableEditEngine' => 'PhabricatorEditEngine',
'HarbormasterBuildableEngine' => 'Phobject',
'HarbormasterBuildableListController' => 'HarbormasterController',
'HarbormasterBuildableMessageTransaction' => 'HarbormasterBuildableTransactionType',

View file

@ -0,0 +1,20 @@
<?php
final class HarbormasterBuildEditAPIMethod
extends PhabricatorEditEngineAPIMethod {
public function getAPIMethodName() {
return 'harbormaster.build.edit';
}
public function newEditEngine() {
return new HarbormasterBuildEditEngine();
}
public function getMethodSummary() {
return pht(
'Apply transactions to create a new build or edit an existing '.
'one.');
}
}

View file

@ -0,0 +1,20 @@
<?php
final class HarbormasterBuildableEditAPIMethod
extends PhabricatorEditEngineAPIMethod {
public function getAPIMethodName() {
return 'harbormaster.buildable.edit';
}
public function newEditEngine() {
return new HarbormasterBuildableEditEngine();
}
public function getMethodSummary() {
return pht(
'Apply transactions to create a new buildable or edit an existing '.
'one.');
}
}

View file

@ -0,0 +1,87 @@
<?php
final class HarbormasterBuildEditEngine
extends PhabricatorEditEngine {
const ENGINECONST = 'harbormaster.build';
public function isEngineConfigurable() {
return false;
}
public function getEngineName() {
return pht('Harbormaster Builds');
}
public function getSummaryHeader() {
return pht('Edit Harbormaster Build Configurations');
}
public function getSummaryText() {
return pht('This engine is used to edit Harbormaster builds.');
}
public function getEngineApplicationClass() {
return 'PhabricatorHarbormasterApplication';
}
protected function newEditableObject() {
$viewer = $this->getViewer();
return HarbormasterBuild::initializeNewBuild($viewer);
}
protected function newObjectQuery() {
return new HarbormasterBuildQuery();
}
protected function newEditableObjectForDocumentation() {
$object = new DifferentialRevision();
$buildable = id(new HarbormasterBuildable())
->attachBuildableObject($object);
return $this->newEditableObject()
->attachBuildable($buildable);
}
protected function getObjectCreateTitleText($object) {
return pht('Create Build');
}
protected function getObjectCreateButtonText($object) {
return pht('Create Build');
}
protected function getObjectEditTitleText($object) {
return pht('Edit Build: %s', $object->getName());
}
protected function getObjectEditShortText($object) {
return pht('Edit Build');
}
protected function getObjectCreateShortText() {
return pht('Create Build');
}
protected function getObjectName() {
return pht('Build');
}
protected function getEditorURI() {
return '/harbormaster/build/edit/';
}
protected function getObjectCreateCancelURI($object) {
return '/harbormaster/';
}
protected function getObjectViewURI($object) {
return $object->getURI();
}
protected function buildCustomEditFields($object) {
return array();
}
}

View file

@ -0,0 +1,84 @@
<?php
final class HarbormasterBuildableEditEngine
extends PhabricatorEditEngine {
const ENGINECONST = 'harbormaster.buildable';
public function isEngineConfigurable() {
return false;
}
public function getEngineName() {
return pht('Harbormaster Buildables');
}
public function getSummaryHeader() {
return pht('Edit Harbormaster Buildable Configurations');
}
public function getSummaryText() {
return pht('This engine is used to edit Harbormaster buildables.');
}
public function getEngineApplicationClass() {
return 'PhabricatorHarbormasterApplication';
}
protected function newEditableObject() {
$viewer = $this->getViewer();
return HarbormasterBuildable::initializeNewBuildable($viewer);
}
protected function newObjectQuery() {
return new HarbormasterBuildableQuery();
}
protected function newEditableObjectForDocumentation() {
$object = new DifferentialRevision();
return $this->newEditableObject()
->attachBuildableObject($object);
}
protected function getObjectCreateTitleText($object) {
return pht('Create Buildable');
}
protected function getObjectCreateButtonText($object) {
return pht('Create Buildable');
}
protected function getObjectEditTitleText($object) {
return pht('Edit Buildable: %s', $object->getName());
}
protected function getObjectEditShortText($object) {
return pht('Edit Buildable');
}
protected function getObjectCreateShortText() {
return pht('Create Buildable');
}
protected function getObjectName() {
return pht('Buildable');
}
protected function getEditorURI() {
return '/harbormaster/buildable/edit/';
}
protected function getObjectCreateCancelURI($object) {
return '/harbormaster/';
}
protected function getObjectViewURI($object) {
return $object->getURI();
}
protected function buildCustomEditFields($object) {
return array();
}
}