Implement ticket links and blocker state
This commit is contained in:
@@ -33,6 +33,7 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
|
||||
return [
|
||||
'acceptance_criteria' => ['nullable', 'string'],
|
||||
'blocked_comment' => ['nullable', 'string'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'field_values' => ['array'],
|
||||
'field_values.*' => ['array'],
|
||||
@@ -43,6 +44,7 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
],
|
||||
'field_values.*.value_number' => ['nullable', 'numeric'],
|
||||
'field_values.*.value_user_id' => ['nullable', 'integer', Rule::exists('users', 'id')],
|
||||
'is_blocked' => ['required', 'boolean'],
|
||||
'parent_ticket_id' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
@@ -116,6 +118,10 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
) {
|
||||
$validator->errors()->add('ticket_type_id', 'Tickets with child tickets must keep a Parent type.');
|
||||
}
|
||||
|
||||
if ($this->boolean('is_blocked') && blank($this->input('blocked_comment'))) {
|
||||
$validator->errors()->add('blocked_comment', 'Blocked tickets require a blocker comment.');
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -123,7 +129,9 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
/**
|
||||
* @return array{
|
||||
* acceptance_criteria: string|null,
|
||||
* blocked_comment: string|null,
|
||||
* description: string|null,
|
||||
* is_blocked: bool,
|
||||
* parent_ticket_id: int|null,
|
||||
* ticket_priority_id: int,
|
||||
* ticket_type_id: int,
|
||||
@@ -134,7 +142,9 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
{
|
||||
/** @var array{
|
||||
* acceptance_criteria: string|null,
|
||||
* blocked_comment: string|null,
|
||||
* description: string|null,
|
||||
* is_blocked: bool,
|
||||
* parent_ticket_id: int|null,
|
||||
* ticket_priority_id: int,
|
||||
* ticket_type_id: int,
|
||||
@@ -144,12 +154,16 @@ class UpdateProjectTicketRequest extends FormRequest
|
||||
$attributes = array_merge(
|
||||
[
|
||||
'acceptance_criteria' => null,
|
||||
'blocked_comment' => null,
|
||||
'description' => null,
|
||||
'is_blocked' => false,
|
||||
'parent_ticket_id' => null,
|
||||
],
|
||||
Arr::only($this->validated(), [
|
||||
'acceptance_criteria',
|
||||
'blocked_comment',
|
||||
'description',
|
||||
'is_blocked',
|
||||
'parent_ticket_id',
|
||||
'ticket_priority_id',
|
||||
'ticket_type_id',
|
||||
|
||||
Reference in New Issue
Block a user