@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

Correct Diffusion Commits nux welcome page when Audit is disabled

Summary:
We do not set the `audited` default saved query as default (first in the list) when Audit is disabled, so the NUX welcome screen is wrong.
Welcome to Diffusion Commits instead and talk about commits instead in that case.

Followup to rP821708414e.

Closes T16521

Test Plan:
* Disable Audit via http://phorge.localhost/applications/view/PhabricatorAuditApplication/
* Go to http://phorge.localhost/diffusion/commit/?nux=1

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16521

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

+18 -9
+18 -9
src/applications/audit/query/PhabricatorCommitSearchEngine.php
··· 279 279 ->setContent($views); 280 280 } 281 281 282 + /** 283 + * @return PHUIBigInfoView 284 + */ 282 285 protected function getNewUserBody() { 283 - 284 - $view = id(new PHUIBigInfoView()) 285 - ->setIcon('fa-check-circle-o') 286 - ->setTitle(pht('Welcome to Audit')) 287 - ->setDescription( 288 - pht('Post-commit code review and auditing. Audits you are assigned '. 289 - 'to will appear here.')); 290 - 291 - return $view; 286 + if (id(new PhabricatorAuditApplication())->isInstalled()) { 287 + $view = id(new PHUIBigInfoView()) 288 + ->setIcon('fa-check-circle-o') 289 + ->setTitle(pht('Welcome to Audit')) 290 + ->setDescription( 291 + pht('Post-commit code review and auditing. Audits you are assigned '. 292 + 'to will appear here.')); 293 + } else { 294 + $view = id(new PHUIBigInfoView()) 295 + ->setIcon('fa-code') 296 + ->setTitle(pht('Welcome to Diffusion')) 297 + ->setDescription( 298 + pht('Your authored repository commits will appear here.')); 299 + } 300 + return $view; 292 301 } 293 302 294 303 }