@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+44 -69
+10 -10
src/applications/harbormaster/controller/HarbormasterBuildActionController.php
··· 93 93 break; 94 94 case HarbormasterBuildCommand::COMMAND_STOP: 95 95 if ($can_issue) { 96 - $title = pht('Really stop build?'); 96 + $title = pht('Really pause build?'); 97 97 $body = pht( 98 - 'If you stop this build, work will halt once the current steps '. 98 + 'If you pause this build, work will halt once the current steps '. 99 99 'complete. You can resume the build later.'); 100 - $submit = pht('Stop Build'); 100 + $submit = pht('Pause Build'); 101 101 } else { 102 - $title = pht('Unable to Stop Build'); 102 + $title = pht('Unable to Pause Build'); 103 103 if ($build->isComplete()) { 104 104 $body = pht( 105 - 'This build is already complete. You can not stop a completed '. 105 + 'This build is already complete. You can not pause a completed '. 106 106 'build.'); 107 107 } else if ($build->isStopped()) { 108 108 $body = pht( 109 - 'This build is already stopped. You can not stop a build which '. 110 - 'has already been stopped.'); 109 + 'This build is already paused. You can not pause a build which '. 110 + 'has already been paused.'); 111 111 } else if ($build->isStopping()) { 112 112 $body = pht( 113 - 'This build is already stopping. You can not reissue a stop '. 114 - 'command to a stopping build.'); 113 + 'This build is already pausing. You can not reissue a pause '. 114 + 'command to a pausing build.'); 115 115 } else { 116 116 $body = pht( 117 - 'This build can not be stopped.'); 117 + 'This build can not be paused.'); 118 118 } 119 119 } 120 120 break;
+20 -18
src/applications/harbormaster/controller/HarbormasterBuildViewController.php
··· 35 35 if ($build->isRestarting()) { 36 36 $header->setStatus('fa-exclamation-triangle', 'red', pht('Restarting')); 37 37 } else if ($build->isStopping()) { 38 - $header->setStatus('fa-exclamation-triangle', 'red', pht('Stopping')); 38 + $header->setStatus('fa-exclamation-triangle', 'red', pht('Pausing')); 39 39 } else if ($build->isResuming()) { 40 40 $header->setStatus('fa-exclamation-triangle', 'red', pht('Resuming')); 41 41 } ··· 355 355 $list->addAction( 356 356 id(new PhabricatorActionView()) 357 357 ->setName(pht('Restart Build')) 358 - ->setIcon('fa-backward') 358 + ->setIcon('fa-repeat') 359 359 ->setHref($this->getApplicationURI('/build/restart/'.$id.'/')) 360 360 ->setDisabled(!$can_restart) 361 361 ->setWorkflow(true)); 362 362 363 - $list->addAction( 364 - id(new PhabricatorActionView()) 365 - ->setName(pht('Stop Build')) 366 - ->setIcon('fa-stop') 367 - ->setHref($this->getApplicationURI('/build/stop/'.$id.'/')) 368 - ->setDisabled(!$can_stop) 369 - ->setWorkflow(true)); 370 - 371 - $list->addAction( 372 - id(new PhabricatorActionView()) 373 - ->setName(pht('Resume Build')) 374 - ->setIcon('fa-play') 375 - ->setHref($this->getApplicationURI('/build/resume/'.$id.'/')) 376 - ->setDisabled(!$can_resume) 377 - ->setWorkflow(true)); 363 + if ($build->canResumeBuild()) { 364 + $list->addAction( 365 + id(new PhabricatorActionView()) 366 + ->setName(pht('Resume Build')) 367 + ->setIcon('fa-play') 368 + ->setHref($this->getApplicationURI('/build/resume/'.$id.'/')) 369 + ->setDisabled(!$can_resume) 370 + ->setWorkflow(true)); 371 + } else { 372 + $list->addAction( 373 + id(new PhabricatorActionView()) 374 + ->setName(pht('Pause Build')) 375 + ->setIcon('fa-pause') 376 + ->setHref($this->getApplicationURI('/build/stop/'.$id.'/')) 377 + ->setDisabled(!$can_stop) 378 + ->setWorkflow(true)); 379 + } 378 380 379 381 return $list; 380 382 } ··· 419 421 $item = new PHUIStatusItemView(); 420 422 421 423 if ($build->isStopping()) { 422 - $status_name = pht('Stopping'); 424 + $status_name = pht('Pausing'); 423 425 $icon = PHUIStatusItemView::ICON_RIGHT; 424 426 $color = 'dark'; 425 427 } else {
+13 -40
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
··· 110 110 111 111 $list->addAction( 112 112 id(new PhabricatorActionView()) 113 - ->setIcon('fa-backward') 113 + ->setIcon('fa-repeat') 114 114 ->setName(pht('Restart All Builds')) 115 115 ->setHref($this->getApplicationURI($restart_uri)) 116 116 ->setWorkflow(true) ··· 118 118 119 119 $list->addAction( 120 120 id(new PhabricatorActionView()) 121 - ->setIcon('fa-stop') 122 - ->setName(pht('Stop All Builds')) 121 + ->setIcon('fa-pause') 122 + ->setName(pht('Pause All Builds')) 123 123 ->setHref($this->getApplicationURI($stop_uri)) 124 124 ->setWorkflow(true) 125 125 ->setDisabled(!$can_stop || !$can_edit)); ··· 184 184 $item->addAttribute(HarbormasterBuild::getBuildStatusName($status)); 185 185 186 186 if ($build->isRestarting()) { 187 - $item->addIcon('fa-backward', pht('Restarting')); 187 + $item->addIcon('fa-repeat', pht('Restarting')); 188 188 } else if ($build->isStopping()) { 189 - $item->addIcon('fa-stop', pht('Stopping')); 189 + $item->addIcon('fa-pause', pht('Pausing')); 190 190 } else if ($build->isResuming()) { 191 191 $item->addIcon('fa-play', pht('Resuming')); 192 192 } ··· 199 199 200 200 $item->addAction( 201 201 id(new PHUIListItemView()) 202 - ->setIcon('fa-backward') 202 + ->setIcon('fa-repeat') 203 203 ->setName(pht('Restart')) 204 204 ->setHref($this->getApplicationURI($restart_uri)) 205 205 ->setWorkflow(true) ··· 215 215 } else { 216 216 $item->addAction( 217 217 id(new PHUIListItemView()) 218 - ->setIcon('fa-stop') 219 - ->setName(pht('Stop')) 218 + ->setIcon('fa-pause') 219 + ->setName(pht('Pause')) 220 220 ->setHref($this->getApplicationURI($stop_uri)) 221 221 ->setWorkflow(true) 222 222 ->setDisabled(!$build->canStopBuild())); ··· 227 227 if ($targets) { 228 228 $target_list = id(new PHUIStatusListView()); 229 229 foreach ($targets as $target) { 230 - switch ($target->getTargetStatus()) { 231 - case HarbormasterBuildTarget::STATUS_PENDING: 232 - $icon = PHUIStatusItemView::ICON_CLOCK; 233 - $color = 'green'; 234 - $status_name = pht('Pending'); 235 - break; 236 - case HarbormasterBuildTarget::STATUS_BUILDING: 237 - $icon = PHUIStatusItemView::ICON_RIGHT; 238 - $color = 'green'; 239 - $status_name = pht('Building'); 240 - break; 241 - case HarbormasterBuildTarget::STATUS_WAITING: 242 - $icon = PHUIStatusItemView::ICON_CLOCK; 243 - $color = 'orange'; 244 - $status_name = pht('Waiting'); 245 - break; 246 - case HarbormasterBuildTarget::STATUS_PASSED: 247 - $icon = PHUIStatusItemView::ICON_ACCEPT; 248 - $color = 'green'; 249 - $status_name = pht('Passed'); 250 - break; 251 - case HarbormasterBuildTarget::STATUS_FAILED: 252 - $icon = PHUIStatusItemView::ICON_REJECT; 253 - $color = 'red'; 254 - $status_name = pht('Failed'); 255 - break; 256 - default: 257 - $icon = PHUIStatusItemView::ICON_QUESTION; 258 - $color = 'bluegrey'; 259 - $status_name = pht('Unknown'); 260 - break; 261 - } 230 + $status = $target->getTargetStatus(); 231 + $icon = HarbormasterBuildTarget::getBuildTargetStatusIcon($status); 232 + $color = HarbormasterBuildTarget::getBuildTargetStatusColor($status); 233 + $status_name = 234 + HarbormasterBuildTarget::getBuildTargetStatusName($status); 262 235 263 236 $name = $target->getName(); 264 237
+1 -1
src/applications/harbormaster/storage/build/HarbormasterBuild.php
··· 74 74 case self::STATUS_ERROR: 75 75 return pht('Unexpected Error'); 76 76 case self::STATUS_STOPPED: 77 - return pht('Stopped'); 77 + return pht('Paused'); 78 78 case self::STATUS_DEADLOCKED: 79 79 return pht('Deadlocked'); 80 80 default: