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
|
@ -2007,7 +2007,6 @@ phutil_register_library_map(array(
|
||||||
'ReleephRequestViewController' => 'applications/releeph/controller/request/ReleephRequestViewController.php',
|
'ReleephRequestViewController' => 'applications/releeph/controller/request/ReleephRequestViewController.php',
|
||||||
'ReleephRequestorFieldSpecification' => 'applications/releeph/field/specification/ReleephRequestorFieldSpecification.php',
|
'ReleephRequestorFieldSpecification' => 'applications/releeph/field/specification/ReleephRequestorFieldSpecification.php',
|
||||||
'ReleephRevisionFieldSpecification' => 'applications/releeph/field/specification/ReleephRevisionFieldSpecification.php',
|
'ReleephRevisionFieldSpecification' => 'applications/releeph/field/specification/ReleephRevisionFieldSpecification.php',
|
||||||
'ReleephRiskFieldSpecification' => 'applications/releeph/field/specification/ReleephRiskFieldSpecification.php',
|
|
||||||
'ReleephSeverityFieldSpecification' => 'applications/releeph/field/specification/ReleephSeverityFieldSpecification.php',
|
'ReleephSeverityFieldSpecification' => 'applications/releeph/field/specification/ReleephSeverityFieldSpecification.php',
|
||||||
'ReleephStatusFieldSpecification' => 'applications/releeph/field/specification/ReleephStatusFieldSpecification.php',
|
'ReleephStatusFieldSpecification' => 'applications/releeph/field/specification/ReleephStatusFieldSpecification.php',
|
||||||
'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php',
|
'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php',
|
||||||
|
@ -4201,7 +4200,6 @@ phutil_register_library_map(array(
|
||||||
'ReleephRequestViewController' => 'ReleephProjectController',
|
'ReleephRequestViewController' => 'ReleephProjectController',
|
||||||
'ReleephRequestorFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephRequestorFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephRevisionFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephRevisionFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephRiskFieldSpecification' => 'ReleephFieldSpecification',
|
|
||||||
'ReleephSeverityFieldSpecification' => 'ReleephLevelFieldSpecification',
|
'ReleephSeverityFieldSpecification' => 'ReleephLevelFieldSpecification',
|
||||||
'ReleephStatusFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephStatusFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephSummaryFieldSpecification' => '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