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

Restrict Audit buckets to just ApplicationSearch views

Summary: Fixes T9363. This drops empty buckets from dashboard panel context. Still see full results in Audit.

Test Plan: Create an "Active Audits" panel, add to Dashboard. See no commits found. Check Audit, see all buckets.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9363

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

+14 -5
+14 -5
src/applications/audit/query/PhabricatorCommitSearchEngine.php
··· 178 178 $groups = $bucket->newResultGroups($query, $commits); 179 179 180 180 foreach ($groups as $group) { 181 - $views[] = id(clone $template) 182 - ->setHeader($group->getName()) 183 - ->setNoDataString($group->getNoDataString()) 184 - ->setCommits($group->getObjects()); 181 + // Don't show groups in Dashboard Panels 182 + if ($group->getObjects() || !$this->isPanelContext()) { 183 + $views[] = id(clone $template) 184 + ->setHeader($group->getName()) 185 + ->setNoDataString($group->getNoDataString()) 186 + ->setCommits($group->getObjects()); 187 + } 185 188 } 186 189 } catch (Exception $ex) { 187 190 $this->addError($ex->getMessage()); ··· 189 192 } else { 190 193 $views[] = id(clone $template) 191 194 ->setCommits($commits) 192 - ->setNoDataString(pht('No matching commits.')); 195 + ->setNoDataString(pht('No commits found.')); 196 + } 197 + 198 + if (!$views) { 199 + $views[] = id(new PhabricatorAuditListView()) 200 + ->setViewer($viewer) 201 + ->setNoDataString(pht('No commits found.')); 193 202 } 194 203 195 204 if (count($views) == 1) {