Page MenuHomePhabricator

D20278.id48417.diff
No OneTemporary

D20278.id48417.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -178,7 +178,7 @@
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'e86de308',
'rsrc/css/phui/workboards/phui-workboard.css' => '74fc9d98',
'rsrc/css/phui/workboards/phui-workcard.css' => '9e9eb0df',
- 'rsrc/css/phui/workboards/phui-workpanel.css' => 'bc16cf33',
+ 'rsrc/css/phui/workboards/phui-workpanel.css' => 'c5b408ad',
'rsrc/css/sprite-login.css' => '18b368a6',
'rsrc/css/sprite-tokens.css' => 'f1896dc5',
'rsrc/css/syntax/syntax-default.css' => '055fc231',
@@ -860,7 +860,7 @@
'phui-workboard-color-css' => 'e86de308',
'phui-workboard-view-css' => '74fc9d98',
'phui-workcard-view-css' => '9e9eb0df',
- 'phui-workpanel-view-css' => 'bc16cf33',
+ 'phui-workpanel-view-css' => 'c5b408ad',
'phuix-action-list-view' => 'c68f183f',
'phuix-action-view' => 'aaa08f3b',
'phuix-autocomplete' => '8f139ef0',
@@ -1906,9 +1906,6 @@
'javelin-uri',
'phabricator-notification',
),
- 'bc16cf33' => array(
- 'phui-workcard-view-css',
- ),
'bdce4d78' => array(
'javelin-install',
'javelin-util',
@@ -1939,6 +1936,9 @@
'phabricator-phtize',
'javelin-dom',
),
+ 'c5b408ad' => array(
+ 'phui-workcard-view-css',
+ ),
'c687e867' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -4050,6 +4050,7 @@
'PhabricatorProjectColorTransaction' => 'applications/project/xaction/PhabricatorProjectColorTransaction.php',
'PhabricatorProjectColorsConfigType' => 'applications/project/config/PhabricatorProjectColorsConfigType.php',
'PhabricatorProjectColumn' => 'applications/project/storage/PhabricatorProjectColumn.php',
+ 'PhabricatorProjectColumnAuthorOrder' => 'applications/project/order/PhabricatorProjectColumnAuthorOrder.php',
'PhabricatorProjectColumnCreatedOrder' => 'applications/project/order/PhabricatorProjectColumnCreatedOrder.php',
'PhabricatorProjectColumnDetailController' => 'applications/project/controller/PhabricatorProjectColumnDetailController.php',
'PhabricatorProjectColumnEditController' => 'applications/project/controller/PhabricatorProjectColumnEditController.php',
@@ -4066,6 +4067,7 @@
'PhabricatorProjectColumnQuery' => 'applications/project/query/PhabricatorProjectColumnQuery.php',
'PhabricatorProjectColumnSearchEngine' => 'applications/project/query/PhabricatorProjectColumnSearchEngine.php',
'PhabricatorProjectColumnStatusOrder' => 'applications/project/order/PhabricatorProjectColumnStatusOrder.php',
+ 'PhabricatorProjectColumnTitleOrder' => 'applications/project/order/PhabricatorProjectColumnTitleOrder.php',
'PhabricatorProjectColumnTransaction' => 'applications/project/storage/PhabricatorProjectColumnTransaction.php',
'PhabricatorProjectColumnTransactionEditor' => 'applications/project/editor/PhabricatorProjectColumnTransactionEditor.php',
'PhabricatorProjectColumnTransactionQuery' => 'applications/project/query/PhabricatorProjectColumnTransactionQuery.php',
@@ -10138,6 +10140,7 @@
'PhabricatorExtendedPolicyInterface',
'PhabricatorConduitResultInterface',
),
+ 'PhabricatorProjectColumnAuthorOrder' => 'PhabricatorProjectColumnOrder',
'PhabricatorProjectColumnCreatedOrder' => 'PhabricatorProjectColumnOrder',
'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController',
@@ -10157,6 +10160,7 @@
'PhabricatorProjectColumnQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorProjectColumnSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorProjectColumnStatusOrder' => 'PhabricatorProjectColumnOrder',
+ 'PhabricatorProjectColumnTitleOrder' => 'PhabricatorProjectColumnOrder',
'PhabricatorProjectColumnTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorProjectColumnTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorProjectColumnTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
diff --git a/src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php b/src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php
@@ -0,0 +1,139 @@
+<?php
+
+final class PhabricatorProjectColumnAuthorOrder
+ extends PhabricatorProjectColumnOrder {
+
+ const ORDERKEY = 'author';
+
+ public function getDisplayName() {
+ return pht('Group by Author');
+ }
+
+ protected function newMenuIconIcon() {
+ return 'fa-user-plus';
+ }
+
+ public function getHasHeaders() {
+ return true;
+ }
+
+ public function getCanReorder() {
+ return false;
+ }
+
+ public function getMenuOrder() {
+ return 3000;
+ }
+
+ protected function newHeaderKeyForObject($object) {
+ return $this->newHeaderKeyForAuthorPHID($object->getAuthorPHID());
+ }
+
+ private function newHeaderKeyForAuthorPHID($author_phid) {
+ return sprintf('author(%s)', $author_phid);
+ }
+
+ protected function newSortVectorsForObjects(array $objects) {
+ $author_phids = mpull($objects, null, 'getAuthorPHID');
+ $author_phids = array_keys($author_phids);
+ $author_phids = array_filter($author_phids);
+
+ if ($author_phids) {
+ $author_users = id(new PhabricatorPeopleQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs($author_phids)
+ ->execute();
+ $author_users = mpull($author_users, null, 'getPHID');
+ } else {
+ $author_users = array();
+ }
+
+ $vectors = array();
+ foreach ($objects as $vector_key => $object) {
+ $author_phid = $object->getAuthorPHID();
+ $author = idx($author_users, $author_phid);
+ if ($author) {
+ $vector = $this->newSortVectorForAuthor($author);
+ } else {
+ $vector = $this->newSortVectorForAuthorPHID($author_phid);
+ }
+
+ $vectors[$vector_key] = $vector;
+ }
+
+ return $vectors;
+ }
+
+ private function newSortVectorForAuthor(PhabricatorUser $user) {
+ return array(
+ 1,
+ $user->getUsername(),
+ );
+ }
+
+ private function newSortVectorForAuthorPHID($author_phid) {
+ return array(
+ 2,
+ $author_phid,
+ );
+ }
+
+ protected function newHeadersForObjects(array $objects) {
+ $author_phids = mpull($objects, null, 'getAuthorPHID');
+ $author_phids = array_keys($author_phids);
+ $author_phids = array_filter($author_phids);
+
+ if ($author_phids) {
+ $author_users = id(new PhabricatorPeopleQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs($author_phids)
+ ->needProfileImage(true)
+ ->execute();
+ $author_users = mpull($author_users, null, 'getPHID');
+ } else {
+ $author_users = array();
+ }
+
+ $headers = array();
+ foreach ($author_phids as $author_phid) {
+ $header_key = $this->newHeaderKeyForAuthorPHID($author_phid);
+
+ $author = idx($author_users, $author_phid);
+ if ($author) {
+ $sort_vector = $this->newSortVectorForAuthor($author);
+ $author_name = $author->getUsername();
+ $author_image = $author->getProfileImageURI();
+ } else {
+ $sort_vector = $this->newSortVectorForAuthorPHID($author_phid);
+ $author_name = pht('Unknown User ("%s")', $author_phid);
+ $author_image = null;
+ }
+
+ $author_icon = 'fa-user';
+ $author_color = 'bluegrey';
+
+ $icon_view = id(new PHUIIconView());
+
+ if ($author_image) {
+ $icon_view->setImage($author_image);
+ } else {
+ $icon_view->setIcon($author_icon, $author_color);
+ }
+
+ $header = $this->newHeader()
+ ->setHeaderKey($header_key)
+ ->setSortVector($sort_vector)
+ ->setName($author_name)
+ ->setIcon($icon_view)
+ ->setEditProperties(
+ array(
+ 'value' => $author_phid,
+ ));
+
+ $headers[] = $header;
+ }
+
+ return $headers;
+ }
+
+}
diff --git a/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php b/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php
--- a/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php
+++ b/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php
@@ -22,7 +22,7 @@
}
public function getMenuOrder() {
- return 3000;
+ return 5000;
}
protected function newSortVectorForObject($object) {
diff --git a/src/applications/project/order/PhabricatorProjectColumnHeader.php b/src/applications/project/order/PhabricatorProjectColumnHeader.php
--- a/src/applications/project/order/PhabricatorProjectColumnHeader.php
+++ b/src/applications/project/order/PhabricatorProjectColumnHeader.php
@@ -85,7 +85,12 @@
),
array(
$icon_view,
- $name,
+ phutil_tag(
+ 'span',
+ array(
+ 'class' => 'workboard-group-header-name',
+ ),
+ $name),
));
return $template;
diff --git a/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php b/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php
--- a/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php
+++ b/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php
@@ -108,6 +108,7 @@
$owner_users = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
->withPHIDs($owner_phids)
+ ->needProfileImage(true)
->execute();
$owner_users = mpull($owner_users, null, 'getPHID');
} else {
@@ -120,6 +121,7 @@
foreach ($owner_phids as $owner_phid) {
$header_key = $this->newHeaderKeyForOwnerPHID($owner_phid);
+ $owner_image = null;
if ($owner_phid === null) {
$owner = null;
$sort_vector = $this->newSortVectorForUnowned();
@@ -129,6 +131,7 @@
if ($owner) {
$sort_vector = $this->newSortVectorForOwner($owner);
$owner_name = $owner->getUsername();
+ $owner_image = $owner->getProfileImageURI();
} else {
$sort_vector = $this->newSortVectorForOwnerPHID($owner_phid);
$owner_name = pht('Unknown User ("%s")', $owner_phid);
@@ -138,8 +141,13 @@
$owner_icon = 'fa-user';
$owner_color = 'bluegrey';
- $icon_view = id(new PHUIIconView())
- ->setIcon($owner_icon, $owner_color);
+ $icon_view = id(new PHUIIconView());
+
+ if ($owner_image) {
+ $icon_view->setImage($owner_image);
+ } else {
+ $icon_view->setIcon($owner_icon, $owner_color);
+ }
$header = $this->newHeader()
->setHeaderKey($header_key)
diff --git a/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php b/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php
--- a/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php
+++ b/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php
@@ -26,7 +26,7 @@
}
public function getMenuOrder() {
- return 4000;
+ return 6000;
}
protected function newSortVectorForObject($object) {
diff --git a/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php b/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php
--- a/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php
+++ b/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php
@@ -22,7 +22,7 @@
}
public function getMenuOrder() {
- return 3000;
+ return 4000;
}
protected function newHeaderKeyForObject($object) {
diff --git a/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php b/src/applications/project/order/PhabricatorProjectColumnTitleOrder.php
copy from src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php
copy to src/applications/project/order/PhabricatorProjectColumnTitleOrder.php
--- a/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php
+++ b/src/applications/project/order/PhabricatorProjectColumnTitleOrder.php
@@ -1,16 +1,16 @@
<?php
-final class PhabricatorProjectColumnCreatedOrder
+final class PhabricatorProjectColumnTitleOrder
extends PhabricatorProjectColumnOrder {
- const ORDERKEY = 'created';
+ const ORDERKEY = 'title';
public function getDisplayName() {
- return pht('Sort by Created Date');
+ return pht('Sort by Title');
}
protected function newMenuIconIcon() {
- return 'fa-clock-o';
+ return 'fa-sort-alpha-asc';
}
public function getHasHeaders() {
@@ -22,13 +22,12 @@
}
public function getMenuOrder() {
- return 3000;
+ return 7000;
}
protected function newSortVectorForObject($object) {
return array(
- -1 * (int)$object->getDateCreated(),
- -1 * (int)$object->getID(),
+ $object->getTitle(),
);
}
diff --git a/webroot/rsrc/css/phui/workboards/phui-workpanel.css b/webroot/rsrc/css/phui/workboards/phui-workpanel.css
--- a/webroot/rsrc/css/phui/workboards/phui-workpanel.css
+++ b/webroot/rsrc/css/phui/workboards/phui-workpanel.css
@@ -148,13 +148,33 @@
.workboard-group-header {
background: rgba({$alphablue}, 0.10);
- padding: 4px 8px;
+ padding: 6px 8px;
margin: 0 0 8px -8px;
border-bottom: 1px solid {$lightgreyborder};
font-weight: bold;
color: {$darkgreytext};
+ position: relative;
}
.workboard-group-header .phui-icon-view {
- margin-right: 8px;
+ position: absolute;
+ display: inline-block;
+ width: 24px;
+ padding: 5px 0 0 0;
+ height: 19px;
+ background-size: 100%;
+ border-radius: 3px;
+ background-repeat: no-repeat;
+ text-align: center;
+ background-color: {$lightgreybackground};
+ border: 1px solid {$lightgreybackground};
+}
+
+.workboard-group-header .workboard-group-header-name {
+ display: block;
+ position: relative;
+ height: 24px;
+ line-height: 24px;
+ margin-left: 36px;
+ overflow: hidden;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 12:33 AM (19 h, 31 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6784152
Default Alt Text
D20278.id48417.diff (14 KB)

Event Timeline