diff --git a/src/applications/project/conduit/ProjectCreateConduitAPIMethod.php b/src/applications/project/conduit/ProjectCreateConduitAPIMethod.php index 47be6aa3f9..a209fd9a40 100644 --- a/src/applications/project/conduit/ProjectCreateConduitAPIMethod.php +++ b/src/applications/project/conduit/ProjectCreateConduitAPIMethod.php @@ -14,6 +14,9 @@ final class ProjectCreateConduitAPIMethod extends ProjectConduitAPIMethod { return array( 'name' => 'required string', 'members' => 'optional list', + 'icon' => 'optional string', + 'color' => 'optional string', + 'tags' => 'optional list', ); } @@ -37,6 +40,24 @@ final class ProjectCreateConduitAPIMethod extends ProjectConduitAPIMethod { ->setTransactionType($type_name) ->setNewValue($request->getValue('name')); + if ($request->getValue('icon')) { + $xactions[] = id(new PhabricatorProjectTransaction()) + ->setTransactionType(PhabricatorProjectTransaction::TYPE_ICON) + ->setNewValue($request->getValue('icon')); + } + + if ($request->getValue('color')) { + $xactions[] = id(new PhabricatorProjectTransaction()) + ->setTransactionType(PhabricatorProjectTransaction::TYPE_COLOR) + ->setNewValue($request->getValue('color')); + } + + if ($request->getValue('tags')) { + $xactions[] = id(new PhabricatorProjectTransaction()) + ->setTransactionType(PhabricatorProjectTransaction::TYPE_SLUGS) + ->setNewValue($request->getValue('tags')); + } + $xactions[] = id(new PhabricatorProjectTransaction()) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setMetadataValue( diff --git a/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php b/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php index f65578e349..3d059d064d 100644 --- a/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php +++ b/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php @@ -27,6 +27,8 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod { 'names' => 'optional list', 'phids' => 'optional list', 'slugs' => 'optional list', + 'icons' => 'optional list', + 'colors' => 'optional list', 'status' => 'optional '.$status_const, 'members' => 'optional list', @@ -71,6 +73,22 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod { $query->withSlugs($slugs); } + $request->getValue('icons'); + if ($request->getValue('icons')) { + $icons = array(); + // the internal 'fa-' prefix is a detail hidden from api clients + // but needs to pre prepended to the values in the icons array: + foreach ($request->getValue('icons') as $value) { + $icons[] = 'fa-'.$value; + } + $query->withIcons($icons); + } + + $colors = $request->getValue('colors'); + if ($colors) { + $query->withColors($colors); + } + $members = $request->getValue('members'); if ($members) { $query->withMemberPHIDs($members);