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

Delete Repository button: disable if not admin, but show popup to all

Summary:
The "Delete Repository" button should be disabled, just like any other admin button in the page,
if you cannot edit the repository, so to do not cause anxiety situations to users without
editing permissions.

Moreover, probably, if you still want to click that disabled button,
you should still be allowed to see the super-nice related information message,
just because it's super-lovely, super-informative and it does nothing wrong.

Closes T15964

Test Plan:
Be normal user. See the button finally disabled. Click it, you finally see its related info popup instead "You shall not pass",
so you unlock extra documentation to read.

Be admin user. See the button still enabled. Click it, you still can see the info popup.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15964

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

+6 -2
+4 -1
src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
··· 4 4 extends DiffusionRepositoryManageController { 5 5 6 6 public function handleRequest(AphrontRequest $request) { 7 - $response = $this->loadDiffusionContextForEdit(); 7 + // This is just an information box, telling admins to use CLI for destroy. 8 + // To increase shared knowledge about how Phorge works, we can safely show 9 + // it to those who see the repository, not just those who can edit it. 10 + $response = $this->loadDiffusionContext(); 8 11 if ($response) { 9 12 return $response; 10 13 }
+2 -1
src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
··· 154 154 ->setName(pht('Delete Repository')) 155 155 ->setHref($delete_uri) 156 156 ->setIcon('fa-times') 157 - ->setWorkflow(true)); 157 + ->setWorkflow(true) 158 + ->setDisabled(!$can_edit)); 158 159 159 160 return $this->newCurtainView() 160 161 ->setActionList($action_list);