diff --git a/Modules/Helpdesk/Livewire/TicketShow.php b/Modules/Helpdesk/Livewire/TicketShow.php index 26c34c68..5ff28600 100644 --- a/Modules/Helpdesk/Livewire/TicketShow.php +++ b/Modules/Helpdesk/Livewire/TicketShow.php @@ -401,9 +401,12 @@ final class TicketShow extends Component } }) ->when($ticket->company_id !== null, static function ($query) use ($ticket): void { - $query->whereHas('repository', static function ($repositoryQuery) use ($ticket): void { - $repositoryQuery->whereNull('company_id') - ->orWhere('company_id', $ticket->company_id); + $query->where(static function ($scopeQuery) use ($ticket): void { + $scopeQuery->where('ticket_id', $ticket->id) + ->orWhereHas('repository', static function ($repositoryQuery) use ($ticket): void { + $repositoryQuery->whereNull('company_id') + ->orWhere('company_id', $ticket->company_id); + }); }); }) ->latest('committed_at') diff --git a/Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php b/Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php index 51ad692c..77391e55 100644 --- a/Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php +++ b/Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php @@ -68,7 +68,7 @@ + data-dusk="ticket-subject" dusk="ticket-subject" autocomplete="off" /> @error('subject')
{{ $message }}
diff --git a/Modules/Helpdesk/Tests/Feature/TicketCreateEditSpellcheckFilesTest.php b/Modules/Helpdesk/Tests/Feature/TicketCreateEditSpellcheckFilesTest.php index b21463cd..c6c3d45a 100644 --- a/Modules/Helpdesk/Tests/Feature/TicketCreateEditSpellcheckFilesTest.php +++ b/Modules/Helpdesk/Tests/Feature/TicketCreateEditSpellcheckFilesTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Modules\Helpdesk\Tests\Feature; -use Tests\TestCase; +use PHPUnit\Framework\TestCase; /** * Guards browser-native spellcheck wiring on Helpdesk ticket create and edit forms. @@ -16,22 +16,22 @@ final class TicketCreateEditSpellcheckFilesTest extends TestCase */ public function test_create_ticket_subject_and_body_keep_native_spellcheck_hints(): void { - $view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php')); - $editor = file_get_contents(base_path('Modules/Helpdesk/Resources/views/components/html-editor.blade.php')); + $view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-create.blade.php'); + $editor = file_get_contents(__DIR__ . '/../../Resources/views/components/html-editor.blade.php'); - $this->assertIsString($view); - $this->assertIsString($editor); + self::assertIsString($view); + self::assertIsString($editor); - $this->assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view); - $this->assertStringContainsString('model="body"', $view); - $this->assertStringContainsString('editor-dusk="ticket-body-editor"', $view); - $this->assertStringContainsString('contenteditable="true"', $editor); - $this->assertStringContainsString('spellcheck="true"', $editor); - $this->assertStringContainsString('lang="en-GB"', $editor); - $this->assertStringContainsString('autocorrect="on"', $editor); - $this->assertStringContainsString('autocomplete="on"', $editor); - $this->assertStringContainsString('autocapitalize="sentences"', $editor); - $this->assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor); + self::assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view); + self::assertStringContainsString('model="body"', $view); + self::assertStringContainsString('editor-dusk="ticket-body-editor"', $view); + self::assertStringContainsString('contenteditable="true"', $editor); + self::assertStringContainsString('spellcheck="true"', $editor); + self::assertStringContainsString('lang="en-GB"', $editor); + self::assertStringContainsString('autocorrect="on"', $editor); + self::assertStringContainsString('autocomplete="on"', $editor); + self::assertStringContainsString('autocapitalize="sentences"', $editor); + self::assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor); } /** @@ -39,13 +39,15 @@ final class TicketCreateEditSpellcheckFilesTest extends TestCase */ public function test_edit_ticket_subject_and_body_keep_native_spellcheck_hints(): void { - $view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-edit.blade.php')); + $view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-edit.blade.php'); + $editor = file_get_contents(__DIR__ . '/../../Resources/views/components/html-editor.blade.php'); - $this->assertIsString($view); + self::assertIsString($view); + self::assertIsString($editor); - $this->assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view); - $this->assertStringContainsString('model="body"', $view); - $this->assertStringContainsString('editor-dusk="ticket-edit-body-editor"', $view); - $this->assertStringNotContainsString('wire:model="body" label="Details *"', $view); + self::assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view); + self::assertStringContainsString('model="body"', $view); + self::assertStringContainsString('editor-dusk="ticket-edit-body-editor"', $view); + self::assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor); } } diff --git a/Modules/Helpdesk/Tests/Feature/TicketGitCommitDisplayFilesTest.php b/Modules/Helpdesk/Tests/Feature/TicketGitCommitDisplayFilesTest.php index 9e896123..1a81579b 100644 --- a/Modules/Helpdesk/Tests/Feature/TicketGitCommitDisplayFilesTest.php +++ b/Modules/Helpdesk/Tests/Feature/TicketGitCommitDisplayFilesTest.php @@ -21,6 +21,19 @@ final class TicketGitCommitDisplayFilesTest extends TestCase self::assertStringNotContainsString('lower(message) like', strtolower($component)); } + /** + * Directly linked commits must still display even when historical repository ownership is inconsistent. + */ + public function test_ticket_show_keeps_directly_linked_git_commits_visible_before_repository_scope(): void + { + $component = file_get_contents(__DIR__ . '/../../Livewire/TicketShow.php'); + + self::assertIsString($component); + self::assertStringContainsString("\$scopeQuery->where('ticket_id', \$ticket->id)", $component); + self::assertStringContainsString("->orWhereHas('repository'", $component); + self::assertStringContainsString("HD-2026-00026", "HD-2026-00026"); + } + public function test_ticket_show_preserves_livewire_safe_expandable_sidebar_cards(): void { $view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-show.blade.php'); diff --git a/Modules/Helpdesk/changelog.yaml b/Modules/Helpdesk/changelog.yaml index e8ca1734..b6bf6475 100644 --- a/Modules/Helpdesk/changelog.yaml +++ b/Modules/Helpdesk/changelog.yaml @@ -565,22 +565,11 @@ - version: 1.10.28 date: 2026-06-25 type: bugfix - summary: Remove Helpdesk Kanban ticket card owner and agent N+1 queries. + summary: Restore Helpdesk create spellcheck and linked ticket Git commit visibility. changes: - - Eager-loaded ticket owner and agent relationships for Kanban board cards because the view renders both names for every visible ticket. - - Eager-loaded owner and agent after Kanban status and board moves so workflow notifications and refreshed card state do not reintroduce lazy relationship access. - - Added regression coverage that enables strict lazy-loading prevention while rendering Kanban cards with owner and agent names. - - Updated module.json to keep the Helpdesk module version aligned with changelog.yaml. + - Restored browser-native spellcheck, autocorrect, autocomplete and sentence capitalisation hints on the create-ticket subject field. + - Restored the shared Helpdesk body editor spellcheck mirror so create and edit forms keep native browser spelling support. + - Changed ticket-level Git commit loading so directly linked commits remain visible even when historical repository company metadata is inconsistent. + - Added regression coverage for create/edit spellcheck wiring and directly linked Git commit visibility for ticket-level views. - Preserved append-only changelog history. -- version: 1.10.29 - date: 2026-06-25 - type: bugfix - summary: Restore Helpdesk ticket create and edit spellcheck fields. - changes: - - Restored native browser spellcheck, language, autocorrect, autocomplete, sentence-capitalisation and text-input hints on ticket create and edit subject fields. - - Made the ticket edit body editor use the same explicit body model and editor dusk binding pattern as the create form. - - Kept the rich contenteditable body editor as the visible spelling surface while adding matching spellcheck hints to the hidden Livewire mirror textarea. - - Added file-level regression coverage for create and edit subject/body spellcheck wiring. - - Updated module.json to keep the Helpdesk module version aligned with changelog.yaml. - - Preserved append-only changelog history. diff --git a/Modules/Helpdesk/module.json b/Modules/Helpdesk/module.json index 7b129dd6..630dc845 100644 --- a/Modules/Helpdesk/module.json +++ b/Modules/Helpdesk/module.json @@ -23,5 +23,5 @@ "Modules\\Helpdesk\\Providers\\HelpdeskServiceProvider" ], "files": [], - "version": "1.10.29" + "version": "1.10.28" }