1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Add information dialogs to adding project members if unsupported

Summary: If you try to join or add members to a parent project, we currently return 404. This instead adds an informational dialog. Fixes T11055

Test Plan: Click on Join Project and Add Members while on a Parent Project or Milestone.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11055

Differential Revision: https://secure.phabricator.com/D16000
This commit is contained in:
Chad Little 2016-06-01 12:33:26 -07:00
parent 4458fb6f8f
commit 7126025fe6
2 changed files with 18 additions and 7 deletions

View file

@ -21,12 +21,17 @@ final class PhabricatorProjectMembersAddController
}
$this->setProject($project);
$done_uri = "/project/members/{$id}/";
if (!$project->supportsEditMembers()) {
return new Aphront404Response();
}
$copy = pht('Parent projects and milestones do not support adding '.
'members. You can add members directly to any non-parent subproject.');
$done_uri = "/project/members/{$id}/";
return $this->newDialog()
->setTitle(pht('Unsupported Project'))
->appendParagraph($copy)
->addCancelButton($done_uri);
}
if ($request->isFormPost()) {
$member_phids = $request->getArr('memberPHIDs');

View file

@ -32,12 +32,18 @@ final class PhabricatorProjectUpdateController
return new Aphront404Response();
}
if (!$project->supportsEditMembers()) {
return new Aphront404Response();
}
$done_uri = "/project/members/{$id}/";
if (!$project->supportsEditMembers()) {
$copy = pht('Parent projects and milestones do not support adding '.
'members. You can add members directly to any non-parent subproject.');
return $this->newDialog()
->setTitle(pht('Unsupported Project'))
->appendParagraph($copy)
->addCancelButton($done_uri);
}
if ($request->isFormPost()) {
$edge_action = null;
switch ($action) {