mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +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:
parent
bf2fffe264
commit
d51ae49f61
4 changed files with 27 additions and 20 deletions
|
@ -55,7 +55,7 @@ final class DiffusionBranchTableController extends DiffusionController {
|
|||
|
||||
$crumbs = $this->buildCrumbs(
|
||||
array(
|
||||
'branches' => true,
|
||||
'branches' => true,
|
||||
));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
|
|
|
@ -9,7 +9,7 @@ final class DiffusionTagListController extends DiffusionController {
|
|||
public function processRequest() {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
$viewer = $request->getUser();
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
|
@ -42,25 +42,22 @@ final class DiffusionTagListController extends DiffusionController {
|
|||
|
||||
$content = null;
|
||||
if (!$tags) {
|
||||
$content = new AphrontErrorView();
|
||||
$content->setTitle(pht('No Tags'));
|
||||
if ($is_commit) {
|
||||
$content->appendChild(pht('This commit has no tags.'));
|
||||
} else {
|
||||
$content->appendChild(pht('This repository has no tags.'));
|
||||
}
|
||||
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA);
|
||||
$content = $this->renderStatusMessage(
|
||||
pht('No Tags'),
|
||||
$is_commit
|
||||
? pht('This commit has no tags.')
|
||||
: pht('This repository has no tags.'));
|
||||
} else {
|
||||
$commits = id(new PhabricatorAuditCommitQuery())
|
||||
->withIdentifiers(
|
||||
$drequest->getRepository()->getID(),
|
||||
mpull($tags, 'getCommitIdentifier'))
|
||||
$commits = id(new DiffusionCommitQuery())
|
||||
->setViewer($viewer)
|
||||
->withRepositoryIDs(array($repository->getID()))
|
||||
->withIdentifiers(mpull($tags, 'getCommitIdentifier'))
|
||||
->needCommitData(true)
|
||||
->execute();
|
||||
|
||||
$view = id(new DiffusionTagListView())
|
||||
->setTags($tags)
|
||||
->setUser($user)
|
||||
->setUser($viewer)
|
||||
->setCommits($commits)
|
||||
->setDiffusionRequest($drequest);
|
||||
|
||||
|
@ -78,8 +75,8 @@ final class DiffusionTagListController extends DiffusionController {
|
|||
|
||||
$crumbs = $this->buildCrumbs(
|
||||
array(
|
||||
'tags' => true,
|
||||
'commit' => $drequest->getRawCommit(),
|
||||
'tags' => true,
|
||||
'commit' => $drequest->getRawCommit(),
|
||||
));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
|
@ -89,7 +86,7 @@ final class DiffusionTagListController extends DiffusionController {
|
|||
),
|
||||
array(
|
||||
'title' => array(
|
||||
'Tags',
|
||||
pht('Tags'),
|
||||
$repository->getCallsign().' Repository',
|
||||
),
|
||||
));
|
||||
|
|
|
@ -112,8 +112,12 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
|||
$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();
|
||||
if ($commit && $commit->isImported() && $data) {
|
||||
if ($commit && $commit->isPartiallyImported($partial_import) && $data) {
|
||||
$change = $this->linkChange(
|
||||
$history->getChangeType(),
|
||||
$history->getFileType(),
|
||||
|
|
|
@ -36,6 +36,10 @@ final class PhabricatorRepositoryCommit
|
|||
return $this->assertAttached($this->repository);
|
||||
}
|
||||
|
||||
public function isPartiallyImported($mask) {
|
||||
return (($mask & $this->getImportStatus()) == $mask);
|
||||
}
|
||||
|
||||
public function isImported() {
|
||||
return ($this->getImportStatus() == self::IMPORTED_ALL);
|
||||
}
|
||||
|
@ -218,7 +222,9 @@ final class PhabricatorRepositoryCommit
|
|||
'mailKey' => $this->getMailKey(),
|
||||
'authorPHID' => $this->getAuthorPHID(),
|
||||
'auditStatus' => $this->getAuditStatus(),
|
||||
'summary' => $this->getSummary());
|
||||
'summary' => $this->getSummary(),
|
||||
'importStatus' => $this->getImportStatus(),
|
||||
);
|
||||
}
|
||||
|
||||
public static function newFromDictionary(array $dict) {
|
||||
|
|
Loading…
Reference in a new issue