new deployer command
This commit is contained in:
@@ -17,6 +17,8 @@ use Modules\Helpdesk\Models\Ticket;
|
||||
*/
|
||||
final class TicketFactory extends Factory
|
||||
{
|
||||
private const FACTORY_BODY = self::FACTORY_BODY;
|
||||
|
||||
/**
|
||||
* The model name for the factory.
|
||||
*
|
||||
@@ -74,9 +76,9 @@ final class TicketFactory extends Factory
|
||||
$put('reference', 'HD-' . now()->format('Y') . '-' . str_pad((string) $this->faker->unique()->numberBetween(1, 9999), 4, '0', STR_PAD_LEFT));
|
||||
$put('subject', 'Factory helpdesk ticket');
|
||||
$put('title', 'Factory helpdesk ticket');
|
||||
$put('body', '<p>Factory helpdesk ticket body.</p>');
|
||||
$put('details', '<p>Factory helpdesk ticket body.</p>');
|
||||
$put('description', '<p>Factory helpdesk ticket body.</p>');
|
||||
$put('body', self::FACTORY_BODY);
|
||||
$put('details', self::FACTORY_BODY);
|
||||
$put('description', self::FACTORY_BODY);
|
||||
$put('search_text', 'factory helpdesk ticket body');
|
||||
$put('last_activity_at', now());
|
||||
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Modules\Helpdesk\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class TicketPersistenceException extends RuntimeException
|
||||
{
|
||||
}
|
||||
final class TicketPersistenceException extends RuntimeException {}
|
||||
|
||||
@@ -17,6 +17,8 @@ use Modules\Helpdesk\Services\WorkflowNotificationService;
|
||||
|
||||
final class KanbanBoard extends Component
|
||||
{
|
||||
private const OWNER_RELATION = self::OWNER_RELATION;
|
||||
|
||||
public ?int $board_id = null;
|
||||
|
||||
public int $refreshNonce = 0;
|
||||
@@ -98,7 +100,7 @@ final class KanbanBoard extends Component
|
||||
public function moveTicketToBoard(int|string $ticketId, int|string|null $boardId, WorkflowNotificationService $workflow): void
|
||||
{
|
||||
$ticket = Ticket::query()->with('board')->visibleTo(Auth::user())->findOrFail((int) $ticketId);
|
||||
$board = KanbanBoardModel::query()->with(['statuses', 'owner:id,name,email'])->findOrFail((int) $boardId);
|
||||
$board = KanbanBoardModel::query()->with(['statuses', self::OWNER_RELATION])->findOrFail((int) $boardId);
|
||||
$oldBoardName = $ticket->board?->name ?? 'No board';
|
||||
|
||||
$this->authorize('update', $ticket);
|
||||
@@ -165,7 +167,7 @@ final class KanbanBoard extends Component
|
||||
public function render(): View
|
||||
{
|
||||
$boards = KanbanBoardModel::query()
|
||||
->with(['statuses', 'owner:id,name,email'])
|
||||
->with(['statuses', self::OWNER_RELATION])
|
||||
->orderBy('sort_order')
|
||||
->orderBy('name')
|
||||
->get();
|
||||
@@ -175,10 +177,10 @@ final class KanbanBoard extends Component
|
||||
|
||||
if ($board instanceof KanbanBoardModel && $board->statuses->isEmpty()) {
|
||||
$this->ensureBoardHasStatuses($board);
|
||||
$board->load(['statuses', 'owner:id,name,email']);
|
||||
$board->load(['statuses', self::OWNER_RELATION]);
|
||||
|
||||
$boards = KanbanBoardModel::query()
|
||||
->with(['statuses', 'owner:id,name,email'])
|
||||
->with(['statuses', self::OWNER_RELATION])
|
||||
->orderBy('sort_order')
|
||||
->orderBy('name')
|
||||
->get();
|
||||
@@ -205,7 +207,7 @@ final class KanbanBoard extends Component
|
||||
}
|
||||
|
||||
return Ticket::query()
|
||||
->with(['user:id,name,email', 'owner:id,name,email', 'agent:id,name,email', 'status', 'priority', 'category', 'project', 'team', 'product', 'tags', 'checklistItems', 'board'])
|
||||
->with(['user:id,name,email', self::OWNER_RELATION, 'agent:id,name,email', 'status', 'priority', 'category', 'project', 'team', 'product', 'tags', 'checklistItems', 'board'])
|
||||
->visibleTo(Auth::user())
|
||||
->where('board_id', $board->id)
|
||||
->latest('last_activity_at')
|
||||
|
||||
@@ -25,9 +25,7 @@ final class TicketPolicy
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
unset($user);
|
||||
|
||||
return true;
|
||||
return $user->exists;
|
||||
}
|
||||
|
||||
public function update(User $user, Ticket $ticket): bool
|
||||
|
||||
Reference in New Issue
Block a user