2011-10-02 11:42:41 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Render a table of Differential revisions.
|
|
|
|
*/
|
|
|
|
final class DifferentialRevisionListView extends AphrontView {
|
|
|
|
|
|
|
|
private $revisions;
|
2012-08-17 12:46:26 -07:00
|
|
|
private $flags = array();
|
2012-08-16 23:35:50 -07:00
|
|
|
private $drafts = array();
|
2011-10-02 11:42:41 -07:00
|
|
|
private $handles;
|
2012-02-20 05:38:21 -08:00
|
|
|
private $fields;
|
2012-08-20 14:05:46 -07:00
|
|
|
private $highlightAge;
|
2012-02-20 05:38:21 -08:00
|
|
|
|
|
|
|
public function setFields(array $fields) {
|
2012-04-04 13:13:08 -07:00
|
|
|
assert_instances_of($fields, 'DifferentialFieldSpecification');
|
2012-02-20 05:38:21 -08:00
|
|
|
$this->fields = $fields;
|
|
|
|
return $this;
|
|
|
|
}
|
2011-10-02 11:42:41 -07:00
|
|
|
|
|
|
|
public function setRevisions(array $revisions) {
|
2012-04-04 13:13:08 -07:00
|
|
|
assert_instances_of($revisions, 'DifferentialRevision');
|
2011-10-02 11:42:41 -07:00
|
|
|
$this->revisions = $revisions;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-08-20 14:05:46 -07:00
|
|
|
public function setHighlightAge($bool) {
|
|
|
|
$this->highlightAge = $bool;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2011-10-02 11:42:41 -07:00
|
|
|
public function getRequiredHandlePHIDs() {
|
|
|
|
$phids = array();
|
2012-02-20 05:38:21 -08:00
|
|
|
foreach ($this->fields as $field) {
|
|
|
|
foreach ($this->revisions as $revision) {
|
|
|
|
$phids[] = $field->getRequiredHandlePHIDsForRevisionList($revision);
|
2011-10-02 11:42:41 -07:00
|
|
|
}
|
|
|
|
}
|
2012-02-20 05:38:21 -08:00
|
|
|
return array_mergev($phids);
|
2011-10-02 11:42:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setHandles(array $handles) {
|
2012-04-04 13:13:08 -07:00
|
|
|
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
2011-10-02 11:42:41 -07:00
|
|
|
$this->handles = $handles;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-08-17 12:46:26 -07:00
|
|
|
public function loadAssets() {
|
|
|
|
$user = $this->user;
|
|
|
|
if (!$user) {
|
|
|
|
throw new Exception("Call setUser() before loadAssets()!");
|
|
|
|
}
|
|
|
|
if ($this->revisions === null) {
|
|
|
|
throw new Exception("Call setRevisions() before loadAssets()!");
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->flags = id(new PhabricatorFlagQuery())
|
2013-02-28 17:15:09 -08:00
|
|
|
->setViewer($user)
|
2012-08-17 12:46:26 -07:00
|
|
|
->withOwnerPHIDs(array($user->getPHID()))
|
|
|
|
->withObjectPHIDs(mpull($this->revisions, 'getPHID'))
|
|
|
|
->execute();
|
|
|
|
|
2012-08-16 23:35:50 -07:00
|
|
|
$this->drafts = id(new DifferentialRevisionQuery())
|
2013-07-01 12:38:27 -07:00
|
|
|
->setViewer($user)
|
2012-08-16 23:35:50 -07:00
|
|
|
->withIDs(mpull($this->revisions, 'getID'))
|
|
|
|
->withDraftRepliesByAuthors(array($user->getPHID()))
|
|
|
|
->execute();
|
|
|
|
|
2012-08-17 12:46:26 -07:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2011-10-02 11:42:41 -07:00
|
|
|
public function render() {
|
|
|
|
|
|
|
|
$user = $this->user;
|
|
|
|
if (!$user) {
|
|
|
|
throw new Exception("Call setUser() before render()!");
|
|
|
|
}
|
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$fresh = PhabricatorEnv::getEnvConfig('differential.days-fresh');
|
|
|
|
if ($fresh) {
|
|
|
|
$fresh = PhabricatorCalendarHoliday::getNthBusinessDay(
|
|
|
|
time(),
|
|
|
|
-$fresh);
|
|
|
|
}
|
2012-08-21 14:20:21 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$stale = PhabricatorEnv::getEnvConfig('differential.days-stale');
|
|
|
|
if ($stale) {
|
|
|
|
$stale = PhabricatorCalendarHoliday::getNthBusinessDay(
|
|
|
|
time(),
|
|
|
|
-$stale);
|
2012-08-20 14:05:46 -07:00
|
|
|
}
|
|
|
|
|
2012-08-07 18:37:49 -07:00
|
|
|
Javelin::initBehavior('phabricator-tooltips', array());
|
|
|
|
require_celerity_resource('aphront-tooltip-css');
|
|
|
|
|
2012-08-17 12:46:26 -07:00
|
|
|
$flagged = mpull($this->flags, null, 'getObjectPHID');
|
2012-08-01 14:33:30 -07:00
|
|
|
|
2012-02-20 05:38:21 -08:00
|
|
|
foreach ($this->fields as $field) {
|
|
|
|
$field->setHandles($this->handles);
|
|
|
|
}
|
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$list = new PhabricatorObjectItemListView();
|
|
|
|
$list->setCards(true);
|
|
|
|
$list->setFlush(true);
|
|
|
|
|
2011-10-02 11:42:41 -07:00
|
|
|
foreach ($this->revisions as $revision) {
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$item = new PhabricatorObjectItemView();
|
|
|
|
$rev_fields = array();
|
|
|
|
$icons = array();
|
|
|
|
|
2012-08-01 14:33:30 -07:00
|
|
|
$phid = $revision->getPHID();
|
|
|
|
if (isset($flagged[$phid])) {
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$icons['flag'] = array(
|
|
|
|
'icon' => 'flag-'.$flagged[$phid]->getColor(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (array_key_exists($revision->getID(), $this->drafts)) {
|
|
|
|
$icons['draft'] = array(
|
|
|
|
'icon' => 'file-white',
|
|
|
|
'href' => '/D'.$revision->getID().'#comment-preview',
|
|
|
|
);
|
2012-08-01 14:33:30 -07:00
|
|
|
}
|
2012-08-20 14:05:46 -07:00
|
|
|
|
|
|
|
$modified = $revision->getDateModified();
|
|
|
|
|
2012-02-20 05:38:21 -08:00
|
|
|
foreach ($this->fields as $field) {
|
2012-08-21 14:20:21 -07:00
|
|
|
if (($fresh || $stale) &&
|
2012-08-20 14:05:46 -07:00
|
|
|
$field instanceof DifferentialDateModifiedFieldSpecification) {
|
2012-08-21 14:20:21 -07:00
|
|
|
if ($stale && $modified < $stale) {
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$days = floor((time() - $modified) / 60 / 60 / 24);
|
|
|
|
$icons['age'] = array(
|
|
|
|
'icon' => 'warning-white',
|
|
|
|
'label' => pht('Old (%d days)', $days),
|
|
|
|
);
|
2012-08-21 14:20:21 -07:00
|
|
|
} else if ($fresh && $modified < $fresh) {
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$days = floor((time() - $modified) / 60 / 60 / 24);
|
|
|
|
$icons['age'] = array(
|
|
|
|
'icon' => 'perflab-white',
|
|
|
|
'label' => pht('Stale (%d days)', $days),
|
|
|
|
);
|
2012-08-20 14:05:46 -07:00
|
|
|
} else {
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
// Fresh, noOp();
|
2012-08-20 14:05:46 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$rev_header = $field->renderHeaderForRevisionList();
|
|
|
|
$rev_fields[$rev_header] = $field
|
|
|
|
->renderValueForRevisionList($revision);
|
2011-10-02 11:42:41 -07:00
|
|
|
}
|
2012-08-20 14:05:46 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$status = $revision->getStatus();
|
|
|
|
$status_name =
|
|
|
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
|
2011-10-02 11:42:41 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$flag_icon = null;
|
|
|
|
if (isset($icons['flag'])) {
|
|
|
|
$flag_icon = $icons['flag']['icon'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$item->setObjectName('D'.$revision->getID());
|
|
|
|
$item->setHeader(phutil_tag('a',
|
|
|
|
array('href' => '/D'.$revision->getID()),
|
|
|
|
$revision->getTitle()));
|
|
|
|
$item->addAttribute($status_name);
|
|
|
|
|
|
|
|
// Author
|
|
|
|
$author_handle = $this->handles[$revision->getAuthorPHID()];
|
|
|
|
$item->addByline(pht('Author: %s', $author_handle->renderLink()));
|
|
|
|
|
|
|
|
// Reviewers
|
|
|
|
$item->addAttribute(pht('Reviewers: %s', $rev_fields['Reviewers']));
|
|
|
|
|
|
|
|
$do_not_display_age = array(
|
|
|
|
ArcanistDifferentialRevisionStatus::CLOSED => true,
|
|
|
|
ArcanistDifferentialRevisionStatus::ABANDONED => true,
|
|
|
|
);
|
|
|
|
if (isset($icons['age']) && !isset($do_not_display_age[$status])) {
|
|
|
|
$item->addFootIcon($icons['age']['icon'], $icons['age']['label']);
|
|
|
|
}
|
|
|
|
if (isset($icons['draft'])) {
|
|
|
|
$item->addFootIcon($icons['draft']['icon'], pht('Saved Draft'),
|
|
|
|
$icons['draft']['href']);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Updated on
|
|
|
|
$item->addIcon($flag_icon ? $flag_icon : 'none',
|
|
|
|
hsprintf('%s', $rev_fields['Updated']));
|
2011-10-02 11:42:41 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
// First remove the fields we already have
|
|
|
|
$count = 7;
|
|
|
|
$rev_fields = array_slice($rev_fields, $count);
|
2011-10-02 11:42:41 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
// Then add each one of them
|
|
|
|
// TODO: Add render-to-foot-icon support
|
|
|
|
foreach ($rev_fields as $header => $field) {
|
|
|
|
$item->addAttribute(pht('%s: %s', $header, $field));
|
|
|
|
}
|
2011-10-02 11:42:41 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
$list->addItem($item);
|
|
|
|
}
|
2012-08-20 14:05:46 -07:00
|
|
|
|
[Rough Sketch] Differential ObjectItemView Smexyness
Summary:
Tried out `PhabricatorObjectItemView` for Differential. It looks smexy and smooth.
Refs T2014
- Title and Date as Maniphest
- Author in the handle icon
- Bar color reflects revision status (Needs Review, Accepted, Abandoned etc.) @chad looking for non-blue is faster than keeping watch for everything that's not "Closed" in old table form
- Some status information are in footer icons; currently only stale/old status display as well as saved drafts, maybe more in future; these come into my mind:
- No reviewer warning
- Push Blocking Priority (T2730)
- Trivial, fast review guaranteed
- Sketch / Just looking for advice/help
- Arcanist Project (T2614)
- Denote "Public Send-in" (T1476)
{F37662}
{F37663}
{F37664}
{F37665}
Some flaws:
- Date and reviewers on every entry the same?
- No respect for Differential fields (for some reason, every entry appeared the same, so broke it to parts)
- Plenty of (potential) increase in height - advise reducing paging length from 100 to 50 - or just ignore me
Suggestions for the future:
- Expand the meta information regarding revisions; e.g. the various status displays above
- Uh... T2543, T1279, T793, T731 and what else I want for Differential, because they are awesome!
- T793 should be in particular easy appearance-wise, just copy-paste from Maniphest
Test Plan: By looking at it, of course. Verified there are no errors or crashed
Reviewers: epriestley, chad, btrahan, liguobig
Reviewed By: chad
CC: aran, Korvin, edward, nh
Maniphest Tasks: T2014
Differential Revision: https://secure.phabricator.com/D5451
Conflicts:
src/__celerity_resource_map__.php
2013-07-02 12:14:33 -07:00
|
|
|
return $list;
|
2011-10-02 11:42:41 -07:00
|
|
|
}
|
|
|
|
|
2013-02-28 17:15:09 -08:00
|
|
|
public static function getDefaultFields(PhabricatorUser $user) {
|
2012-02-20 05:38:21 -08:00
|
|
|
$selector = DifferentialFieldSelector::newSelector();
|
|
|
|
$fields = $selector->getFieldSpecifications();
|
|
|
|
foreach ($fields as $key => $field) {
|
2013-02-28 17:15:09 -08:00
|
|
|
$field->setUser($user);
|
2012-02-20 05:38:21 -08:00
|
|
|
if (!$field->shouldAppearOnRevisionList()) {
|
|
|
|
unset($fields[$key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$fields) {
|
|
|
|
throw new Exception(
|
|
|
|
"Phabricator configuration has no fields that appear on the list ".
|
|
|
|
"interface!");
|
|
|
|
}
|
|
|
|
|
|
|
|
return $selector->sortFieldsForRevisionList($fields);
|
|
|
|
}
|
|
|
|
|
2011-10-02 11:42:41 -07:00
|
|
|
}
|