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

Files: Do not show "Available Transforms" when none are supported

Summary:
Showing "Available Transforms" for files which cannot have transforms is useless and slightly misleading until you spot the "Supported" table column.
Instead just do not list transforms which are not supported for this file type.

Closes T16260

Test Plan:
* Upload an iamge file, a movie file, a text file.
* Go to their corresponding file page and select "View Transforms".
* Look at the "Available Transforms" table before and after applying this patch.

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16260

Differential Revision: https://we.phorge.it/D26336

+14 -19
+14 -19
src/applications/files/controller/PhabricatorFileTransformListController.php
··· 57 57 $dst_phid = idx($xsrc, $xform->getTransformKey()); 58 58 59 59 if ($xform->canApplyTransform($file)) { 60 - $can_apply = pht('Yes'); 61 60 62 61 $view_href = $file->getURIForTransform($xform); 63 62 $view_href = new PhutilURI($view_href); ··· 72 71 'href' => $view_href, 73 72 ), 74 73 $view_text); 75 - } else { 76 - $can_apply = phutil_tag('em', array(), pht('No')); 77 - $view_link = phutil_tag('em', array(), pht('None')); 78 - } 79 74 80 - if ($dst_phid) { 81 - $dst_link = $viewer->renderHandle($dst_phid); 82 - } else { 83 - $dst_link = phutil_tag('em', array(), pht('None')); 75 + if ($dst_phid) { 76 + $dst_link = $viewer->renderHandle($dst_phid); 77 + } else { 78 + $dst_link = phutil_tag('em', array(), pht('None')); 79 + } 80 + 81 + $src_rows[] = array( 82 + $xform->getTransformName(), 83 + $xform->getTransformKey(), 84 + $dst_link, 85 + $view_link, 86 + ); 84 87 } 85 - 86 - $src_rows[] = array( 87 - $xform->getTransformName(), 88 - $xform->getTransformKey(), 89 - $can_apply, 90 - $dst_link, 91 - $view_link, 92 - ); 93 88 } 94 89 95 90 $src_table = id(new AphrontTableView($src_rows)) 91 + ->setNoDataString( 92 + pht('No supported transforms are available for this file format.')) 96 93 ->setHeaders( 97 94 array( 98 95 pht('Name'), 99 96 pht('Key'), 100 - pht('Supported'), 101 97 pht('Transform'), 102 98 pht('View'), 103 99 )) 104 100 ->setColumnClasses( 105 101 array( 106 102 'wide', 107 - '', 108 103 '', 109 104 '', 110 105 'action',