Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15421168
D14788.id35760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14788.id35760.diff
View Options
diff --git a/src/applications/paste/editor/PhabricatorPasteEditEngine.php b/src/applications/paste/editor/PhabricatorPasteEditEngine.php
--- a/src/applications/paste/editor/PhabricatorPasteEditEngine.php
+++ b/src/applications/paste/editor/PhabricatorPasteEditEngine.php
@@ -83,6 +83,14 @@
->setMonospaced(true)
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
->setValue($object->getRawContent()),
+ id(new PhabricatorSelectEditField())
+ ->setKey('status')
+ ->setLabel(pht('Status'))
+ ->setDescription(pht('Active or archive the paste.'))
+ ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS)
+ ->setIsConduitOnly(true)
+ ->setValue($object->getStatus())
+ ->setOptions(PhabricatorPaste::getStatusNameMap()),
);
}
diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEditField.php
@@ -29,6 +29,7 @@
private $isDefaultable = true;
private $isLockable = true;
private $isCopyable = false;
+ private $isConduitOnly = false;
public function setKey($key) {
$this->key = $key;
@@ -111,6 +112,15 @@
return $this->isReorderable;
}
+ public function setIsConduitOnly($is_conduit_only) {
+ $this->isConduitOnly = $is_conduit_only;
+ return $this;
+ }
+
+ public function getIsConduitOnly() {
+ return $this->isConduitOnly;
+ }
+
public function setIsEditDefaults($is_edit_defaults) {
$this->isEditDefaults = $is_edit_defaults;
return $this;
@@ -197,6 +207,10 @@
}
protected function buildControl() {
+ if ($this->getIsConduitOnly()) {
+ return null;
+ }
+
$control = $this->newControl();
if ($control === null) {
return null;
@@ -466,6 +480,10 @@
}
final public function getHTTPParameterType() {
+ if ($this->getIsConduitOnly()) {
+ return null;
+ }
+
$type = $this->newHTTPParameterType();
if ($type) {
@@ -492,8 +510,16 @@
}
protected function newEditType() {
+ // TODO: This could be a little cleaner.
+ $http_type = $this->getHTTPParameterType();
+ if ($http_type) {
+ $value_type = $http_type->getTypeName();
+ } else {
+ $value_type = 'wild';
+ }
+
return id(new PhabricatorSimpleEditType())
- ->setValueType($this->getHTTPParameterType()->getTypeName());
+ ->setValueType($value_type);
}
protected function getEditType() {
@@ -523,6 +549,10 @@
}
public function getWebEditTypes() {
+ if ($this->getIsConduitOnly()) {
+ return array();
+ }
+
$edit_type = $this->getEditType();
if ($edit_type === null) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 22 2025, 9:25 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7388978
Default Alt Text
D14788.id35760.diff (2 KB)
Attached To
Mode
D14788: Allow pastes to be activated/archived via Conduit
Attached
Detach File
Event Timeline
Log In to Comment