diff --git a/resources/sql/autopatches/20180309.owners.01.primaryowner.sql b/resources/sql/autopatches/20180309.owners.01.primaryowner.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20180309.owners.01.primaryowner.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_owners.owners_package + DROP primaryOwnerPHID; diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php --- a/src/applications/owners/storage/PhabricatorOwnersPackage.php +++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php @@ -16,7 +16,6 @@ protected $auditingEnabled; protected $autoReview; protected $description; - protected $primaryOwnerPHID; protected $mailKey; protected $status; protected $viewPolicy; @@ -122,7 +121,6 @@ self::CONFIG_COLUMN_SCHEMA => array( 'name' => 'sort', 'description' => 'text', - 'primaryOwnerPHID' => 'phid?', 'auditingEnabled' => 'bool', 'mailKey' => 'bytes20', 'status' => 'text32', @@ -601,6 +599,18 @@ ->setKey('owners') ->setType('list>') ->setDescription(pht('List of package owners.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('review') + ->setType('map') + ->setDescription(pht('Auto review information.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('audit') + ->setType('map') + ->setDescription(pht('Auto audit information.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('dominion') + ->setType('string') + ->setDescription(pht('Dominion setting.')), ); } @@ -612,11 +622,40 @@ ); } + $review_map = self::getAutoreviewOptionsMap(); + $review_value = $this->getAutoReview(); + if (isset($review_map[$review_value])) { + $review_label = $review_map[$review_value]['name']; + } else { + $review_label = pht('Unknown ("%s")', $review_value); + } + + $review = array( + 'value' => $review_value, + 'label' => $review_label, + ); + + if ($this->getAuditingEnabled()) { + $audit_value = 'audit'; + $audit_label = pht('Auditing Enabled'); + } else { + $audit_value = 'none'; + $audit_label = pht('No Auditing'); + } + + $audit = array( + 'value' => $audit_value, + 'label' => $audit_label, + ); + return array( 'name' => $this->getName(), 'description' => $this->getDescription(), 'status' => $this->getStatus(), 'owners' => $owner_list, + 'review' => $review, + 'audit' => $audit, + 'dominion' => $this->getDominion(), ); }