mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Delete "Risk" field specification from Releeph
Summary: Ref T3718. This is not used and does not seem particularly useful. Test Plan: Grep. Reviewers: btrahan Reviewed By: btrahan CC: LegNeato, aran Maniphest Tasks: T3718 Differential Revision: https://secure.phabricator.com/D6755
This commit is contained in:
parent
8c3d1af627
commit
e3f3017b20
2 changed files with 0 additions and 69 deletions
|
@ -2007,7 +2007,6 @@ phutil_register_library_map(array(
|
|||
'ReleephRequestViewController' => 'applications/releeph/controller/request/ReleephRequestViewController.php',
|
||||
'ReleephRequestorFieldSpecification' => 'applications/releeph/field/specification/ReleephRequestorFieldSpecification.php',
|
||||
'ReleephRevisionFieldSpecification' => 'applications/releeph/field/specification/ReleephRevisionFieldSpecification.php',
|
||||
'ReleephRiskFieldSpecification' => 'applications/releeph/field/specification/ReleephRiskFieldSpecification.php',
|
||||
'ReleephSeverityFieldSpecification' => 'applications/releeph/field/specification/ReleephSeverityFieldSpecification.php',
|
||||
'ReleephStatusFieldSpecification' => 'applications/releeph/field/specification/ReleephStatusFieldSpecification.php',
|
||||
'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php',
|
||||
|
@ -4201,7 +4200,6 @@ phutil_register_library_map(array(
|
|||
'ReleephRequestViewController' => 'ReleephProjectController',
|
||||
'ReleephRequestorFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephRevisionFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephRiskFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephSeverityFieldSpecification' => 'ReleephLevelFieldSpecification',
|
||||
'ReleephStatusFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephSummaryFieldSpecification' => 'ReleephFieldSpecification',
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class ReleephRiskFieldSpecification
|
||||
extends ReleephFieldSpecification {
|
||||
|
||||
static $defaultRisks = array(
|
||||
'NONE' => 'Completely safe to pick this request.',
|
||||
'SOME' => 'There is some risk this could break things, but not much.',
|
||||
'HIGH' => 'This is pretty risky, but is also very important.',
|
||||
);
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'risk';
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return 'Riskiness';
|
||||
}
|
||||
|
||||
public function getStorageKey() {
|
||||
return 'risk';
|
||||
}
|
||||
|
||||
public function renderLabelForHeaderView() {
|
||||
return 'Riskiness';
|
||||
}
|
||||
|
||||
private $error = true;
|
||||
|
||||
public function renderReleephEditControl(AphrontRequest $request) {
|
||||
$value = $request->getStr('risk', $this->getValue());
|
||||
$buttons = id(new AphrontFormRadioButtonControl())
|
||||
->setLabel('Riskiness')
|
||||
->setName('risk')
|
||||
->setError($this->error)
|
||||
->setValue($value);
|
||||
foreach (self::$defaultRisks as $value => $description) {
|
||||
$buttons->addButton($value, $value, $description);
|
||||
}
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
public function validate($risk) {
|
||||
if (!$risk) {
|
||||
$this->error = 'Required';
|
||||
throw new ReleephFieldParseException(
|
||||
$this,
|
||||
"No risk was given, which probably means we've changed the set ".
|
||||
"of valid risks since you made this request. Please pick one.");
|
||||
}
|
||||
if (!idx(self::$defaultRisks, $risk)) {
|
||||
throw new ReleephFieldParseException(
|
||||
$this,
|
||||
"Unknown risk '{$risk}'.");
|
||||
}
|
||||
}
|
||||
|
||||
public function renderHelpForArcanist() {
|
||||
$help = '';
|
||||
foreach (self::$defaultRisks as $name => $description) {
|
||||
$help .= " **{$name}**\n";
|
||||
$help .= phutil_console_wrap($description."\n", 8);
|
||||
}
|
||||
return $help;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue