@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.

Render deleted files in Phragment as disabled

Summary: This updates Phragment so that fragments that are currently considered deleted have a disabled status and have an additional attribute 'Deleted'. It also places this effect on versions (in the history controller) that actually involve deleting the file.

Test Plan: Viewed deleted fragments and versions.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4205

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

+22 -3
+4
src/applications/phragment/controller/PhragmentBrowseController.php
··· 66 66 $item->addAttribute(pht( 67 67 'Latest Version %s', 68 68 $fragment->getLatestVersion()->getSequence())); 69 + if ($fragment->isDeleted()) { 70 + $item->setDisabled(true); 71 + $item->addAttribute(pht('Deleted')); 72 + } 69 73 } else { 70 74 $item->addAttribute('Directory'); 71 75 }
+9 -3
src/applications/phragment/controller/PhragmentController.php
··· 134 134 ->setActionList($actions); 135 135 136 136 if (!$fragment->isDirectory()) { 137 - $properties->addProperty( 138 - pht('Type'), 139 - pht('File')); 137 + if ($fragment->isDeleted()) { 138 + $properties->addProperty( 139 + pht('Type'), 140 + pht('File (Deleted)')); 141 + } else { 142 + $properties->addProperty( 143 + pht('Type'), 144 + pht('File')); 145 + } 140 146 $properties->addProperty( 141 147 pht('Latest Version'), 142 148 $this->renderHandlesForPHIDs(array($fragment->getLatestVersionPHID())));
+5
src/applications/phragment/controller/PhragmentHistoryController.php
··· 52 52 $version->getDateCreated(), 53 53 $viewer)); 54 54 55 + if ($version->getFilePHID() === null) { 56 + $item->setDisabled(true); 57 + $item->addAttribute('Deletion'); 58 + } 59 + 55 60 $disabled = !isset($files[$version->getFilePHID()]); 56 61 $action = id(new PHUIListItemView()) 57 62 ->setIcon('download')
+4
src/applications/phragment/storage/PhragmentFragment.php
··· 42 42 return $this->latestVersionPHID === null; 43 43 } 44 44 45 + public function isDeleted() { 46 + return $this->getLatestVersion()->getFilePHID() === null; 47 + } 48 + 45 49 public function getLatestVersion() { 46 50 if ($this->latestVersionPHID === null) { 47 51 return null;