2011-01-16 13:51:39 -08:00
|
|
|
<?php
|
|
|
|
|
|
2012-03-09 15:46:25 -08:00
|
|
|
final class PhabricatorDirectoryMainController
|
2011-01-22 17:48:55 -08:00
|
|
|
extends PhabricatorDirectoryController {
|
2011-01-16 13:51:39 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
private $filter;
|
2013-01-17 14:02:18 -08:00
|
|
|
private $minipanels = array();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-15 17:48:14 -08:00
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
|
$this->filter = idx($data, 'filter');
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
public function processRequest() {
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
2013-01-15 15:41:22 -08:00
|
|
|
if ($this->filter == 'jump') {
|
|
|
|
|
return $this->buildJumpResponse();
|
2012-02-15 17:49:23 -08:00
|
|
|
}
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2013-01-15 15:41:22 -08:00
|
|
|
$nav = $this->buildNav();
|
|
|
|
|
|
|
|
|
|
$project_query = new PhabricatorProjectQuery();
|
|
|
|
|
$project_query->setViewer($user);
|
|
|
|
|
$project_query->withMemberPHIDs(array($user->getPHID()));
|
|
|
|
|
$projects = $project_query->execute();
|
2012-02-15 17:48:14 -08:00
|
|
|
|
2013-01-15 15:41:22 -08:00
|
|
|
return $this->buildMainResponse($nav, $projects);
|
2012-02-15 17:48:14 -08:00
|
|
|
}
|
|
|
|
|
|
2012-04-03 12:10:45 -07:00
|
|
|
private function buildMainResponse($nav, array $projects) {
|
|
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
|
|
|
|
|
2012-02-17 16:08:35 -08:00
|
|
|
if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) {
|
|
|
|
|
$unbreak_panel = $this->buildUnbreakNowPanel();
|
|
|
|
|
$triage_panel = $this->buildNeedsTriagePanel($projects);
|
|
|
|
|
$tasks_panel = $this->buildTasksPanel();
|
|
|
|
|
} else {
|
|
|
|
|
$unbreak_panel = null;
|
|
|
|
|
$triage_panel = null;
|
|
|
|
|
$tasks_panel = null;
|
|
|
|
|
}
|
2012-02-27 09:48:18 -08:00
|
|
|
|
2012-02-15 17:49:23 -08:00
|
|
|
$jump_panel = $this->buildJumpPanel();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$revision_panel = $this->buildRevisionPanel();
|
2012-02-27 09:48:18 -08:00
|
|
|
$audit_panel = $this->buildAuditPanel();
|
2012-02-28 21:10:39 -08:00
|
|
|
$commit_panel = $this->buildCommitPanel();
|
2011-01-25 11:31:40 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$content = array(
|
2012-02-27 13:14:32 -08:00
|
|
|
$jump_panel,
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$unbreak_panel,
|
|
|
|
|
$triage_panel,
|
|
|
|
|
$revision_panel,
|
|
|
|
|
$tasks_panel,
|
2012-02-27 09:48:18 -08:00
|
|
|
$audit_panel,
|
2012-02-28 21:10:39 -08:00
|
|
|
$commit_panel,
|
2013-01-17 14:02:18 -08:00
|
|
|
$this->minipanels,
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$nav->appendChild($content);
|
Modernize file uploads
Summary:
Modernizes file uploads. In particular:
- Adds a mobile menu, with an "Upload File" item.
- Adds crumbs to the list view, detail view and upload view.
- Adds "Upload File" action to crumbs.
- Moves upload file to a separate page.
- Removes the combined upload file + recent files page.
- Makes upload file use a normal file control by default (works on mobile).
- Home page, file list and file upload page are now global drop targets which accept files dropped anywhere on them. Dragging a file into the window shows a mask and an instructional message.
- User education on this is a little weak but I think that's a big can of worms?
- Fixes a bug where dropping multiple files into a Remarkup text area produced bad results (resolves T2190).
T879 is related, although it's specifically about Maniphest. I've declined to make global drop targets yet there because there are multiple drop targets on the page with different meanings. That UI needs updating in general.
@chad, do we have an "upload" icon (counterpart to "download")?
Test Plan: Uploaded files in Maniphest, Differential, Files, and from Home. Dragged and dropped multiple files into Differential. Used crumbs, mobile.
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T2190
Differential Revision: https://secure.phabricator.com/D4200
2012-12-16 16:34:01 -08:00
|
|
|
$nav->appendChild(new PhabricatorGlobalUploadTargetView());
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $this->buildStandardPageResponse(
|
|
|
|
|
$nav,
|
|
|
|
|
array(
|
2012-02-15 17:48:14 -08:00
|
|
|
'title' => 'Phabricator',
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-15 15:41:22 -08:00
|
|
|
private function buildJumpResponse() {
|
2012-02-15 17:49:23 -08:00
|
|
|
$request = $this->getRequest();
|
|
|
|
|
|
2012-07-23 17:41:46 -07:00
|
|
|
$jump = $request->getStr('jump');
|
|
|
|
|
|
|
|
|
|
$response = PhabricatorJumpNavHandler::jumpPostResponse($jump);
|
|
|
|
|
if ($response) {
|
|
|
|
|
return $response;
|
|
|
|
|
} else if ($request->isFormPost()) {
|
|
|
|
|
$query = new PhabricatorSearchQuery();
|
|
|
|
|
$query->setQuery($jump);
|
|
|
|
|
$query->save();
|
|
|
|
|
|
|
|
|
|
return id(new AphrontRedirectResponse())
|
|
|
|
|
->setURI('/search/'.$query->getQueryKey().'/');
|
2013-01-15 15:41:22 -08:00
|
|
|
} else {
|
|
|
|
|
return id(new AphrontRedirectResponse())->setURI('/');
|
2012-02-15 17:49:23 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
private function buildUnbreakNowPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
|
|
|
|
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW);
|
|
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No "Unbreak Now!" Tasks',
|
|
|
|
|
'Nothing appears to be critically broken right now.');
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Unbreak Now!');
|
|
|
|
|
$panel->setCaption('Open tasks with "Unbreak Now!" priority.');
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/maniphest/view/all/',
|
|
|
|
|
'class' => 'grey button',
|
|
|
|
|
),
|
|
|
|
|
"View All Unbreak Now \xC2\xBB"));
|
|
|
|
|
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->setNoBackground();
|
2012-02-27 13:14:32 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildNeedsTriagePanel(array $projects) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
2012-02-15 13:06:10 -08:00
|
|
|
if ($projects) {
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
|
|
|
|
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
2012-10-04 15:30:51 -07:00
|
|
|
$task_query->withAnyProjects(mpull($projects, 'getPHID'));
|
2012-02-15 13:06:10 -08:00
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
} else {
|
|
|
|
|
$tasks = array();
|
|
|
|
|
}
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No "Needs Triage" Tasks',
|
2012-02-14 16:23:53 -08:00
|
|
|
'No tasks in <a href="/project/">projects you are a member of</a> '.
|
2012-04-06 14:09:24 -07:00
|
|
|
'need triage.');
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
}
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Needs Triage');
|
|
|
|
|
$panel->setCaption(
|
|
|
|
|
'Open tasks with "Needs Triage" priority in '.
|
|
|
|
|
'<a href="/project/">projects you are a member of</a>.');
|
|
|
|
|
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
// TODO: This should filter to just your projects' need-triage
|
|
|
|
|
// tasks?
|
2012-03-14 18:01:14 -07:00
|
|
|
'href' => '/maniphest/view/projecttriage/',
|
2012-02-27 13:14:32 -08:00
|
|
|
'class' => 'grey button',
|
|
|
|
|
),
|
|
|
|
|
"View All Triage \xC2\xBB"));
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->setNoBackground();
|
2012-02-27 13:14:32 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildRevisionPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$revision_query = new DifferentialRevisionQuery();
|
|
|
|
|
$revision_query->withStatus(DifferentialRevisionQuery::STATUS_OPEN);
|
|
|
|
|
$revision_query->withResponsibleUsers(array($user_phid));
|
|
|
|
|
$revision_query->needRelationships(true);
|
|
|
|
|
|
|
|
|
|
// NOTE: We need to unlimit this query to hit the responsible user
|
|
|
|
|
// fast-path.
|
|
|
|
|
$revision_query->setLimit(null);
|
|
|
|
|
$revisions = $revision_query->execute();
|
|
|
|
|
|
|
|
|
|
list($active, $waiting) = DifferentialRevisionQuery::splitResponsible(
|
|
|
|
|
$revisions,
|
2013-01-11 12:18:34 -08:00
|
|
|
array($user_phid));
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$active) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No Waiting Revisions',
|
|
|
|
|
'No revisions are waiting on you.');
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Revisions Waiting on You');
|
|
|
|
|
$panel->setCaption('Revisions waiting for you for review or commit.');
|
2011-01-16 13:51:39 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/differential/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Revisions \xC2\xBB"));
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$revision_view = id(new DifferentialRevisionListView())
|
2012-08-20 14:05:46 -07:00
|
|
|
->setHighlightAge(true)
|
2012-02-27 13:14:32 -08:00
|
|
|
->setRevisions($active)
|
|
|
|
|
->setFields(DifferentialRevisionListView::getDefaultFields())
|
2012-08-17 12:46:26 -07:00
|
|
|
->setUser($user)
|
|
|
|
|
->loadAssets();
|
2012-02-27 13:14:32 -08:00
|
|
|
$phids = array_merge(
|
|
|
|
|
array($user_phid),
|
|
|
|
|
$revision_view->getRequiredHandlePHIDs());
|
2012-09-04 19:02:56 -07:00
|
|
|
$handles = $this->loadViewerHandles($phids);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$revision_view->setHandles($handles);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel->appendChild($revision_view);
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->setNoBackground();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildTasksPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
2012-02-15 13:57:50 -08:00
|
|
|
$task_query->setGroupBy(ManiphestTaskQuery::GROUP_PRIORITY);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$task_query->withOwners(array($user_phid));
|
|
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No Assigned Tasks',
|
|
|
|
|
'You have no assigned tasks.');
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Assigned Tasks');
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/maniphest/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Tasks \xC2\xBB"));
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->setNoBackground();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildTaskListView(array $tasks) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($tasks, 'ManiphestTask');
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
2012-04-02 10:27:31 -07:00
|
|
|
$phids = array_merge(
|
|
|
|
|
array_filter(mpull($tasks, 'getOwnerPHID')),
|
|
|
|
|
array_mergev(mpull($tasks, 'getProjectPHIDs')));
|
|
|
|
|
|
2012-09-04 19:02:56 -07:00
|
|
|
$handles = $this->loadViewerHandles($phids);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
$view = new ManiphestTaskListView();
|
|
|
|
|
$view->setTasks($tasks);
|
|
|
|
|
$view->setUser($user);
|
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
return $view;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-23 17:41:46 -07:00
|
|
|
private function buildJumpPanel($query=null) {
|
2012-02-15 17:49:23 -08:00
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$uniq_id = celerity_generate_unique_node_id();
|
|
|
|
|
|
|
|
|
|
Javelin::initBehavior(
|
|
|
|
|
'phabricator-autofocus',
|
|
|
|
|
array(
|
|
|
|
|
'id' => $uniq_id,
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
require_celerity_resource('phabricator-jump-nav');
|
|
|
|
|
|
2012-02-15 17:52:47 -08:00
|
|
|
$doc_href = PhabricatorEnv::getDocLink('article/Jump_Nav_User_Guide.html');
|
2012-02-15 17:49:23 -08:00
|
|
|
$doc_link = phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => $doc_href,
|
|
|
|
|
),
|
2012-02-21 15:10:11 -08:00
|
|
|
'Jump Nav User Guide');
|
2012-02-15 17:49:23 -08:00
|
|
|
|
|
|
|
|
$jump_input = phutil_render_tag(
|
|
|
|
|
'input',
|
|
|
|
|
array(
|
|
|
|
|
'type' => 'text',
|
|
|
|
|
'class' => 'phabricator-jump-nav',
|
|
|
|
|
'name' => 'jump',
|
|
|
|
|
'id' => $uniq_id,
|
2012-07-23 17:41:46 -07:00
|
|
|
'value' => $query,
|
2012-02-27 13:14:32 -08:00
|
|
|
));
|
|
|
|
|
$jump_caption = phutil_render_tag(
|
|
|
|
|
'p',
|
|
|
|
|
array(
|
|
|
|
|
'class' => 'phabricator-jump-nav-caption',
|
|
|
|
|
),
|
|
|
|
|
'Enter the name of an object like <tt>D123</tt> to quickly jump to '.
|
|
|
|
|
'it. See '.$doc_link.' or type <tt>help</tt>.');
|
2012-02-15 17:49:23 -08:00
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->setHeader('Jump Nav');
|
2012-02-15 17:49:23 -08:00
|
|
|
$panel->appendChild(
|
|
|
|
|
phabricator_render_form(
|
|
|
|
|
$user,
|
|
|
|
|
array(
|
|
|
|
|
'action' => '/jump/',
|
|
|
|
|
'method' => 'POST',
|
2012-02-27 13:14:32 -08:00
|
|
|
'class' => 'phabricator-jump-nav-form',
|
2012-02-15 17:49:23 -08:00
|
|
|
),
|
2012-02-27 13:14:32 -08:00
|
|
|
$jump_input.
|
|
|
|
|
$jump_caption));
|
|
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function renderMiniPanel($title, $body) {
|
|
|
|
|
$panel = new AphrontMiniPanelView();
|
|
|
|
|
$panel->appendChild(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'p',
|
|
|
|
|
array(
|
|
|
|
|
),
|
|
|
|
|
'<strong>'.$title.':</strong> '.$body));
|
2013-01-17 14:02:18 -08:00
|
|
|
$this->minipanels[] = $panel;
|
2012-02-15 17:49:23 -08:00
|
|
|
}
|
|
|
|
|
|
2012-02-27 09:48:18 -08:00
|
|
|
public function buildAuditPanel() {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user);
|
|
|
|
|
|
|
|
|
|
$query = new PhabricatorAuditQuery();
|
|
|
|
|
$query->withAuditorPHIDs($phids);
|
|
|
|
|
$query->withStatus(PhabricatorAuditQuery::STATUS_OPEN);
|
2012-03-26 09:44:06 -07:00
|
|
|
$query->withAwaitingUser($user);
|
2012-03-13 11:18:01 -07:00
|
|
|
$query->needCommitData(true);
|
2012-02-27 09:48:18 -08:00
|
|
|
$query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$audits = $query->execute();
|
2012-03-13 11:18:01 -07:00
|
|
|
$commits = $query->getCommits();
|
2012-02-27 09:48:18 -08:00
|
|
|
|
|
|
|
|
if (!$audits) {
|
2012-02-28 21:10:39 -08:00
|
|
|
return $this->renderMinipanel(
|
|
|
|
|
'No Audits',
|
|
|
|
|
'No commits are waiting for you to audit them.');
|
2012-02-27 09:48:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$view = new PhabricatorAuditListView();
|
|
|
|
|
$view->setAudits($audits);
|
2012-03-13 11:18:01 -07:00
|
|
|
$view->setCommits($commits);
|
2012-07-23 16:11:35 -07:00
|
|
|
$view->setUser($user);
|
2012-02-27 09:48:18 -08:00
|
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
2012-09-04 19:02:56 -07:00
|
|
|
$handles = $this->loadViewerHandles($phids);
|
2012-02-27 09:48:18 -08:00
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Audits');
|
|
|
|
|
$panel->setCaption('Commits awaiting your audit.');
|
|
|
|
|
$panel->appendChild($view);
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/audit/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Audits \xC2\xBB"));
|
|
|
|
|
$panel->setNoBackground();
|
2012-02-27 09:48:18 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-28 21:10:39 -08:00
|
|
|
public function buildCommitPanel() {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$phids = array($user->getPHID());
|
|
|
|
|
|
|
|
|
|
$query = new PhabricatorAuditCommitQuery();
|
|
|
|
|
$query->withAuthorPHIDs($phids);
|
|
|
|
|
$query->withStatus(PhabricatorAuditQuery::STATUS_OPEN);
|
|
|
|
|
$query->needCommitData(true);
|
|
|
|
|
$query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$commits = $query->execute();
|
|
|
|
|
|
|
|
|
|
if (!$commits) {
|
|
|
|
|
return $this->renderMinipanel(
|
|
|
|
|
'No Problem Commits',
|
|
|
|
|
'No one has raised concerns with your commits.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$view = new PhabricatorAuditCommitListView();
|
|
|
|
|
$view->setCommits($commits);
|
|
|
|
|
$view->setUser($user);
|
|
|
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
2012-09-04 19:02:56 -07:00
|
|
|
$handles = $this->loadViewerHandles($phids);
|
2012-02-28 21:10:39 -08:00
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Problem Commits');
|
|
|
|
|
$panel->setCaption('Commits which auditors have raised concerns about.');
|
|
|
|
|
$panel->appendChild($view);
|
2013-01-17 14:02:18 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/audit/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Problem Commits \xC2\xBB"));
|
|
|
|
|
$panel->setNoBackground();
|
2012-02-28 21:10:39 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|