Page MenuHomePhabricator

D10172.id24495.diff
No OneTemporary

D10172.id24495.diff

diff --git a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
@@ -93,28 +93,28 @@
break;
case HarbormasterBuildCommand::COMMAND_STOP:
if ($can_issue) {
- $title = pht('Really stop build?');
+ $title = pht('Really pause build?');
$body = pht(
- 'If you stop this build, work will halt once the current steps '.
+ 'If you pause this build, work will halt once the current steps '.
'complete. You can resume the build later.');
- $submit = pht('Stop Build');
+ $submit = pht('Pause Build');
} else {
- $title = pht('Unable to Stop Build');
+ $title = pht('Unable to Pause Build');
if ($build->isComplete()) {
$body = pht(
- 'This build is already complete. You can not stop a completed '.
+ 'This build is already complete. You can not pause a completed '.
'build.');
} else if ($build->isStopped()) {
$body = pht(
- 'This build is already stopped. You can not stop a build which '.
- 'has already been stopped.');
+ 'This build is already paused. You can not pause a build which '.
+ 'has already been paused.');
} else if ($build->isStopping()) {
$body = pht(
- 'This build is already stopping. You can not reissue a stop '.
- 'command to a stopping build.');
+ 'This build is already pausing. You can not reissue a pause '.
+ 'command to a pausing build.');
} else {
$body = pht(
- 'This build can not be stopped.');
+ 'This build can not be paused.');
}
}
break;
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
@@ -35,7 +35,7 @@
if ($build->isRestarting()) {
$header->setStatus('fa-exclamation-triangle', 'red', pht('Restarting'));
} else if ($build->isStopping()) {
- $header->setStatus('fa-exclamation-triangle', 'red', pht('Stopping'));
+ $header->setStatus('fa-exclamation-triangle', 'red', pht('Pausing'));
} else if ($build->isResuming()) {
$header->setStatus('fa-exclamation-triangle', 'red', pht('Resuming'));
}
@@ -355,26 +355,28 @@
$list->addAction(
id(new PhabricatorActionView())
->setName(pht('Restart Build'))
- ->setIcon('fa-backward')
+ ->setIcon('fa-repeat')
->setHref($this->getApplicationURI('/build/restart/'.$id.'/'))
->setDisabled(!$can_restart)
->setWorkflow(true));
- $list->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Stop Build'))
- ->setIcon('fa-stop')
- ->setHref($this->getApplicationURI('/build/stop/'.$id.'/'))
- ->setDisabled(!$can_stop)
- ->setWorkflow(true));
-
- $list->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Resume Build'))
- ->setIcon('fa-play')
- ->setHref($this->getApplicationURI('/build/resume/'.$id.'/'))
- ->setDisabled(!$can_resume)
- ->setWorkflow(true));
+ if ($build->canResumeBuild()) {
+ $list->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Resume Build'))
+ ->setIcon('fa-play')
+ ->setHref($this->getApplicationURI('/build/resume/'.$id.'/'))
+ ->setDisabled(!$can_resume)
+ ->setWorkflow(true));
+ } else {
+ $list->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Pause Build'))
+ ->setIcon('fa-pause')
+ ->setHref($this->getApplicationURI('/build/stop/'.$id.'/'))
+ ->setDisabled(!$can_stop)
+ ->setWorkflow(true));
+ }
return $list;
}
@@ -419,7 +421,7 @@
$item = new PHUIStatusItemView();
if ($build->isStopping()) {
- $status_name = pht('Stopping');
+ $status_name = pht('Pausing');
$icon = PHUIStatusItemView::ICON_RIGHT;
$color = 'dark';
} else {
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
@@ -110,7 +110,7 @@
$list->addAction(
id(new PhabricatorActionView())
- ->setIcon('fa-backward')
+ ->setIcon('fa-repeat')
->setName(pht('Restart All Builds'))
->setHref($this->getApplicationURI($restart_uri))
->setWorkflow(true)
@@ -118,8 +118,8 @@
$list->addAction(
id(new PhabricatorActionView())
- ->setIcon('fa-stop')
- ->setName(pht('Stop All Builds'))
+ ->setIcon('fa-pause')
+ ->setName(pht('Pause All Builds'))
->setHref($this->getApplicationURI($stop_uri))
->setWorkflow(true)
->setDisabled(!$can_stop || !$can_edit));
@@ -184,9 +184,9 @@
$item->addAttribute(HarbormasterBuild::getBuildStatusName($status));
if ($build->isRestarting()) {
- $item->addIcon('fa-backward', pht('Restarting'));
+ $item->addIcon('fa-repeat', pht('Restarting'));
} else if ($build->isStopping()) {
- $item->addIcon('fa-stop', pht('Stopping'));
+ $item->addIcon('fa-pause', pht('Pausing'));
} else if ($build->isResuming()) {
$item->addIcon('fa-play', pht('Resuming'));
}
@@ -199,7 +199,7 @@
$item->addAction(
id(new PHUIListItemView())
- ->setIcon('fa-backward')
+ ->setIcon('fa-repeat')
->setName(pht('Restart'))
->setHref($this->getApplicationURI($restart_uri))
->setWorkflow(true)
@@ -215,8 +215,8 @@
} else {
$item->addAction(
id(new PHUIListItemView())
- ->setIcon('fa-stop')
- ->setName(pht('Stop'))
+ ->setIcon('fa-pause')
+ ->setName(pht('Pause'))
->setHref($this->getApplicationURI($stop_uri))
->setWorkflow(true)
->setDisabled(!$build->canStopBuild()));
@@ -227,38 +227,11 @@
if ($targets) {
$target_list = id(new PHUIStatusListView());
foreach ($targets as $target) {
- switch ($target->getTargetStatus()) {
- case HarbormasterBuildTarget::STATUS_PENDING:
- $icon = PHUIStatusItemView::ICON_CLOCK;
- $color = 'green';
- $status_name = pht('Pending');
- break;
- case HarbormasterBuildTarget::STATUS_BUILDING:
- $icon = PHUIStatusItemView::ICON_RIGHT;
- $color = 'green';
- $status_name = pht('Building');
- break;
- case HarbormasterBuildTarget::STATUS_WAITING:
- $icon = PHUIStatusItemView::ICON_CLOCK;
- $color = 'orange';
- $status_name = pht('Waiting');
- break;
- case HarbormasterBuildTarget::STATUS_PASSED:
- $icon = PHUIStatusItemView::ICON_ACCEPT;
- $color = 'green';
- $status_name = pht('Passed');
- break;
- case HarbormasterBuildTarget::STATUS_FAILED:
- $icon = PHUIStatusItemView::ICON_REJECT;
- $color = 'red';
- $status_name = pht('Failed');
- break;
- default:
- $icon = PHUIStatusItemView::ICON_QUESTION;
- $color = 'bluegrey';
- $status_name = pht('Unknown');
- break;
- }
+ $status = $target->getTargetStatus();
+ $icon = HarbormasterBuildTarget::getBuildTargetStatusIcon($status);
+ $color = HarbormasterBuildTarget::getBuildTargetStatusColor($status);
+ $status_name =
+ HarbormasterBuildTarget::getBuildTargetStatusName($status);
$name = $target->getName();
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
@@ -74,7 +74,7 @@
case self::STATUS_ERROR:
return pht('Unexpected Error');
case self::STATUS_STOPPED:
- return pht('Stopped');
+ return pht('Paused');
case self::STATUS_DEADLOCKED:
return pht('Deadlocked');
default:

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 5:34 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6709878
Default Alt Text
D10172.id24495.diff (8 KB)

Event Timeline