Skip to content

Commit 3bc54c2

Browse files
committed
Project revamp part 2: Edit
Summary: Taking a pass at revamping the edit pages in Projects. Specifically: - Remove EditMainController - Move actions from EditMain to Profile - Move properties from EditMain to Profile - Move timeline from EditMain to Profile - Move Open Tasks from Profile to sidenavicon - Add custom icons and colors to timeline Feel free to bang on this a bit and give feedback, feels generally correct to me. Test Plan: Edit everything I could on various projects. Check links, timelines, actions. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11421
1 parent 9a7ad97 commit 3bc54c2

12 files changed

+128
-266
lines changed

src/__phutil_library_map__.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,6 @@
22042204
'PhabricatorProjectDescriptionField' => 'applications/project/customfield/PhabricatorProjectDescriptionField.php',
22052205
'PhabricatorProjectEditDetailsController' => 'applications/project/controller/PhabricatorProjectEditDetailsController.php',
22062206
'PhabricatorProjectEditIconController' => 'applications/project/controller/PhabricatorProjectEditIconController.php',
2207-
'PhabricatorProjectEditMainController' => 'applications/project/controller/PhabricatorProjectEditMainController.php',
22082207
'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php',
22092208
'PhabricatorProjectEditorTestCase' => 'applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php',
22102209
'PhabricatorProjectFeedController' => 'applications/project/controller/PhabricatorProjectFeedController.php',
@@ -5444,7 +5443,6 @@
54445443
'PhabricatorProjectDescriptionField' => 'PhabricatorProjectStandardCustomField',
54455444
'PhabricatorProjectEditDetailsController' => 'PhabricatorProjectController',
54465445
'PhabricatorProjectEditIconController' => 'PhabricatorProjectController',
5447-
'PhabricatorProjectEditMainController' => 'PhabricatorProjectController',
54485446
'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController',
54495447
'PhabricatorProjectEditorTestCase' => 'PhabricatorTestCase',
54505448
'PhabricatorProjectFeedController' => 'PhabricatorProjectController',

src/applications/files/controller/PhabricatorFileComposeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function processRequest() {
7272
));
7373

7474
if ($project_phid) {
75-
$edit_uri = '/project/edit/'.$project->getID().'/';
75+
$edit_uri = '/project/profile/'.$project->getID().'/';
7676

7777
$xactions = array();
7878
$xactions[] = id(new PhabricatorProjectTransaction())

src/applications/project/application/PhabricatorProjectApplication.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function getRoutes() {
4343
'/project/' => array(
4444
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorProjectListController',
4545
'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController',
46-
'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectEditMainController',
4746
'details/(?P<id>[1-9]\d*)/'
4847
=> 'PhabricatorProjectEditDetailsController',
4948
'archive/(?P<id>[1-9]\d*)/'

src/applications/project/controller/PhabricatorProjectArchiveController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function processRequest() {
2626
return new Aphront404Response();
2727
}
2828

29-
$edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
29+
$edit_uri = $this->getApplicationURI('profile/'.$project->getID().'/');
3030

3131
if ($request->isFormPost()) {
3232
if ($project->isArchived()) {

src/applications/project/controller/PhabricatorProjectController.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ public function buildApplicationMenu() {
77
}
88

99
public function buildSideNavView($for_app = false) {
10-
$user = $this->getRequest()->getUser();
10+
$viewer = $this->getViewer();
1111

1212
$nav = new AphrontSideNavFilterView();
1313
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
1414

1515
$id = null;
1616
if ($for_app) {
17-
$user = $this->getRequest()->getUser();
1817
$id = $this->getRequest()->getURIData('id');
1918
if ($id) {
2019
$nav->addFilter("profile/{$id}/", pht('Profile'));
2120
$nav->addFilter("board/{$id}/", pht('Workboard'));
2221
$nav->addFilter("members/{$id}/", pht('Members'));
2322
$nav->addFilter("feed/{$id}/", pht('Feed'));
24-
$nav->addFilter("edit/{$id}/", pht('Edit'));
23+
$nav->addFilter("details/{$id}/", pht('Edit Details'));
2524
}
2625
$nav->addFilter('create', pht('Create Project'));
2726
}
2827

2928
if (!$id) {
3029
id(new PhabricatorProjectSearchEngine())
31-
->setViewer($user)
30+
->setViewer($viewer)
3231
->addNavigationItems($nav->getMenu());
3332
}
3433

@@ -38,13 +37,13 @@ public function buildSideNavView($for_app = false) {
3837
}
3938

4039
public function buildIconNavView(PhabricatorProject $project) {
41-
$user = $this->getRequest()->getUser();
40+
$viewer = $this->getViewer();
4241
$id = $project->getID();
4342
$picture = $project->getProfileImageURI();
4443
$name = $project->getName();
4544

4645
$columns = id(new PhabricatorProjectColumnQuery())
47-
->setViewer($user)
46+
->setViewer($viewer)
4847
->withProjectPHIDs(array($project->getPHID()))
4948
->execute();
5049
if ($columns) {
@@ -58,9 +57,20 @@ public function buildIconNavView(PhabricatorProject $project) {
5857
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
5958
$nav->addIcon("profile/{$id}/", $name, null, $picture);
6059
$nav->addIcon("board/{$id}/", pht('Workboard'), $board_icon);
60+
61+
$class = 'PhabricatorManiphestApplication';
62+
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
63+
$phid = $project->getPHID();
64+
$query_uri = urisprintf(
65+
'/maniphest/?statuses=%s&allProjects=%s#R',
66+
implode(',', ManiphestTaskStatus::getOpenStatusConstants()),
67+
$phid);
68+
$nav->addIcon(null, pht('Open Tasks'), 'fa-anchor', null, $query_uri);
69+
}
70+
6171
$nav->addIcon("feed/{$id}/", pht('Feed'), 'fa-newspaper-o');
6272
$nav->addIcon("members/{$id}/", pht('Members'), 'fa-group');
63-
$nav->addIcon("edit/{$id}/", pht('Edit'), 'fa-pencil');
73+
$nav->addIcon("details/{$id}/", pht('Edit Details'), 'fa-pencil');
6474

6575
return $nav;
6676
}

src/applications/project/controller/PhabricatorProjectEditDetailsController.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,8 @@ public function processRequest() {
149149
));
150150
}
151151

152-
if ($is_new) {
153-
$redirect_uri =
154-
$this->getApplicationURI('profile/'.$project->getID().'/');
155-
} else {
156-
$redirect_uri =
157-
$this->getApplicationURI('edit/'.$project->getID().'/');
158-
}
152+
$redirect_uri =
153+
$this->getApplicationURI('profile/'.$project->getID().'/');
159154

160155
return id(new AphrontRedirectResponse())->setURI($redirect_uri);
161156
} catch (PhabricatorApplicationTransactionValidationException $ex) {
@@ -304,7 +299,7 @@ public function processRequest() {
304299

305300
if (!$is_new) {
306301
$nav = $this->buildIconNavView($project);
307-
$nav->selectFilter("edit/{$id}/");
302+
$nav->selectFilter("details/{$id}/");
308303
$nav->appendChild($form_box);
309304
} else {
310305
$nav = array($form_box);

src/applications/project/controller/PhabricatorProjectEditIconController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function processRequest() {
2626
if (!$project) {
2727
return new Aphront404Response();
2828
}
29-
$cancel_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
29+
$cancel_uri = $this->getApplicationURI('profile/'.$project->getID().'/');
3030
$project_icon = $project->getIcon();
3131
} else {
3232
$this->requireApplicationCapability(

src/applications/project/controller/PhabricatorProjectEditMainController.php

Lines changed: 0 additions & 160 deletions
This file was deleted.

src/applications/project/controller/PhabricatorProjectEditPictureController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function processRequest() {
2828
return new Aphront404Response();
2929
}
3030

31-
$edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
31+
$edit_uri = $this->getApplicationURI('profile/'.$project->getID().'/');
3232
$view_uri = $this->getApplicationURI('profile/'.$project->getID().'/');
3333

3434
$supported_formats = PhabricatorFile::getTransformableImageFormats();

0 commit comments

Comments
 (0)