mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 06:50:55 +01:00
Change "Stop" to "Pause" in Harbormaster build UI
Summary: Resolves T5814. Ref T1049. This changes "Stop" to "Pause" in the UI (internally it's still referred to as Stop). Test Plan: Viewed builds and saw the intended wording. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T1049, T5814 Differential Revision: https://secure.phabricator.com/D10172
This commit is contained in:
parent
27d44594dc
commit
bc116d7e02
4 changed files with 44 additions and 69 deletions
|
@ -93,28 +93,28 @@ final class HarbormasterBuildActionController
|
||||||
break;
|
break;
|
||||||
case HarbormasterBuildCommand::COMMAND_STOP:
|
case HarbormasterBuildCommand::COMMAND_STOP:
|
||||||
if ($can_issue) {
|
if ($can_issue) {
|
||||||
$title = pht('Really stop build?');
|
$title = pht('Really pause build?');
|
||||||
$body = pht(
|
$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.');
|
'complete. You can resume the build later.');
|
||||||
$submit = pht('Stop Build');
|
$submit = pht('Pause Build');
|
||||||
} else {
|
} else {
|
||||||
$title = pht('Unable to Stop Build');
|
$title = pht('Unable to Pause Build');
|
||||||
if ($build->isComplete()) {
|
if ($build->isComplete()) {
|
||||||
$body = pht(
|
$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.');
|
'build.');
|
||||||
} else if ($build->isStopped()) {
|
} else if ($build->isStopped()) {
|
||||||
$body = pht(
|
$body = pht(
|
||||||
'This build is already stopped. You can not stop a build which '.
|
'This build is already paused. You can not pause a build which '.
|
||||||
'has already been stopped.');
|
'has already been paused.');
|
||||||
} else if ($build->isStopping()) {
|
} else if ($build->isStopping()) {
|
||||||
$body = pht(
|
$body = pht(
|
||||||
'This build is already stopping. You can not reissue a stop '.
|
'This build is already pausing. You can not reissue a pause '.
|
||||||
'command to a stopping build.');
|
'command to a pausing build.');
|
||||||
} else {
|
} else {
|
||||||
$body = pht(
|
$body = pht(
|
||||||
'This build can not be stopped.');
|
'This build can not be paused.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -35,7 +35,7 @@ final class HarbormasterBuildViewController
|
||||||
if ($build->isRestarting()) {
|
if ($build->isRestarting()) {
|
||||||
$header->setStatus('fa-exclamation-triangle', 'red', pht('Restarting'));
|
$header->setStatus('fa-exclamation-triangle', 'red', pht('Restarting'));
|
||||||
} else if ($build->isStopping()) {
|
} else if ($build->isStopping()) {
|
||||||
$header->setStatus('fa-exclamation-triangle', 'red', pht('Stopping'));
|
$header->setStatus('fa-exclamation-triangle', 'red', pht('Pausing'));
|
||||||
} else if ($build->isResuming()) {
|
} else if ($build->isResuming()) {
|
||||||
$header->setStatus('fa-exclamation-triangle', 'red', pht('Resuming'));
|
$header->setStatus('fa-exclamation-triangle', 'red', pht('Resuming'));
|
||||||
}
|
}
|
||||||
|
@ -355,26 +355,28 @@ final class HarbormasterBuildViewController
|
||||||
$list->addAction(
|
$list->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Restart Build'))
|
->setName(pht('Restart Build'))
|
||||||
->setIcon('fa-backward')
|
->setIcon('fa-repeat')
|
||||||
->setHref($this->getApplicationURI('/build/restart/'.$id.'/'))
|
->setHref($this->getApplicationURI('/build/restart/'.$id.'/'))
|
||||||
->setDisabled(!$can_restart)
|
->setDisabled(!$can_restart)
|
||||||
->setWorkflow(true));
|
->setWorkflow(true));
|
||||||
|
|
||||||
$list->addAction(
|
if ($build->canResumeBuild()) {
|
||||||
id(new PhabricatorActionView())
|
$list->addAction(
|
||||||
->setName(pht('Stop Build'))
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-stop')
|
->setName(pht('Resume Build'))
|
||||||
->setHref($this->getApplicationURI('/build/stop/'.$id.'/'))
|
->setIcon('fa-play')
|
||||||
->setDisabled(!$can_stop)
|
->setHref($this->getApplicationURI('/build/resume/'.$id.'/'))
|
||||||
->setWorkflow(true));
|
->setDisabled(!$can_resume)
|
||||||
|
->setWorkflow(true));
|
||||||
$list->addAction(
|
} else {
|
||||||
id(new PhabricatorActionView())
|
$list->addAction(
|
||||||
->setName(pht('Resume Build'))
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-play')
|
->setName(pht('Pause Build'))
|
||||||
->setHref($this->getApplicationURI('/build/resume/'.$id.'/'))
|
->setIcon('fa-pause')
|
||||||
->setDisabled(!$can_resume)
|
->setHref($this->getApplicationURI('/build/stop/'.$id.'/'))
|
||||||
->setWorkflow(true));
|
->setDisabled(!$can_stop)
|
||||||
|
->setWorkflow(true));
|
||||||
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
@ -419,7 +421,7 @@ final class HarbormasterBuildViewController
|
||||||
$item = new PHUIStatusItemView();
|
$item = new PHUIStatusItemView();
|
||||||
|
|
||||||
if ($build->isStopping()) {
|
if ($build->isStopping()) {
|
||||||
$status_name = pht('Stopping');
|
$status_name = pht('Pausing');
|
||||||
$icon = PHUIStatusItemView::ICON_RIGHT;
|
$icon = PHUIStatusItemView::ICON_RIGHT;
|
||||||
$color = 'dark';
|
$color = 'dark';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -110,7 +110,7 @@ final class HarbormasterBuildableViewController
|
||||||
|
|
||||||
$list->addAction(
|
$list->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-backward')
|
->setIcon('fa-repeat')
|
||||||
->setName(pht('Restart All Builds'))
|
->setName(pht('Restart All Builds'))
|
||||||
->setHref($this->getApplicationURI($restart_uri))
|
->setHref($this->getApplicationURI($restart_uri))
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
|
@ -118,8 +118,8 @@ final class HarbormasterBuildableViewController
|
||||||
|
|
||||||
$list->addAction(
|
$list->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-stop')
|
->setIcon('fa-pause')
|
||||||
->setName(pht('Stop All Builds'))
|
->setName(pht('Pause All Builds'))
|
||||||
->setHref($this->getApplicationURI($stop_uri))
|
->setHref($this->getApplicationURI($stop_uri))
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setDisabled(!$can_stop || !$can_edit));
|
->setDisabled(!$can_stop || !$can_edit));
|
||||||
|
@ -184,9 +184,9 @@ final class HarbormasterBuildableViewController
|
||||||
$item->addAttribute(HarbormasterBuild::getBuildStatusName($status));
|
$item->addAttribute(HarbormasterBuild::getBuildStatusName($status));
|
||||||
|
|
||||||
if ($build->isRestarting()) {
|
if ($build->isRestarting()) {
|
||||||
$item->addIcon('fa-backward', pht('Restarting'));
|
$item->addIcon('fa-repeat', pht('Restarting'));
|
||||||
} else if ($build->isStopping()) {
|
} else if ($build->isStopping()) {
|
||||||
$item->addIcon('fa-stop', pht('Stopping'));
|
$item->addIcon('fa-pause', pht('Pausing'));
|
||||||
} else if ($build->isResuming()) {
|
} else if ($build->isResuming()) {
|
||||||
$item->addIcon('fa-play', pht('Resuming'));
|
$item->addIcon('fa-play', pht('Resuming'));
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ final class HarbormasterBuildableViewController
|
||||||
|
|
||||||
$item->addAction(
|
$item->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
->setIcon('fa-backward')
|
->setIcon('fa-repeat')
|
||||||
->setName(pht('Restart'))
|
->setName(pht('Restart'))
|
||||||
->setHref($this->getApplicationURI($restart_uri))
|
->setHref($this->getApplicationURI($restart_uri))
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
|
@ -215,8 +215,8 @@ final class HarbormasterBuildableViewController
|
||||||
} else {
|
} else {
|
||||||
$item->addAction(
|
$item->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
->setIcon('fa-stop')
|
->setIcon('fa-pause')
|
||||||
->setName(pht('Stop'))
|
->setName(pht('Pause'))
|
||||||
->setHref($this->getApplicationURI($stop_uri))
|
->setHref($this->getApplicationURI($stop_uri))
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setDisabled(!$build->canStopBuild()));
|
->setDisabled(!$build->canStopBuild()));
|
||||||
|
@ -227,38 +227,11 @@ final class HarbormasterBuildableViewController
|
||||||
if ($targets) {
|
if ($targets) {
|
||||||
$target_list = id(new PHUIStatusListView());
|
$target_list = id(new PHUIStatusListView());
|
||||||
foreach ($targets as $target) {
|
foreach ($targets as $target) {
|
||||||
switch ($target->getTargetStatus()) {
|
$status = $target->getTargetStatus();
|
||||||
case HarbormasterBuildTarget::STATUS_PENDING:
|
$icon = HarbormasterBuildTarget::getBuildTargetStatusIcon($status);
|
||||||
$icon = PHUIStatusItemView::ICON_CLOCK;
|
$color = HarbormasterBuildTarget::getBuildTargetStatusColor($status);
|
||||||
$color = 'green';
|
$status_name =
|
||||||
$status_name = pht('Pending');
|
HarbormasterBuildTarget::getBuildTargetStatusName($status);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
$name = $target->getName();
|
$name = $target->getName();
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ final class HarbormasterBuild extends HarbormasterDAO
|
||||||
case self::STATUS_ERROR:
|
case self::STATUS_ERROR:
|
||||||
return pht('Unexpected Error');
|
return pht('Unexpected Error');
|
||||||
case self::STATUS_STOPPED:
|
case self::STATUS_STOPPED:
|
||||||
return pht('Stopped');
|
return pht('Paused');
|
||||||
case self::STATUS_DEADLOCKED:
|
case self::STATUS_DEADLOCKED:
|
||||||
return pht('Deadlocked');
|
return pht('Deadlocked');
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue