1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00

Clean up Diffusion dedicated tag table view

Summary: Minor cleanup. Make the "imported" check less strict (we don't need owners or herald to show change status). Export the "imported" flag over Conduit.

Test Plan: Viewed tag table. Viewed partially imported repositories.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7455
This commit is contained in:
epriestley 2013-10-30 13:15:14 -07:00
parent bf2fffe264
commit d51ae49f61
4 changed files with 27 additions and 20 deletions

View file

@ -9,7 +9,7 @@ final class DiffusionTagListController extends DiffusionController {
public function processRequest() { public function processRequest() {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $viewer = $request->getUser();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
@ -42,25 +42,22 @@ final class DiffusionTagListController extends DiffusionController {
$content = null; $content = null;
if (!$tags) { if (!$tags) {
$content = new AphrontErrorView(); $content = $this->renderStatusMessage(
$content->setTitle(pht('No Tags')); pht('No Tags'),
if ($is_commit) { $is_commit
$content->appendChild(pht('This commit has no tags.')); ? pht('This commit has no tags.')
: pht('This repository has no tags.'));
} else { } else {
$content->appendChild(pht('This repository has no tags.')); $commits = id(new DiffusionCommitQuery())
} ->setViewer($viewer)
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA); ->withRepositoryIDs(array($repository->getID()))
} else { ->withIdentifiers(mpull($tags, 'getCommitIdentifier'))
$commits = id(new PhabricatorAuditCommitQuery())
->withIdentifiers(
$drequest->getRepository()->getID(),
mpull($tags, 'getCommitIdentifier'))
->needCommitData(true) ->needCommitData(true)
->execute(); ->execute();
$view = id(new DiffusionTagListView()) $view = id(new DiffusionTagListView())
->setTags($tags) ->setTags($tags)
->setUser($user) ->setUser($viewer)
->setCommits($commits) ->setCommits($commits)
->setDiffusionRequest($drequest); ->setDiffusionRequest($drequest);
@ -89,7 +86,7 @@ final class DiffusionTagListController extends DiffusionController {
), ),
array( array(
'title' => array( 'title' => array(
'Tags', pht('Tags'),
$repository->getCallsign().' Repository', $repository->getCallsign().' Repository',
), ),
)); ));

View file

@ -112,8 +112,12 @@ final class DiffusionHistoryTableView extends DiffusionView {
$author = hsprintf('%s/%s', $author, $committer); $author = hsprintf('%s/%s', $author, $committer);
} }
// We can show details once the message and change have been imported.
$partial_import = PhabricatorRepositoryCommit::IMPORTED_MESSAGE |
PhabricatorRepositoryCommit::IMPORTED_CHANGE;
$commit = $history->getCommit(); $commit = $history->getCommit();
if ($commit && $commit->isImported() && $data) { if ($commit && $commit->isPartiallyImported($partial_import) && $data) {
$change = $this->linkChange( $change = $this->linkChange(
$history->getChangeType(), $history->getChangeType(),
$history->getFileType(), $history->getFileType(),

View file

@ -36,6 +36,10 @@ final class PhabricatorRepositoryCommit
return $this->assertAttached($this->repository); return $this->assertAttached($this->repository);
} }
public function isPartiallyImported($mask) {
return (($mask & $this->getImportStatus()) == $mask);
}
public function isImported() { public function isImported() {
return ($this->getImportStatus() == self::IMPORTED_ALL); return ($this->getImportStatus() == self::IMPORTED_ALL);
} }
@ -218,7 +222,9 @@ final class PhabricatorRepositoryCommit
'mailKey' => $this->getMailKey(), 'mailKey' => $this->getMailKey(),
'authorPHID' => $this->getAuthorPHID(), 'authorPHID' => $this->getAuthorPHID(),
'auditStatus' => $this->getAuditStatus(), 'auditStatus' => $this->getAuditStatus(),
'summary' => $this->getSummary()); 'summary' => $this->getSummary(),
'importStatus' => $this->getImportStatus(),
);
} }
public static function newFromDictionary(array $dict) { public static function newFromDictionary(array $dict) {