working ticket

This commit is contained in:
Mark Gregory
2026-06-16 13:11:27 +01:00
parent 6c5e2af806
commit 785529a0da
5 changed files with 16 additions and 17 deletions
+1 -2
View File
@@ -75,10 +75,9 @@ final class TicketCreate extends Component
/** /**
* Store a new helpdesk ticket. * Store a new helpdesk ticket.
*/ */
public function save(TicketService $tickets): mixed public function save(TicketService $tickets)
{ {
$this->validate(); $this->validate();
$this->validate([ $this->validate([
'attachments.*' => 'file|max:'.config('helpdesk.max_upload_kb').'|mimes:'.implode(',', config('helpdesk.allowed_mimes')), 'attachments.*' => 'file|max:'.config('helpdesk.max_upload_kb').'|mimes:'.implode(',', config('helpdesk.allowed_mimes')),
'tag_ids.*' => 'integer|exists:helpdesk_tags,id', 'tag_ids.*' => 'integer|exists:helpdesk_tags,id',
@@ -1,4 +1,5 @@
<div class="hd-helpdesk-surface space-y-6">
<style> <style>
.hd-helpdesk-surface .hd-btn, .hd-helpdesk-surface .hd-btn,
.hd-btn { .hd-btn {
@@ -135,8 +136,6 @@
transition: background-color 9999s ease-in-out 0s; transition: background-color 9999s ease-in-out 0s;
} }
</style> </style>
<div class="hd-helpdesk-surface space-y-6">
<style> <style>
.helpdesk-required-star { .helpdesk-required-star {
color: #ef4444 !important; color: #ef4444 !important;
@@ -107,24 +107,19 @@
}); });
} }
function bootHelpdeskSelects() { function bootHelpdeskSelects()
loadStyle('https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css'); {
const initialise = () => {
const bootSelect2 = function () { if (window.jQuery?.fn?.select2) {
if (window.jQuery && window.jQuery.fn && window.jQuery.fn.select2) {
initialiseHelpdeskSelects(); initialiseHelpdeskSelects();
return;
} }
loadScript('https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js', initialiseHelpdeskSelects);
}; };
if (window.jQuery) { if (document.readyState === 'loading') {
bootSelect2(); document.addEventListener('DOMContentLoaded', initialise);
return; } else {
initialise();
} }
loadScript('https://code.jquery.com/jquery-3.7.1.min.js', bootSelect2);
} }
document.addEventListener('DOMContentLoaded', bootHelpdeskSelects); document.addEventListener('DOMContentLoaded', bootHelpdeskSelects);
+1
View File
@@ -21,6 +21,7 @@
"jquery": "^4.0.0", "jquery": "^4.0.0",
"laravel-vite-plugin": "^3.1", "laravel-vite-plugin": "^3.1",
"sass-embedded": "^1.100.0", "sass-embedded": "^1.100.0",
"select2": "^4.1.0",
"sortablejs": "^1.15.7", "sortablejs": "^1.15.7",
"tailwindcss": "^4.0.7", "tailwindcss": "^4.0.7",
"vite": "^8.0.0" "vite": "^8.0.0"
+5
View File
@@ -5,8 +5,13 @@ import Chart from 'chart.js/auto';
import $ from 'jquery'; import $ from 'jquery';
window.$ = $; window.$ = $;
window.jQuery = $; window.jQuery = $;
import 'select2';
import 'select2/dist/css/select2.min.css';
const chartColours = [ const chartColours = [
'rgb(8, 145, 178)', 'rgb(8, 145, 178)',
'rgb(37, 99, 235)', 'rgb(37, 99, 235)',