From c505876d6162ed4d5fcabe52b2ede3b338addaaa Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 8 May 2017 15:04:28 -0700 Subject: [PATCH] Clean up some Passphrase transaction bugs Summary: Ref T12685. Makes the description field full remarkup and fixes setting a credential secret after destruction. Test Plan: Change description a lot, set and destroy credentials. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12685 Differential Revision: https://secure.phabricator.com/D17851 --- .../PassphraseCredentialEditController.php | 4 ++-- .../PassphraseCredentialSecretIDTransaction.php | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/applications/passphrase/controller/PassphraseCredentialEditController.php b/src/applications/passphrase/controller/PassphraseCredentialEditController.php index 9c86a7f5c9..a35bd3479e 100644 --- a/src/applications/passphrase/controller/PassphraseCredentialEditController.php +++ b/src/applications/passphrase/controller/PassphraseCredentialEditController.php @@ -244,8 +244,8 @@ final class PassphraseCredentialEditController extends PassphraseController { ->setValue($v_name) ->setError($e_name)) ->appendChild( - id(new AphrontFormTextAreaControl()) - ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) + id(new PhabricatorRemarkupControl()) + ->setUser($viewer) ->setName('description') ->setLabel(pht('Description')) ->setValue($v_desc)) diff --git a/src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php b/src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php index 2c8e53553a..8089943a96 100644 --- a/src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php +++ b/src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php @@ -17,17 +17,9 @@ final class PassphraseCredentialSecretIDTransaction $object->setSecretID($value); } - public function shouldHide() { - if (!$this->getOldValue()) { - return true; - } - - return false; - } - public function getTitle() { $old = $this->getOldValue(); - if ($old === null) { + if (!$old) { return pht( '%s attached a new secret to this credential.', $this->renderAuthor()); @@ -53,4 +45,8 @@ final class PassphraseCredentialSecretIDTransaction } } + public function getIcon() { + return 'fa-key'; + } + }