diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php index 634a3b0dc4..ac55bf40b0 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php @@ -1,340 +1,340 @@ getViewer(); $buildable = id(new HarbormasterBuildableQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->needBuildableHandles(true) ->needContainerHandles(true) ->executeOne(); if (!$buildable) { return new Aphront404Response(); } $id = $buildable->getID(); // Pull builds and build targets. $builds = id(new HarbormasterBuildQuery()) ->setViewer($viewer) ->withBuildablePHIDs(array($buildable->getPHID())) ->needBuildTargets(true) ->execute(); list($lint, $unit) = $this->renderLintAndUnit($buildable, $builds); $buildable->attachBuilds($builds); $object = $buildable->getBuildableObject(); $build_list = $this->buildBuildList($buildable); $title = pht('Buildable %d', $id); $header = id(new PHUIHeaderView()) ->setHeader($title) ->setUser($viewer) ->setPolicyObject($buildable); $box = id(new PHUIObjectBoxView()) ->setHeader($header); $timeline = $this->buildTransactionTimeline( $buildable, new HarbormasterBuildableTransactionQuery()); $timeline->setShouldTerminate(true); $actions = $this->buildActionList($buildable); $this->buildPropertyLists($box, $buildable, $actions); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($buildable->getMonogram()); return $this->buildApplicationPage( array( $crumbs, $box, $lint, $unit, $build_list, $timeline, ), array( 'title' => $title, )); } private function buildActionList(HarbormasterBuildable $buildable) { $request = $this->getRequest(); $viewer = $request->getUser(); $id = $buildable->getID(); $list = id(new PhabricatorActionListView()) ->setUser($viewer) ->setObject($buildable) ->setObjectURI($buildable->getMonogram()); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $buildable, PhabricatorPolicyCapability::CAN_EDIT); $can_restart = false; $can_resume = false; $can_stop = false; foreach ($buildable->getBuilds() as $build) { if ($build->canRestartBuild()) { $can_restart = true; } if ($build->canResumeBuild()) { $can_resume = true; } if ($build->canStopBuild()) { $can_stop = true; } } $restart_uri = "buildable/{$id}/restart/"; $stop_uri = "buildable/{$id}/stop/"; $resume_uri = "buildable/{$id}/resume/"; $list->addAction( id(new PhabricatorActionView()) ->setIcon('fa-repeat') ->setName(pht('Restart All Builds')) ->setHref($this->getApplicationURI($restart_uri)) ->setWorkflow(true) ->setDisabled(!$can_restart || !$can_edit)); $list->addAction( id(new PhabricatorActionView()) ->setIcon('fa-pause') ->setName(pht('Pause All Builds')) ->setHref($this->getApplicationURI($stop_uri)) ->setWorkflow(true) ->setDisabled(!$can_stop || !$can_edit)); $list->addAction( id(new PhabricatorActionView()) ->setIcon('fa-play') ->setName(pht('Resume All Builds')) ->setHref($this->getApplicationURI($resume_uri)) ->setWorkflow(true) ->setDisabled(!$can_resume || !$can_edit)); return $list; } private function buildPropertyLists( PHUIObjectBoxView $box, HarbormasterBuildable $buildable, PhabricatorActionListView $actions) { $request = $this->getRequest(); $viewer = $request->getUser(); $properties = id(new PHUIPropertyListView()) ->setUser($viewer) ->setObject($buildable) ->setActionList($actions); $box->addPropertyList($properties); if ($buildable->getContainerHandle() !== null) { $properties->addProperty( pht('Container'), $buildable->getContainerHandle()->renderLink()); } $properties->addProperty( pht('Buildable'), $buildable->getBuildableHandle()->renderLink()); $properties->addProperty( pht('Origin'), $buildable->getIsManualBuildable() ? pht('Manual Buildable') : pht('Automatic Buildable')); } private function buildBuildList(HarbormasterBuildable $buildable) { $viewer = $this->getRequest()->getUser(); $build_list = id(new PHUIObjectItemListView()) ->setUser($viewer); foreach ($buildable->getBuilds() as $build) { $view_uri = $this->getApplicationURI('/build/'.$build->getID().'/'); $item = id(new PHUIObjectItemView()) ->setObjectName(pht('Build %d', $build->getID())) ->setHeader($build->getName()) ->setHref($view_uri); $status = $build->getBuildStatus(); $item->setStatusIcon( 'fa-dot-circle-o '.HarbormasterBuild::getBuildStatusColor($status), HarbormasterBuild::getBuildStatusName($status)); $item->addAttribute(HarbormasterBuild::getBuildStatusName($status)); if ($build->isRestarting()) { $item->addIcon('fa-repeat', pht('Restarting')); } else if ($build->isStopping()) { $item->addIcon('fa-pause', pht('Pausing')); } else if ($build->isResuming()) { $item->addIcon('fa-play', pht('Resuming')); } $build_id = $build->getID(); $restart_uri = "build/restart/{$build_id}/buildable/"; $resume_uri = "build/resume/{$build_id}/buildable/"; $stop_uri = "build/stop/{$build_id}/buildable/"; $item->addAction( id(new PHUIListItemView()) ->setIcon('fa-repeat') ->setName(pht('Restart')) ->setHref($this->getApplicationURI($restart_uri)) ->setWorkflow(true) ->setDisabled(!$build->canRestartBuild())); if ($build->canResumeBuild()) { $item->addAction( id(new PHUIListItemView()) ->setIcon('fa-play') ->setName(pht('Resume')) ->setHref($this->getApplicationURI($resume_uri)) ->setWorkflow(true)); } else { $item->addAction( id(new PHUIListItemView()) ->setIcon('fa-pause') ->setName(pht('Pause')) ->setHref($this->getApplicationURI($stop_uri)) ->setWorkflow(true) ->setDisabled(!$build->canStopBuild())); } $targets = $build->getBuildTargets(); if ($targets) { $target_list = id(new PHUIStatusListView()); foreach ($targets as $target) { $status = $target->getTargetStatus(); $icon = HarbormasterBuildTarget::getBuildTargetStatusIcon($status); $color = HarbormasterBuildTarget::getBuildTargetStatusColor($status); $status_name = HarbormasterBuildTarget::getBuildTargetStatusName($status); $name = $target->getName(); $target_list->addItem( id(new PHUIStatusItemView()) ->setIcon($icon, $color, $status_name) ->setTarget(pht('Target %d', $target->getID())) ->setNote($name)); } $target_box = id(new PHUIBoxView()) ->addPadding(PHUI::PADDING_SMALL) ->appendChild($target_list); $item->appendChild($target_box); } $build_list->addItem($item); } $build_list->setFlush(true); $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Builds')) ->appendChild($build_list); return $box; } private function renderLintAndUnit( HarbormasterBuildable $buildable, array $builds) { $viewer = $this->getViewer(); $targets = array(); foreach ($builds as $build) { foreach ($build->getBuildTargets() as $target) { $targets[] = $target; } } if (!$targets) { return; } $target_phids = mpull($targets, 'getPHID'); $lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere( 'buildTargetPHID IN (%Ls)', $target_phids); $unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere( 'buildTargetPHID IN (%Ls)', $target_phids); if ($lint_data) { $lint_table = id(new HarbormasterLintPropertyView()) ->setUser($viewer) ->setLimit(10) ->setLintMessages($lint_data); $lint_href = $this->getApplicationURI('lint/'.$buildable->getID().'/'); $lint_header = id(new PHUIHeaderView()) ->setHeader(pht('Lint Messages')) ->addActionLink( id(new PHUIButtonView()) ->setTag('a') ->setHref($lint_href) ->setIconFont('fa-list-ul') ->setText('View All')); $lint = id(new PHUIObjectBoxView()) ->setHeader($lint_header) - ->appendChild($lint_table); + ->setTable($lint_table); } else { $lint = null; } if ($unit_data) { $unit_table = id(new HarbormasterUnitPropertyView()) ->setUser($viewer) ->setLimit(25) ->setUnitMessages($unit_data); $unit_href = $this->getApplicationURI('unit/'.$buildable->getID().'/'); $unit_header = id(new PHUIHeaderView()) ->setHeader(pht('Unit Tests')) ->addActionLink( id(new PHUIButtonView()) ->setTag('a') ->setHref($unit_href) ->setIconFont('fa-list-ul') ->setText('View All')); $unit = id(new PHUIObjectBoxView()) ->setHeader($unit_header) - ->appendChild($unit_table); + ->setTable($unit_table); } else { $unit = null; } return array($lint, $unit); } } diff --git a/src/applications/harbormaster/controller/HarbormasterUnitMessagesController.php b/src/applications/harbormaster/controller/HarbormasterUnitMessagesController.php index cf56f8e4d3..ada83f9a5a 100644 --- a/src/applications/harbormaster/controller/HarbormasterUnitMessagesController.php +++ b/src/applications/harbormaster/controller/HarbormasterUnitMessagesController.php @@ -1,64 +1,64 @@ getViewer(); $buildable = id(new HarbormasterBuildableQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->needBuilds(true) ->needTargets(true) ->executeOne(); if (!$buildable) { return new Aphront404Response(); } $id = $buildable->getID(); $target_phids = array(); foreach ($buildable->getBuilds() as $build) { foreach ($build->getBuildTargets() as $target) { $target_phids[] = $target->getPHID(); } } $unit_data = array(); if ($target_phids) { $unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere( 'buildTargetPHID IN (%Ls)', $target_phids); } else { $unit_data = array(); } $unit_table = id(new HarbormasterUnitPropertyView()) ->setUser($viewer) ->setUnitMessages($unit_data); $unit = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Unit Tests')) - ->appendChild($unit_table); + ->setTable($unit_table); $crumbs = $this->buildApplicationCrumbs(); $this->addBuildableCrumb($crumbs, $buildable); $crumbs->addTextCrumb(pht('Unit Tests')); $title = array( $buildable->getMonogram(), pht('Unit Tests'), ); return $this->buildApplicationPage( array( $crumbs, $unit, ), array( 'title' => $title, )); } } diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 7935031389..6ec31eadfc 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -1,288 +1,288 @@ getViewer(); $package = id(new PhabricatorOwnersPackageQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->executeOne(); if (!$package) { return new Aphront404Response(); } $paths = $package->loadPaths(); $repository_phids = array(); foreach ($paths as $path) { $repository_phids[$path->getRepositoryPHID()] = true; } if ($repository_phids) { $repositories = id(new PhabricatorRepositoryQuery()) ->setViewer($viewer) ->withPHIDs(array_keys($repository_phids)) ->execute(); $repositories = mpull($repositories, null, 'getPHID'); } else { $repositories = array(); } $actions = $this->buildPackageActionView($package); $properties = $this->buildPackagePropertyView($package); $properties->setActionList($actions); $header = id(new PHUIHeaderView()) ->setUser($viewer) ->setHeader($package->getName()) ->setPolicyObject($package); $panel = id(new PHUIObjectBoxView()) ->setHeader($header) ->addPropertyList($properties); $commit_views = array(); $commit_uri = id(new PhutilURI('/audit/')) ->setQueryParams( array( 'auditorPHIDs' => $package->getPHID(), )); $attention_commits = id(new DiffusionCommitQuery()) ->setViewer($request->getUser()) ->withAuditorPHIDs(array($package->getPHID())) ->withAuditStatus(DiffusionCommitQuery::AUDIT_STATUS_CONCERN) ->needCommitData(true) ->setLimit(10) ->execute(); if ($attention_commits) { $view = id(new PhabricatorAuditListView()) ->setUser($viewer) ->setCommits($attention_commits); $commit_views[] = array( 'view' => $view, 'header' => pht('Commits in this Package that Need Attention'), 'button' => id(new PHUIButtonView()) ->setTag('a') ->setHref($commit_uri->alter('status', 'open')) ->setText(pht('View All Problem Commits')), ); } $all_commits = id(new DiffusionCommitQuery()) ->setViewer($request->getUser()) ->withAuditorPHIDs(array($package->getPHID())) ->needCommitData(true) ->setLimit(100) ->execute(); $view = id(new PhabricatorAuditListView()) ->setUser($viewer) ->setCommits($all_commits) ->setNoDataString(pht('No commits in this package.')); $commit_views[] = array( 'view' => $view, 'header' => pht('Recent Commits in Package'), 'button' => id(new PHUIButtonView()) ->setTag('a') ->setHref($commit_uri) ->setText(pht('View All Package Commits')), ); $phids = array(); foreach ($commit_views as $commit_view) { $phids[] = $commit_view['view']->getRequiredHandlePHIDs(); } $phids = array_mergev($phids); $handles = $this->loadViewerHandles($phids); $commit_panels = array(); foreach ($commit_views as $commit_view) { $commit_panel = new PHUIObjectBoxView(); $header = new PHUIHeaderView(); $header->setHeader($commit_view['header']); if (isset($commit_view['button'])) { $header->addActionLink($commit_view['button']); } $commit_view['view']->setHandles($handles); $commit_panel->setHeader($header); $commit_panel->appendChild($commit_view['view']); $commit_panels[] = $commit_panel; } $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($package->getName()); $timeline = $this->buildTransactionTimeline( $package, new PhabricatorOwnersPackageTransactionQuery()); $timeline->setShouldTerminate(true); return $this->buildApplicationPage( array( $crumbs, $panel, $this->renderPathsTable($paths, $repositories), $commit_panels, $timeline, ), array( 'title' => $package->getName(), )); } private function buildPackagePropertyView(PhabricatorOwnersPackage $package) { $viewer = $this->getViewer(); $view = id(new PHUIPropertyListView()) ->setUser($viewer); $primary_phid = $package->getPrimaryOwnerPHID(); if ($primary_phid) { $primary_owner = $viewer->renderHandle($primary_phid); } else { $primary_owner = phutil_tag('em', array(), pht('None')); } $view->addProperty(pht('Primary Owner'), $primary_owner); // TODO: needOwners() this on the Query. $owners = $package->loadOwners(); if ($owners) { $owner_list = $viewer->renderHandleList(mpull($owners, 'getUserPHID')); } else { $owner_list = phutil_tag('em', array(), pht('None')); } $view->addProperty(pht('Owners'), $owner_list); if ($package->getAuditingEnabled()) { $auditing = pht('Enabled'); } else { $auditing = pht('Disabled'); } $view->addProperty(pht('Auditing'), $auditing); $description = $package->getDescription(); if (strlen($description)) { $view->addSectionHeader(pht('Description')); $view->addTextContent( $output = PhabricatorMarkupEngine::renderOneObject( id(new PhabricatorMarkupOneOff())->setContent($description), 'default', $viewer)); } return $view; } private function buildPackageActionView(PhabricatorOwnersPackage $package) { $viewer = $this->getViewer(); // TODO: Implement this capability. $can_edit = true; $id = $package->getID(); $edit_uri = $this->getApplicationURI("/edit/{$id}/"); $paths_uri = $this->getApplicationURI("/paths/{$id}/"); $view = id(new PhabricatorActionListView()) ->setUser($viewer) ->setObject($package) ->addAction( id(new PhabricatorActionView()) ->setName(pht('Edit Package')) ->setIcon('fa-pencil') ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setHref($edit_uri)) ->addAction( id(new PhabricatorActionView()) ->setName(pht('Edit Paths')) ->setIcon('fa-folder-open') ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setHref($paths_uri)); return $view; } private function renderPathsTable(array $paths, array $repositories) { $viewer = $this->getViewer(); $rows = array(); foreach ($paths as $path) { $repo = idx($repositories, $path->getRepositoryPHID()); if (!$repo) { continue; } $href = DiffusionRequest::generateDiffusionURI( array( 'callsign' => $repo->getCallsign(), 'branch' => $repo->getDefaultBranch(), 'path' => $path->getPath(), 'action' => 'browse', )); $path_link = phutil_tag( 'a', array( 'href' => (string)$href, ), $path->getPath()); $rows[] = array( ($path->getExcluded() ? '-' : '+'), $repo->getName(), $path_link, ); } $info = null; if (!$paths) { $info = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setErrors( array( pht( 'This package does not contain any paths yet. Use '. '"Edit Paths" to add some.'), )); } $table = id(new AphrontTableView($rows)) ->setHeaders( array( null, pht('Repository'), pht('Path'), )) ->setColumnClasses( array( null, null, 'wide', )); $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Paths')) - ->appendChild($table); + ->setTable($table); if ($info) { $box->setInfoView($info); } return $box; } } diff --git a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php index fd64142c1e..851ef113d0 100644 --- a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php +++ b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php @@ -1,195 +1,194 @@ setParameter( 'userPHIDs', $this->readUsersFromRequest($request, 'users')); $saved->setParameter( 'actorPHIDs', $this->readUsersFromRequest($request, 'actors')); $saved->setParameter( 'actions', $this->readListFromRequest($request, 'actions')); $saved->setParameter( 'ip', $request->getStr('ip')); $saved->setParameter( 'sessions', $this->readListFromRequest($request, 'sessions')); return $saved; } public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { $query = id(new PhabricatorPeopleLogQuery()); // NOTE: If the viewer isn't an administrator, always restrict the query to // related records. This echoes the policy logic of these logs. This is // mostly a performance optimization, to prevent us from having to pull // large numbers of logs that the user will not be able to see and filter // them in-process. $viewer = $this->requireViewer(); if (!$viewer->getIsAdmin()) { $query->withRelatedPHIDs(array($viewer->getPHID())); } $actor_phids = $saved->getParameter('actorPHIDs', array()); if ($actor_phids) { $query->withActorPHIDs($actor_phids); } $user_phids = $saved->getParameter('userPHIDs', array()); if ($user_phids) { $query->withUserPHIDs($user_phids); } $actions = $saved->getParameter('actions', array()); if ($actions) { $query->withActions($actions); } $remote_prefix = $saved->getParameter('ip'); if (strlen($remote_prefix)) { $query->withRemoteAddressprefix($remote_prefix); } $sessions = $saved->getParameter('sessions', array()); if ($sessions) { $query->withSessionKeys($sessions); } return $query; } public function buildSearchForm( AphrontFormView $form, PhabricatorSavedQuery $saved) { $actor_phids = $saved->getParameter('actorPHIDs', array()); $user_phids = $saved->getParameter('userPHIDs', array()); $actions = $saved->getParameter('actions', array()); $remote_prefix = $saved->getParameter('ip'); $sessions = $saved->getParameter('sessions', array()); $actions = array_fuse($actions); $action_control = id(new AphrontFormCheckboxControl()) ->setLabel(pht('Actions')); $action_types = PhabricatorUserLog::getActionTypeMap(); foreach ($action_types as $type => $label) { $action_control->addCheckbox( 'actions[]', $type, $label, isset($actions[$label])); } $form ->appendControl( id(new AphrontFormTokenizerControl()) ->setDatasource(new PhabricatorPeopleDatasource()) ->setName('actors') ->setLabel(pht('Actors')) ->setValue($actor_phids)) ->appendControl( id(new AphrontFormTokenizerControl()) ->setDatasource(new PhabricatorPeopleDatasource()) ->setName('users') ->setLabel(pht('Users')) ->setValue($user_phids)) ->appendChild($action_control) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Filter IP')) ->setName('ip') ->setValue($remote_prefix)) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Sessions')) ->setName('sessions') ->setValue(implode(', ', $sessions))); } protected function getURI($path) { return '/people/logs/'.$path; } protected function getBuiltinQueryNames() { $names = array( 'all' => pht('All'), ); return $names; } public function buildSavedQueryFromBuiltin($query_key) { $query = $this->newSavedQuery(); $query->setQueryKey($query_key); switch ($query_key) { case 'all': return $query; } return parent::buildSavedQueryFromBuiltin($query_key); } protected function getRequiredHandlePHIDsForResultList( array $logs, PhabricatorSavedQuery $query) { $phids = array(); foreach ($logs as $log) { $phids[$log->getActorPHID()] = true; $phids[$log->getUserPHID()] = true; } return array_keys($phids); } protected function renderResultList( array $logs, PhabricatorSavedQuery $query, array $handles) { assert_instances_of($logs, 'PhabricatorUserLog'); $viewer = $this->requireViewer(); $table = id(new PhabricatorUserLogView()) ->setUser($viewer) ->setLogs($logs) ->setHandles($handles); if ($viewer->getIsAdmin()) { $table->setSearchBaseURI($this->getApplicationURI('logs/')); } $result = new PhabricatorApplicationSearchResultView(); - $result->setContent($table); - $result->setCollapsed(true); + $result->setTable($table); return $result; } } diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php index ac798975ac..b054423d26 100644 --- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php +++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php @@ -1,115 +1,115 @@ setParameter( 'repositoryPHIDs', $this->readPHIDsFromRequest( $request, 'repositories', array( PhabricatorRepositoryRepositoryPHIDType::TYPECONST, ))); $saved->setParameter( 'pusherPHIDs', $this->readUsersFromRequest( $request, 'pushers')); return $saved; } public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { $query = id(new PhabricatorRepositoryPushLogQuery()); $repository_phids = $saved->getParameter('repositoryPHIDs'); if ($repository_phids) { $query->withRepositoryPHIDs($repository_phids); } $pusher_phids = $saved->getParameter('pusherPHIDs'); if ($pusher_phids) { $query->withPusherPHIDs($pusher_phids); } return $query; } public function buildSearchForm( AphrontFormView $form, PhabricatorSavedQuery $saved_query) { $repository_phids = $saved_query->getParameter('repositoryPHIDs', array()); $pusher_phids = $saved_query->getParameter('pusherPHIDs', array()); $form ->appendControl( id(new AphrontFormTokenizerControl()) ->setDatasource(new DiffusionRepositoryDatasource()) ->setName('repositories') ->setLabel(pht('Repositories')) ->setValue($repository_phids)) ->appendControl( id(new AphrontFormTokenizerControl()) ->setDatasource(new PhabricatorPeopleDatasource()) ->setName('pushers') ->setLabel(pht('Pushers')) ->setValue($pusher_phids)); } protected function getURI($path) { return '/diffusion/pushlog/'.$path; } protected function getBuiltinQueryNames() { return array( 'all' => pht('All Push Logs'), ); } public function buildSavedQueryFromBuiltin($query_key) { $query = $this->newSavedQuery(); $query->setQueryKey($query_key); switch ($query_key) { case 'all': return $query; } return parent::buildSavedQueryFromBuiltin($query_key); } protected function getRequiredHandlePHIDsForResultList( array $logs, PhabricatorSavedQuery $query) { return mpull($logs, 'getPusherPHID'); } protected function renderResultList( array $logs, PhabricatorSavedQuery $query, array $handles) { - $content = id(new DiffusionPushLogListView()) + $table = id(new DiffusionPushLogListView()) ->setUser($this->requireViewer()) ->setHandles($handles) ->setLogs($logs); return id(new PhabricatorApplicationSearchResultView()) - ->setContent($content); + ->setTable($table); } } diff --git a/src/applications/search/view/PhabricatorApplicationSearchResultView.php b/src/applications/search/view/PhabricatorApplicationSearchResultView.php index 729b6833bd..a6b8aa3b8b 100644 --- a/src/applications/search/view/PhabricatorApplicationSearchResultView.php +++ b/src/applications/search/view/PhabricatorApplicationSearchResultView.php @@ -1,87 +1,87 @@ objectList = $list; return $this; } public function getObjectList() { $list = $this->objectList; if ($list) { if ($this->noDataString) { $list->setNoDataString($this->noDataString); } else { $list->setNoDataString(pht('No results found for this query.')); } } return $list; } - public function setTable(AphrontTableView $table) { + public function setTable($table) { $this->table = $table; return $this; } public function getTable() { return $this->table; } public function setInfoView(PHUIInfoView $infoview) { $this->infoView = $infoview; return $this; } public function getInfoView() { return $this->infoView; } public function setContent($content) { $this->content = $content; return $this; } public function getContent() { return $this->content; } public function addAction(PHUIButtonView $button) { $this->actions[] = $button; return $this; } public function getActions() { return $this->actions; } public function setCollapsed($collapsed) { $this->collapsed = $collapsed; return $this; } public function getCollapsed() { return $this->collapsed; } public function setNoDataString($nodata) { $this->noDataString = $nodata; return $this; } }