From 327ac921c28b917dfc9215a7537c232f016ef07e Mon Sep 17 00:00:00 2001 From: Mukunda Modell Date: Mon, 19 Jun 2023 08:54:32 +0200 Subject: [PATCH] Conduit column.search: add status, sequence and isDefault to API results Summary: This seems like a fairly obvious oversight with the column.search API. Knowing: 1. isHidden - boolean to indicate Active vs Archived 2. isDefaultColumn - the one that Tasks get dropped in by default, usually called "Backlog" 3. sequence - numerical order on the Workboard are all necessary for a lot of things that very sensible real-world API clients need to do when working with columns. Partial cherry-pick from: https://phabricator.wikimedia.org/rPHABebfe30890b52784d222ec4ed36c05462b2a57f92 Closes T15484 Test Plan: Tested on phabricator.wikimedia.org over many months and used by real client apps. To do additional tests, visit this page: /conduit/method/project.column.search/ Check that the new fields are returned correctly and nothing explodes. Reviewers: #blessed_committers, O1 Blessed Committers, 0, avivey, valerio.bozzolan Reviewed By: #blessed_committers, O1 Blessed Committers, 0, valerio.bozzolan Subscribers: Cigaryno, 0, speck, tobiaswiese, valerio.bozzolan, Matthew Maniphest Tasks: T15081, T15484 Differential Revision: https://we.phorge.it/D25038 --- .../project/storage/PhabricatorProjectColumn.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php index 49d7f28a9f..e4359acd1b 100644 --- a/src/applications/project/storage/PhabricatorProjectColumn.php +++ b/src/applications/project/storage/PhabricatorProjectColumn.php @@ -271,6 +271,19 @@ final class PhabricatorProjectColumn pht( 'For columns that proxy another object (like a subproject or '. 'milestone), the PHID of the object they proxy.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('isHidden') + ->setType('bool') + ->setDescription(pht('True if this column is hidden.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('isDefaultColumn') + ->setType('bool') + ->setDescription(pht('True if this is the default column.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('sequence') + ->setType('int') + ->setDescription( + pht('The sequence in which this column appears on the workboard.')), ); } @@ -279,6 +292,9 @@ final class PhabricatorProjectColumn 'name' => $this->getDisplayName(), 'proxyPHID' => $this->getProxyPHID(), 'project' => $this->getProject()->getRefForConduit(), + 'isHidden' => $this->isHidden(), + 'isDefaultColumn' => $this->isDefaultColumn(), + 'sequence' => (int)$this->getSequence(), ); }