@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix text for Passphrase credential destruction transaction when restoring credentials

Summary:
Fixes T10211. This transaction can either be setting or removing the "destroyed" flag, but we show "destroyed" in both cases.

Instead, if the transaction is clearing the flag, render "restored".

Test Plan: {F1068142}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10211

Differential Revision: https://secure.phabricator.com/D15096

+17 -4
+17 -4
src/applications/passphrase/storage/PassphraseCredentialTransaction.php
··· 26 26 27 27 public function shouldHide() { 28 28 $old = $this->getOldValue(); 29 + $new = $this->getNewValue(); 29 30 switch ($this->getTransactionType()) { 30 31 case self::TYPE_DESCRIPTION: 31 32 return ($old === null); ··· 35 36 return !strlen($old); 36 37 case self::TYPE_LOOKEDATSECRET: 37 38 return false; 39 + case self::TYPE_DESTROY: 40 + // Don't show "undestroy" transactions because they're a bit confusing 41 + // and redundant with restoring a secret. 42 + if (!$new) { 43 + return true; 44 + } 38 45 } 39 46 return parent::shouldHide(); 40 47 } ··· 77 84 } 78 85 break; 79 86 case self::TYPE_SECRET_ID: 80 - return pht( 81 - '%s updated the secret for this credential.', 82 - $this->renderHandleLink($author_phid)); 87 + if ($old === null) { 88 + return pht( 89 + '%s attached a new secret to this credential.', 90 + $this->renderHandleLink($author_phid)); 91 + } else { 92 + return pht( 93 + '%s updated the secret for this credential.', 94 + $this->renderHandleLink($author_phid)); 95 + } 83 96 case self::TYPE_DESTROY: 84 97 return pht( 85 - '%s destroyed this credential.', 98 + '%s destroyed the secret for this credential.', 86 99 $this->renderHandleLink($author_phid)); 87 100 case self::TYPE_LOOKEDATSECRET: 88 101 return pht(