Differential D15362 Diff 37050 src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
Show First 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | if ($lint_data) { | ||||
$lint = id(new PHUIObjectBoxView()) | $lint = id(new PHUIObjectBoxView()) | ||||
->setHeader($lint_header) | ->setHeader($lint_header) | ||||
->setTable($lint_table); | ->setTable($lint_table); | ||||
} else { | } else { | ||||
$lint = null; | $lint = null; | ||||
} | } | ||||
if ($unit_data) { | if ($unit_data) { | ||||
$unit_href = $this->getApplicationURI('unit/'.$buildable->getID().'/'); | |||||
$unit_table = id(new HarbormasterUnitPropertyView()) | $unit_table = id(new HarbormasterUnitPropertyView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setLimit(25) | ->setLimit(5) | ||||
->setUnitMessages($unit_data); | ->setUnitMessages($unit_data) | ||||
->setFullResultsURI($unit_href); | |||||
$unit_data = msort($unit_data, 'getSortKey'); | |||||
$head_unit = head($unit_data); | |||||
if ($head_unit) { | |||||
$status = $head_unit->getResult(); | |||||
$tag_text = HarbormasterUnitStatus::getUnitStatusLabel($status); | |||||
$tag_color = HarbormasterUnitStatus::getUnitStatusColor($status); | |||||
$tag_icon = HarbormasterUnitStatus::getUnitStatusIcon($status); | |||||
$unit_href = $this->getApplicationURI('unit/'.$buildable->getID().'/'); | } else { | ||||
$tag_text = pht('No Unit Tests'); | |||||
$tag_color = 'grey'; | |||||
$tag_icon = 'fa-ban'; | |||||
} | |||||
$unit_header = id(new PHUIHeaderView()) | $unit_header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Unit Tests')) | ->setHeader(pht('Unit Tests')) | ||||
->setStatus($tag_icon, $tag_color, $tag_text) | |||||
->addActionLink( | ->addActionLink( | ||||
id(new PHUIButtonView()) | id(new PHUIButtonView()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setHref($unit_href) | ->setHref($unit_href) | ||||
->setIcon('fa-list-ul') | ->setIcon('fa-list-ul') | ||||
->setText('View All')); | ->setText('View All')); | ||||
$unit = id(new PHUIObjectBoxView()) | $unit = id(new PHUIObjectBoxView()) | ||||
Show All 12 Lines |