diff --git a/src/applications/almanac/editor/AlmanacBindingEditEngine.php b/src/applications/almanac/editor/AlmanacBindingEditEngine.php --- a/src/applications/almanac/editor/AlmanacBindingEditEngine.php +++ b/src/applications/almanac/editor/AlmanacBindingEditEngine.php @@ -152,6 +152,19 @@ ->setConduitDescription(pht('Set the interface to bind.')) ->setConduitTypeDescription(pht('Interface PHID.')) ->setValue($object->getInterfacePHID()), + id(new PhabricatorBoolEditField()) + ->setKey('disabled') + ->setLabel(pht('Disabled')) + ->setIsConduitOnly(true) + ->setTransactionType( + AlmanacBindingDisableTransaction::TRANSACTIONTYPE) + ->setDescription(pht('Disable or enable the binding.')) + ->setConduitDescription(pht('Disable or enable the binding.')) + ->setConduitTypeDescription(pht('True to disable the binding.')) + ->setValue($object->getIsDisabled()) + ->setOptions( + pht('Enable Binding'), + pht('Disable Binding')), ); } diff --git a/src/applications/almanac/storage/AlmanacBinding.php b/src/applications/almanac/storage/AlmanacBinding.php --- a/src/applications/almanac/storage/AlmanacBinding.php +++ b/src/applications/almanac/storage/AlmanacBinding.php @@ -244,6 +244,10 @@ ->setKey('interfacePHID') ->setType('phid') ->setDescription(pht('The interface the service is bound to.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('disabled') + ->setType('bool') + ->setDescription(pht('Interface status.')), ); } @@ -252,11 +256,15 @@ 'servicePHID' => $this->getServicePHID(), 'devicePHID' => $this->getDevicePHID(), 'interfacePHID' => $this->getInterfacePHID(), + 'disabled' => (bool)$this->getIsDisabled(), ); } public function getConduitSearchAttachments() { - return array(); + return array( + id(new AlmanacPropertiesSearchEngineAttachment()) + ->setAttachmentKey('properties'), + ); } }