From 132bff3ea590cd4781c6f0f97f62470a971d3e9a Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 1 Jun 2015 11:28:01 -0700 Subject: [PATCH] [Redesign] People, Profile, Feed UI Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't). Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed". Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D13101 --- resources/celerity/map.php | 8 +-- src/__phutil_library_map__.php | 2 - .../feed/builder/PhabricatorFeedBuilder.php | 12 ++-- .../PhabricatorPeopleController.php | 2 - .../PhabricatorPeopleFeedController.php | 61 ------------------- .../PhabricatorPeopleProfileController.php | 57 +++++++++++------ .../PhabricatorProjectFeedController.php | 8 +-- .../css/application/profile/profile-view.css | 53 ---------------- webroot/rsrc/css/phui/phui-feed-story.css | 2 +- 9 files changed, 55 insertions(+), 150 deletions(-) delete mode 100644 src/applications/people/controller/PhabricatorPeopleFeedController.php delete mode 100644 webroot/rsrc/css/application/profile/profile-view.css diff --git a/resources/celerity/map.php b/resources/celerity/map.php index dcd6efc8db..bebabf66c8 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '1b6e6a39', + 'core.pkg.css' => '63bd9495', 'core.pkg.js' => 'fbf1d615', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => 'f89b49b6', @@ -98,7 +98,6 @@ return array( 'rsrc/css/application/ponder/feed.css' => 'e62615b6', 'rsrc/css/application/ponder/post.css' => '9d415218', 'rsrc/css/application/ponder/vote.css' => '8ed6ed8b', - 'rsrc/css/application/profile/profile-view.css' => 'cb6f56b7', 'rsrc/css/application/projects/project-icon.css' => 'c2ecb7f1', 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', @@ -130,7 +129,7 @@ return array( 'rsrc/css/phui/phui-button.css' => 'b995182d', 'rsrc/css/phui/phui-crumbs-view.css' => 'ce840ec2', 'rsrc/css/phui/phui-document.css' => '08f33f08', - 'rsrc/css/phui/phui-feed-story.css' => '06872ae9', + 'rsrc/css/phui/phui-feed-story.css' => '153a2ebf', 'rsrc/css/phui/phui-fontkit.css' => 'b664ac96', 'rsrc/css/phui/phui-form-view.css' => 'a0e8f168', 'rsrc/css/phui/phui-form.css' => 'f535f938', @@ -723,7 +722,6 @@ return array( 'phabricator-object-selector-css' => '029a133d', 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', - 'phabricator-profile-css' => 'cb6f56b7', 'phabricator-remarkup-css' => '67a4ee29', 'phabricator-search-results-css' => 'ce897fb9', 'phabricator-shaped-request' => '7cbe244b', @@ -764,7 +762,7 @@ return array( 'phui-calendar-month-css' => '476be7e0', 'phui-crumbs-view-css' => 'ce840ec2', 'phui-document-view-css' => '08f33f08', - 'phui-feed-story-css' => '06872ae9', + 'phui-feed-story-css' => '153a2ebf', 'phui-font-icon-base-css' => '3dad2ae3', 'phui-fontkit-css' => 'b664ac96', 'phui-form-css' => 'f535f938', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 653d79b889..f67b1e5e9f 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2223,7 +2223,6 @@ phutil_register_library_map(array( 'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php', 'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php', 'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php', - 'PhabricatorPeopleFeedController' => 'applications/people/controller/PhabricatorPeopleFeedController.php', 'PhabricatorPeopleHovercardEventListener' => 'applications/people/event/PhabricatorPeopleHovercardEventListener.php', 'PhabricatorPeopleInviteController' => 'applications/people/controller/PhabricatorPeopleInviteController.php', 'PhabricatorPeopleInviteListController' => 'applications/people/controller/PhabricatorPeopleInviteListController.php', @@ -5633,7 +5632,6 @@ phutil_register_library_map(array( 'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController', 'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController', 'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType', - 'PhabricatorPeopleFeedController' => 'PhabricatorPeopleController', 'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener', 'PhabricatorPeopleInviteController' => 'PhabricatorPeopleController', 'PhabricatorPeopleInviteListController' => 'PhabricatorPeopleInviteController', diff --git a/src/applications/feed/builder/PhabricatorFeedBuilder.php b/src/applications/feed/builder/PhabricatorFeedBuilder.php index 18ce66c6aa..8fbc99df9e 100644 --- a/src/applications/feed/builder/PhabricatorFeedBuilder.php +++ b/src/applications/feed/builder/PhabricatorFeedBuilder.php @@ -83,20 +83,22 @@ final class PhabricatorFeedBuilder { $null_view->appendChild($view); } + $box = id(new PHUIObjectBoxView()) + ->appendChild($null_view); + if (empty($stories)) { $nodatastring = pht('No Stories.'); if ($this->noDataString) { $nodatastring = $this->noDataString; } - $view = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_NODATA) + $view = id(new PHUIBoxView()) + ->addClass('mlt mlb msr msl') ->appendChild($nodatastring); - $null_view->appendChild($view); + $box->appendChild($view); } - return id(new PHUIObjectBoxView()) - ->appendChild($null_view); + return $box; } diff --git a/src/applications/people/controller/PhabricatorPeopleController.php b/src/applications/people/controller/PhabricatorPeopleController.php index 4366c39758..b293c0f72c 100644 --- a/src/applications/people/controller/PhabricatorPeopleController.php +++ b/src/applications/people/controller/PhabricatorPeopleController.php @@ -16,7 +16,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController { if ($name) { $nav->setBaseURI(new PhutilURI('/p/')); $nav->addFilter("{$name}/", $name); - $nav->addFilter("{$name}/feed/", pht('Feed')); $nav->addFilter("{$name}/calendar/", pht('Calendar')); } } @@ -54,7 +53,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController { $nav->setIconNav(true); $nav->setBaseURI(new PhutilURI('/p/')); $nav->addIcon("{$name}/", $name, null, $picture); - $nav->addIcon("{$name}/feed/", pht('Feed'), 'fa-newspaper-o'); $class = 'PhabricatorCalendarApplication'; if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { diff --git a/src/applications/people/controller/PhabricatorPeopleFeedController.php b/src/applications/people/controller/PhabricatorPeopleFeedController.php deleted file mode 100644 index 64a443cabe..0000000000 --- a/src/applications/people/controller/PhabricatorPeopleFeedController.php +++ /dev/null @@ -1,61 +0,0 @@ -username = idx($data, 'username'); - } - - public function processRequest() { - require_celerity_resource('phabricator-profile-css'); - $viewer = $this->getRequest()->getUser(); - $user = id(new PhabricatorPeopleQuery()) - ->setViewer($viewer) - ->withUsernames(array($this->username)) - ->needProfileImage(true) - ->executeOne(); - - if (!$user) { - return new Aphront404Response(); - } - - $query = new PhabricatorFeedQuery(); - $query->setFilterPHIDs( - array( - $user->getPHID(), - )); - $query->setLimit(100); - $query->setViewer($viewer); - $stories = $query->execute(); - - $builder = new PhabricatorFeedBuilder($stories); - $builder->setUser($viewer); - $builder->setShowHovercards(true); - $builder->setNoDataString( - pht( - 'To begin on such a grand journey, requires but just a single step.')); - $view = $builder->buildView(); - - $feed = phutil_tag_div( - 'phabricator-project-feed', - $view->render()); - $name = $user->getUsername(); - - $nav = $this->buildIconNavView($user); - $nav->selectFilter("{$name}/feed/"); - $nav->appendChild($feed); - - return $this->buildApplicationPage( - $nav, - array( - 'title' => pht('Feed'), - )); - } -} diff --git a/src/applications/people/controller/PhabricatorPeopleProfileController.php b/src/applications/people/controller/PhabricatorPeopleProfileController.php index 8404e56d91..3447525f1a 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileController.php @@ -26,8 +26,6 @@ final class PhabricatorPeopleProfileController return new Aphront404Response(); } - require_celerity_resource('phabricator-profile-css'); - $profile = $user->loadUserProfile(); $username = phutil_escape_uri($user->getUserName()); @@ -64,6 +62,17 @@ final class PhabricatorPeopleProfileController ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit)); + $class = 'PhabricatorConpherenceApplication'; + if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { + $href = '/conpherence/new/?participant='.$user->getPHID(); + $actions->addAction( + id(new PhabricatorActionView()) + ->setIcon('fa-comments') + ->setName(pht('Send Message')) + ->setWorkflow(true) + ->setHref($href)); + } + if ($viewer->getIsAdmin()) { $actions->addAction( id(new PhabricatorActionView()) @@ -134,28 +143,18 @@ final class PhabricatorPeopleProfileController $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($name); - $class = 'PhabricatorConpherenceApplication'; - if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { - $href = '/conpherence/new/?participant='.$user->getPHID(); - $image = id(new PHUIIconView()) - ->setIconFont('fa-comments'); - $button = id(new PHUIButtonView()) - ->setTag('a') - ->setColor(PHUIButtonView::SIMPLE) - ->setIcon($image) - ->setHref($href) - ->setText(pht('Send Message')) - ->setWorkflow(true); - $header->addActionLink($button); - } - $object_box = id(new PHUIObjectBoxView()) ->setHeader($header) ->addPropertyList($properties); + $feed = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Recent Activity')) + ->appendChild($this->buildPeopleFeed($user, $viewer)); + $nav = $this->buildIconNavView($user); $nav->selectFilter("{$name}/"); $nav->appendChild($object_box); + $nav->appendChild($feed); return $this->buildApplicationPage( $nav, @@ -182,4 +181,28 @@ final class PhabricatorPeopleProfileController return $view; } + private function buildPeopleFeed( + PhabricatorUser $user, + $viewer) { + + $query = new PhabricatorFeedQuery(); + $query->setFilterPHIDs( + array( + $user->getPHID(), + )); + $query->setLimit(100); + $query->setViewer($viewer); + $stories = $query->execute(); + + $builder = new PhabricatorFeedBuilder($stories); + $builder->setUser($viewer); + $builder->setShowHovercards(true); + $builder->setNoDataString(pht('To begin on such a grand journey, '. + 'requires but just a single step.')); + $view = $builder->buildView(); + + return phutil_tag_div('phabricator-project-feed', $view->render()); + + } + } diff --git a/src/applications/project/controller/PhabricatorProjectFeedController.php b/src/applications/project/controller/PhabricatorProjectFeedController.php index 5003db4be9..efd82d31d0 100644 --- a/src/applications/project/controller/PhabricatorProjectFeedController.php +++ b/src/applications/project/controller/PhabricatorProjectFeedController.php @@ -32,8 +32,6 @@ final class PhabricatorProjectFeedController ->setURI('/tag/'.$project->getPrimarySlug().'/'); } - require_celerity_resource('phabricator-profile-css'); - $query = new PhabricatorFeedQuery(); $query->setFilterPHIDs( array( @@ -44,11 +42,13 @@ final class PhabricatorProjectFeedController $stories = $query->execute(); $feed = $this->renderStories($stories); - $content = phutil_tag_div('phabricator-project-feed', $feed); + $box = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Project Activity')) + ->appendChild($feed); $nav = $this->buildIconNavView($project); $nav->selectFilter("feed/{$id}/"); - $nav->appendChild($content); + $nav->appendChild($box); return $this->buildApplicationPage( $nav, diff --git a/webroot/rsrc/css/application/profile/profile-view.css b/webroot/rsrc/css/application/profile/profile-view.css deleted file mode 100644 index 234f700127..0000000000 --- a/webroot/rsrc/css/application/profile/profile-view.css +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @provides phabricator-profile-css - */ - -.device-desktop .profile-feed, -.device-tablet .profile-feed { - padding: 0 16px 16px 0; -} - -.device-phone .profile-feed { - padding: 12px 0; -} - -.device-phone .phabricator-project-layout .profile-feed { - padding: 12px 8px; -} - -.profile-feed .phui-action-header-title { - font-size: 16px; - margin-bottom: 5px; -} - -.profile-activity-view { - padding-top: 16px; -} - -.profile-activity-view .profile-calendar { - float: left; - margin: 0 16px; -} - -.profile-activity-view .profile-feed { - margin-left: 16px; -} - -.device-phone .profile-activity-view .profile-feed { - float: none; - margin: 0 8px; -} - -.device-desktop .phabricator-project-layout .profile-feed, -.device-tablet .phabricator-project-layout .profile-feed { - padding: 16px; -} - -.phabricator-project-feed .phui-info-view { - margin: 12px 0; -} - -.device-phone .phabricator-project-feed { - padding: 0 12px; - width: auto; -} diff --git a/webroot/rsrc/css/phui/phui-feed-story.css b/webroot/rsrc/css/phui/phui-feed-story.css index 561b8f9415..ce26558528 100644 --- a/webroot/rsrc/css/phui/phui-feed-story.css +++ b/webroot/rsrc/css/phui/phui-feed-story.css @@ -2,7 +2,7 @@ * @provides phui-feed-story-css */ -.phabricator-feed-frame .phui-box.phui-feed-story { +.phui-object-box .phui-box.phui-feed-story { border-bottom: 1px solid {$thinblueborder}; }