diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 014839c14a..b80ce31d1a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -178,7 +178,7 @@ return array( '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 @@ return array( '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 @@ return array( 'javelin-uri', 'phabricator-notification', ), - 'bc16cf33' => array( - 'phui-workcard-view-css', - ), 'bdce4d78' => array( 'javelin-install', 'javelin-util', @@ -1939,6 +1936,9 @@ return array( '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 index 8f776a2948..e07a23d733 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4050,6 +4050,7 @@ phutil_register_library_map(array( '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 @@ phutil_register_library_map(array( '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 @@ phutil_register_library_map(array( 'PhabricatorExtendedPolicyInterface', 'PhabricatorConduitResultInterface', ), + 'PhabricatorProjectColumnAuthorOrder' => 'PhabricatorProjectColumnOrder', 'PhabricatorProjectColumnCreatedOrder' => 'PhabricatorProjectColumnOrder', 'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController', @@ -10157,6 +10160,7 @@ phutil_register_library_map(array( '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 index 0000000000..9d6bac2aff --- /dev/null +++ b/src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php @@ -0,0 +1,139 @@ +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 index 5652a96731..05f25a3d6a 100644 --- a/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php +++ b/src/applications/project/order/PhabricatorProjectColumnCreatedOrder.php @@ -22,7 +22,7 @@ final class PhabricatorProjectColumnCreatedOrder } 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 index 432b78279b..24d1e5c5ec 100644 --- a/src/applications/project/order/PhabricatorProjectColumnHeader.php +++ b/src/applications/project/order/PhabricatorProjectColumnHeader.php @@ -85,7 +85,12 @@ final class PhabricatorProjectColumnHeader ), 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 index 97ae0f24d4..336411bac5 100644 --- a/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php +++ b/src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php @@ -108,6 +108,7 @@ final class PhabricatorProjectColumnOwnerOrder $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 @@ final class PhabricatorProjectColumnOwnerOrder 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 @@ final class PhabricatorProjectColumnOwnerOrder 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 @@ final class PhabricatorProjectColumnOwnerOrder $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 index 3cf758cbc8..2e9be8e4bb 100644 --- a/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php +++ b/src/applications/project/order/PhabricatorProjectColumnPointsOrder.php @@ -26,7 +26,7 @@ final class PhabricatorProjectColumnPointsOrder } 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 index e9570bea05..e58d05f655 100644 --- a/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php +++ b/src/applications/project/order/PhabricatorProjectColumnStatusOrder.php @@ -22,7 +22,7 @@ final class PhabricatorProjectColumnStatusOrder } public function getMenuOrder() { - return 3000; + return 4000; } protected function newHeaderKeyForObject($object) { diff --git a/src/applications/project/order/PhabricatorProjectColumnTitleOrder.php b/src/applications/project/order/PhabricatorProjectColumnTitleOrder.php new file mode 100644 index 0000000000..a281c75437 --- /dev/null +++ b/src/applications/project/order/PhabricatorProjectColumnTitleOrder.php @@ -0,0 +1,34 @@ +getTitle(), + ); + } + +} diff --git a/webroot/rsrc/css/phui/workboards/phui-workpanel.css b/webroot/rsrc/css/phui/workboards/phui-workpanel.css index 2dac6b2233..95db8021ef 100644 --- 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; }