From 404b55ce573a1548af73c23f6de96537cf22e244 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 10 Mar 2021 09:33:49 -0800 Subject: [PATCH] Give audit statuses API constants that match their UI strings Summary: Ref T13631. These strings were a little inconsistent; make them more consistent. Test Plan: Called `diffusion.commit.search` with the appropriate attachment, saw slightly more consistent statuses. Maniphest Tasks: T13631 Differential Revision: https://secure.phabricator.com/D21600 --- .../audit/constants/PhabricatorAuditRequestStatus.php | 11 ++++++++++- .../DiffusionAuditorsSearchEngineAttachment.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/applications/audit/constants/PhabricatorAuditRequestStatus.php b/src/applications/audit/constants/PhabricatorAuditRequestStatus.php index e3fb188a14..ea0c496df0 100644 --- a/src/applications/audit/constants/PhabricatorAuditRequestStatus.php +++ b/src/applications/audit/constants/PhabricatorAuditRequestStatus.php @@ -37,6 +37,10 @@ final class PhabricatorAuditRequestStatus extends Phobject { return $this->key; } + public function getStatusValueForConduit() { + return $this->getMapProperty('value.conduit'); + } + public function isResigned() { return ($this->key === self::RESIGNED); } @@ -53,26 +57,31 @@ final class PhabricatorAuditRequestStatus extends Phobject { 'name' => pht('Audit Required'), 'icon' => 'fa-exclamation-circle', 'icon.color' => 'orange', + 'value.conduit' => 'audit-required', ), self::AUDIT_REQUESTED => array( 'name' => pht('Audit Requested'), 'icon' => 'fa-exclamation-circle', 'icon.color' => 'orange', + 'value.conduit' => 'audit-requested', ), self::CONCERNED => array( - 'name' => pht('concern Raised'), + 'name' => pht('Concern Raised'), 'icon' => 'fa-times-circle', 'icon.color' => 'red', + 'value.conduit' => 'concern-raised', ), self::ACCEPTED => array( 'name' => pht('Accepted'), 'icon' => 'fa-check-circle', 'icon.color' => 'green', + 'value.conduit' => 'accepted', ), self::RESIGNED => array( 'name' => pht('Resigned'), 'icon' => 'fa-times', 'icon.color' => 'grey', + 'value.conduit' => 'resigned', ), ); } diff --git a/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php b/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php index 1dfcbcc05b..6023e8b678 100644 --- a/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php +++ b/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php @@ -24,7 +24,7 @@ final class DiffusionAuditorsSearchEngineAttachment $list[] = array( 'auditorPHID' => $auditor->getAuditorPHID(), - 'status' => $status->getStatusValue(), + 'status' => $status->getStatusValueForConduit(), ); }