@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 'colors' and 'icons' fields to conduit api for Projects

Summary:
This simply adds colors, icons to ProjectQueryConduitAPIMethod and
ProjectCreateConduitAPIMethod.

Additionally, adds 'tags' to ProjectCreateConduitAPIMethod

Change-Id: Ic6332fe174a59ecfd60cea281ccb0ed938136141

Test Plan:
create a new project with project.create, specify icon, color and tags

call project.query with colors and icons args, check for results
containing matching projects.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: legoktm, aklapper, Korvin, epriestley, valhallasw, qgil

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

authored by

Mukunda Modell and committed by
epriestley
dfac9d7f d3a84687

+39
+21
src/applications/project/conduit/ProjectCreateConduitAPIMethod.php
··· 14 14 return array( 15 15 'name' => 'required string', 16 16 'members' => 'optional list<phid>', 17 + 'icon' => 'optional string', 18 + 'color' => 'optional string', 19 + 'tags' => 'optional list<string>', 17 20 ); 18 21 } 19 22 ··· 36 39 $xactions[] = id(new PhabricatorProjectTransaction()) 37 40 ->setTransactionType($type_name) 38 41 ->setNewValue($request->getValue('name')); 42 + 43 + if ($request->getValue('icon')) { 44 + $xactions[] = id(new PhabricatorProjectTransaction()) 45 + ->setTransactionType(PhabricatorProjectTransaction::TYPE_ICON) 46 + ->setNewValue($request->getValue('icon')); 47 + } 48 + 49 + if ($request->getValue('color')) { 50 + $xactions[] = id(new PhabricatorProjectTransaction()) 51 + ->setTransactionType(PhabricatorProjectTransaction::TYPE_COLOR) 52 + ->setNewValue($request->getValue('color')); 53 + } 54 + 55 + if ($request->getValue('tags')) { 56 + $xactions[] = id(new PhabricatorProjectTransaction()) 57 + ->setTransactionType(PhabricatorProjectTransaction::TYPE_SLUGS) 58 + ->setNewValue($request->getValue('tags')); 59 + } 39 60 40 61 $xactions[] = id(new PhabricatorProjectTransaction()) 41 62 ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
+18
src/applications/project/conduit/ProjectQueryConduitAPIMethod.php
··· 27 27 'names' => 'optional list<string>', 28 28 'phids' => 'optional list<phid>', 29 29 'slugs' => 'optional list<string>', 30 + 'icons' => 'optional list<string>', 31 + 'colors' => 'optional list<string>', 30 32 'status' => 'optional '.$status_const, 31 33 32 34 'members' => 'optional list<phid>', ··· 69 71 $slugs = $request->getValue('slugs'); 70 72 if ($slugs) { 71 73 $query->withSlugs($slugs); 74 + } 75 + 76 + $request->getValue('icons'); 77 + if ($request->getValue('icons')) { 78 + $icons = array(); 79 + // the internal 'fa-' prefix is a detail hidden from api clients 80 + // but needs to pre prepended to the values in the icons array: 81 + foreach ($request->getValue('icons') as $value) { 82 + $icons[] = 'fa-'.$value; 83 + } 84 + $query->withIcons($icons); 85 + } 86 + 87 + $colors = $request->getValue('colors'); 88 + if ($colors) { 89 + $query->withColors($colors); 72 90 } 73 91 74 92 $members = $request->getValue('members');