fixed spell checker issue and alos git commit at ticket level

This commit is contained in:
Mark Gregory
2026-06-25 16:08:55 +01:00
parent 38feedd0aa
commit ecff30a0af
6 changed files with 49 additions and 42 deletions
+6 -3
View File
@@ -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')
@@ -68,7 +68,7 @@
<input id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text" maxlength="180" wire:model.defer="subject"
class="mt-2 block h-14 w-full max-w-4xl rounded-xl border border-zinc-700 bg-zinc-950 px-4 text-base font-medium text-zinc-100 shadow-sm outline-none transition-colors duration-150 placeholder:text-zinc-500 focus:border-blue-500 focus:bg-zinc-950 focus:ring-2 focus:ring-blue-500/40"
data-dusk="ticket-subject" dusk="ticket-subject" />
data-dusk="ticket-subject" dusk="ticket-subject" autocomplete="off" />
@error('subject')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@@ -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);
}
}
@@ -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');
+5 -16
View File
@@ -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.
+1 -1
View File
@@ -23,5 +23,5 @@
"Modules\\Helpdesk\\Providers\\HelpdeskServiceProvider"
],
"files": [],
"version": "1.10.29"
"version": "1.10.28"
}