Repo rebuild

This commit is contained in:
Mark Gregory
2026-09-15 12:33:28 +01:00
commit be28c4feec
5629 changed files with 317074 additions and 0 deletions
@@ -0,0 +1,974 @@
.hd-helpdesk-surface .hd-btn,
.hd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5rem;
border-radius: .85rem;
padding: .62rem 1.05rem;
font-size: .875rem;
line-height: 1.25rem;
font-weight: 800;
color: #ffffff !important;
text-decoration: none !important;
border: 1px solid rgba(255,255,255,.14);
box-shadow: 0 12px 28px rgba(0,0,0,.22);
transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-helpdesk-surface .hd-btn:hover,
.hd-btn:hover {
transform: translateY(-1px);
box-shadow: 0 16px 34px rgba(0,0,0,.30);
}
.hd-helpdesk-surface .hd-btn-sm,
.hd-btn-sm {
border-radius: .65rem;
padding: .42rem .78rem;
font-size: .8125rem;
}
.hd-helpdesk-surface .hd-btn-blue,
.hd-btn-blue { background: #2563eb !important; }
.hd-helpdesk-surface .hd-btn-blue:hover,
.hd-btn-blue:hover { background: #1d4ed8 !important; }
.hd-helpdesk-surface .hd-btn-green,
.hd-btn-green { background: #16a34a !important; }
.hd-helpdesk-surface .hd-btn-green:hover,
.hd-btn-green:hover { background: #15803d !important; }
.hd-helpdesk-surface .hd-btn-amber,
.hd-btn-amber { background: #f59e0b !important; }
.hd-helpdesk-surface .hd-btn-amber:hover,
.hd-btn-amber:hover { background: #d97706 !important; }
.hd-helpdesk-surface .hd-btn-red,
.hd-btn-red { background: #dc2626 !important; }
.hd-helpdesk-surface .hd-btn-red:hover,
.hd-btn-red:hover { background: #b91c1c !important; }
.hd-helpdesk-surface .hd-btn-violet,
.hd-btn-violet { background: #7c3aed !important; }
.hd-helpdesk-surface .hd-btn-violet:hover,
.hd-btn-violet:hover { background: #6d28d9 !important; }
.hd-helpdesk-surface button[type="submit"],
.hd-helpdesk-surface button[data-flux-button][type="submit"] {
background: #16a34a !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="reset"],
.hd-helpdesk-surface button[wire\:target^="reset"] {
background: #f59e0b !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="edit"],
.hd-helpdesk-surface button[wire\:target^="edit"] {
background: #2563eb !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="delete"],
.hd-helpdesk-surface button[wire\:target^="delete"] {
background: #dc2626 !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-select {
width: 100%;
min-height: 3.35rem;
border-radius: 1rem;
border: 1px solid #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
padding: .78rem 3rem .78rem 1rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.24);
}
.hd-select:focus {
border-color: #60a5fa !important;
box-shadow: 0 0 0 3px rgba(96,165,250,.38), inset 0 1px 0 rgba(255,255,255,.05);
}
.helpdesk-ticket-form,
.helpdesk-ticket-form * {
-webkit-tap-highlight-color: transparent;
}
.helpdesk-ticket-form input,
.helpdesk-ticket-form textarea,
.helpdesk-ticket-form select,
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple,
.helpdesk-ticket-form .select2-container--default .select2-selection__rendered,
.helpdesk-ticket-form .select2-container--default .select2-selection__choice {
background: #09090b !important;
background-color: #09090b !important;
color: #f4f4f5 !important;
border-color: #3f3f46 !important;
caret-color: #f4f4f5 !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:disabled,
.helpdesk-ticket-form textarea:disabled,
.helpdesk-ticket-form select:disabled,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--single,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--multiple,
.helpdesk-ticket-form [disabled],
.helpdesk-ticket-form [aria-disabled="true"] {
background: #09090b !important;
background-color: #09090b !important;
color: #a1a1aa !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:-webkit-autofill,
.helpdesk-ticket-form input:-webkit-autofill:hover,
.helpdesk-ticket-form input:-webkit-autofill:focus,
.helpdesk-ticket-form textarea:-webkit-autofill,
.helpdesk-ticket-form textarea:-webkit-autofill:hover,
.helpdesk-ticket-form textarea:-webkit-autofill:focus,
.helpdesk-ticket-form select:-webkit-autofill,
.helpdesk-ticket-form select:-webkit-autofill:hover,
.helpdesk-ticket-form select:-webkit-autofill:focus {
-webkit-text-fill-color: #f4f4f5 !important;
box-shadow: 0 0 0 1000px #09090b inset !important;
transition: background-color 9999s ease-in-out 0s;
}
.hd-helpdesk-surface .hd-btn,
.hd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5rem;
border-radius: .85rem;
padding: .62rem 1.05rem;
font-size: .875rem;
line-height: 1.25rem;
font-weight: 800;
color: #fff !important;
text-decoration: none !important;
border: 1px solid rgba(255,255,255,.14);
box-shadow: 0 12px 28px rgba(0,0,0,.22);
transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-helpdesk-surface .hd-btn:hover,
.hd-btn:hover {
transform: translateY(-1px);
box-shadow: 0 16px 34px rgba(0,0,0,.30);
}
.hd-btn-sm {
border-radius: .65rem;
padding: .42rem .78rem;
font-size: .8125rem;
}
.hd-btn-blue { background: #2563eb !important; }
.hd-btn-blue:hover { background: #1d4ed8 !important; }
.hd-btn-green { background: #16a34a !important; }
.hd-btn-green:hover { background: #15803d !important; }
.hd-btn-amber { background: #f59e0b !important; }
.hd-btn-amber:hover { background: #d97706 !important; }
.hd-btn-red { background: #dc2626 !important; }
.hd-btn-red:hover { background: #b91c1c !important; }
.hd-btn-violet { background: #7c3aed !important; }
.hd-btn-violet:hover { background: #6d28d9 !important; }
.hd-helpdesk-surface button[type="submit"],
.hd-helpdesk-surface button[data-flux-button][type="submit"] {
background: #16a34a !important;
color: #fff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="reset"],
.hd-helpdesk-surface button[wire\:target^="reset"] {
background: #f59e0b !important;
color: #fff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="edit"],
.hd-helpdesk-surface button[wire\:target^="edit"] {
background: #2563eb !important;
color: #fff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="delete"],
.hd-helpdesk-surface button[wire\:target^="delete"] {
background: #dc2626 !important;
color: #fff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-select {
width: 100%;
min-height: 3.35rem;
border-radius: 1rem;
border: 1px solid #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
padding: .78rem 3rem .78rem 1rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.24);
}
.hd-select:focus {
border-color: #60a5fa !important;
box-shadow:
0 0 0 3px rgba(96,165,250,.38),
inset 0 1px 0 rgba(255,255,255,.05);
}
.helpdesk-required-star {
color: #ef4444 !important;
font-weight: 800;
}
.helpdesk-ticket-form,
.helpdesk-ticket-form * {
-webkit-tap-highlight-color: transparent;
}
.helpdesk-ticket-form input,
.helpdesk-ticket-form textarea,
.helpdesk-ticket-form select,
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple,
.helpdesk-ticket-form .select2-container--default .select2-selection__rendered,
.helpdesk-ticket-form .select2-container--default .select2-selection__choice {
background: #09090b !important;
color: #f4f4f5 !important;
border-color: #3f3f46 !important;
caret-color: #f4f4f5 !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:disabled,
.helpdesk-ticket-form textarea:disabled,
.helpdesk-ticket-form select:disabled,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--single,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--multiple {
background: #09090b !important;
color: #a1a1aa !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:-webkit-autofill,
.helpdesk-ticket-form input:-webkit-autofill:hover,
.helpdesk-ticket-form input:-webkit-autofill:focus,
.helpdesk-ticket-form textarea:-webkit-autofill,
.helpdesk-ticket-form textarea:-webkit-autofill:hover,
.helpdesk-ticket-form textarea:-webkit-autofill:focus,
.helpdesk-ticket-form select:-webkit-autofill,
.helpdesk-ticket-form select:-webkit-autofill:hover,
.helpdesk-ticket-form select:-webkit-autofill:focus {
-webkit-text-fill-color: #f4f4f5 !important;
box-shadow: 0 0 0 1000px #09090b inset !important;
transition: background-color 9999s ease-in-out 0s;
}
.select2-container--default .select2-selection--single {
position: relative;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
position: absolute !important;
top: 50% !important;
right: 2.25rem !important;
transform: translateY(-50%);
color: #f87171 !important;
font-weight: 800 !important;
z-index: 5;
}
/* Select2 base */
.helpdesk-ticket-form .select2-container {
width: 100% !important;
}
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple {
min-height: 3.35rem;
border-radius: 1rem;
border: 1px solid #d4d4d8 !important;
background: #ffffff !important;
color: #18181b !important;
box-shadow: 0 10px 22px rgba(24, 24, 27, .08);
}
.helpdesk-ticket-form .select2-container--default .select2-selection--single .select2-selection__rendered {
color: #18181b !important;
line-height: 3.25rem;
padding-left: 1rem;
padding-right: 2.75rem;
font-weight: 700;
}
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple {
align-items: center;
padding: .4rem .65rem;
}
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
border: 1px solid #2563eb !important;
border-radius: 9999px !important;
background: #dbeafe !important;
color: #1e3a8a !important;
font-weight: 700;
padding: .2rem .55rem;
}
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #dc2626 !important;
margin-right: .35rem;
}
.select2-dropdown {
border: 1px solid #d4d4d8 !important;
border-radius: .9rem !important;
background: #ffffff !important;
color: #18181b !important;
overflow: hidden;
box-shadow: 0 18px 42px rgba(24, 24, 27, .18);
}
.select2-search__field {
border: 1px solid #d4d4d8 !important;
border-radius: .7rem !important;
background: #ffffff !important;
color: #18181b !important;
}
.select2-container--default .select2-results__option {
color: #18181b !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background: #2563eb !important;
color: #ffffff !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
background: #e0f2fe !important;
color: #075985 !important;
}
/* Dark mode */
.dark .helpdesk-ticket-form .select2-container--default .select2-selection--single,
.dark .helpdesk-ticket-form .select2-container--default .select2-selection--multiple {
border-color: #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.24);
}
.dark .helpdesk-ticket-form .select2-container--default .select2-selection--single .select2-selection__rendered {
color: #f4f4f5 !important;
}
.dark .helpdesk-ticket-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
border-color: #60a5fa !important;
background: #1d4ed8 !important;
color: #ffffff !important;
}
.dark .select2-dropdown {
border-color: #3f3f46 !important;
background: #18181b !important;
color: #f4f4f5 !important;
box-shadow: 0 18px 42px rgba(0,0,0,.55);
}
.dark .select2-search__field {
border-color: #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
}
.dark .select2-container--default .select2-results__option {
color: #f4f4f5 !important;
}
.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
background: #2563eb !important;
color: #ffffff !important;
}
.dark .select2-container--default .select2-results__option[aria-selected="true"] {
background: #27272a !important;
color: #ffffff !important;
}
.select2-container--default .select2-results__option {
background: rgb(9 9 11);
color: rgb(244 244 245);
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
background: rgb(37 99 235) !important;
color: rgb(255 255 255) !important;
}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected {
background: rgb(30 64 175) !important;
color: rgb(255 255 255) !important;
}
.select2-dropdown {
border-color: rgb(63 63 70) !important;
background: rgb(9 9 11) !important;
}
.select2-container--default .select2-selection--single {
border: 1px solid rgb(63 63 70) !important;
background: rgb(9 9 11) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: rgb(244 244 245) !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: rgb(113 113 122) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: rgb(161 161 170) transparent transparent transparent !important;
}
.select2-container--default.select2-container--open .select2-selection--single {
border-color: rgb(59 130 246) !important;
box-shadow: 0 0 0 2px rgb(59 130 246 / 0.35);
}
.select2-container--default .select2-selection--multiple {
border: 1px solid rgb(63 63 70) !important;
background: rgb(9 9 11) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
border: 1px solid rgb(59 130 246 / 0.45) !important;
background: rgb(30 64 175 / 0.35) !important;
color: rgb(219 234 254) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: rgb(191 219 254) !important;
}
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
border-radius: 0.75rem !important;
}
.select2-dropdown {
overflow: hidden;
border-radius: 0.75rem !important;
}
.select2-container--open .select2-dropdown--below {
margin-top: 0.35rem;
border-radius: 0.75rem !important;
}
.select2-container--open .select2-dropdown--above {
margin-bottom: 0.35rem;
border-radius: 0.75rem !important;
}
.select2-container--default .select2-selection--single {
position: relative;
padding-right: 3.5rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
padding-right: 3.5rem;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
position: absolute;
right: 2rem;
top: 50%;
z-index: 3;
margin: 0;
transform: translateY(-50%);
color: rgb(161 161 170);
font-size: 1rem;
line-height: 1;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
color: rgb(248 113 113);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
right: 0.75rem;
}
.select2-container--default .select2-selection--single {
position: relative !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
padding-left: 0.75rem !important;
padding-right: 4.25rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
position: absolute !important;
right: 2.35rem !important;
top: 50% !important;
float: none !important;
margin: 0 !important;
transform: translateY(-50%) !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear span {
color: rgb(161 161 170) !important;
font-size: 1.1rem !important;
line-height: 1 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
right: 0.75rem !important;
}
.select2-container--default .select2-selection--single {
display: flex !important;
align-items: center !important;
position: relative !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
flex: 1 1 auto !important;
width: 100% !important;
padding-right: 4.5rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
position: absolute !important;
right: 2.25rem !important;
top: 50% !important;
z-index: 20 !important;
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
width: 1.25rem !important;
height: 1.25rem !important;
float: none !important;
margin: 0 !important;
padding: 0 !important;
transform: translateY(-50%) !important;
color: rgb(161 161 170) !important;
cursor: pointer !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
color: rgb(248 113 113) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
position: absolute !important;
right: 0.75rem !important;
top: 50% !important;
transform: translateY(-50%) !important;
}
/* Helpdesk Flatpickr date picker */
.flatpickr-calendar {
border: 1px solid rgb(63 63 70);
background: rgb(24 24 27);
color: rgb(244 244 245);
box-shadow: 0 20px 45px rgb(0 0 0 / 0.35);
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
border-bottom-color: rgb(24 24 27);
border-top-color: rgb(24 24 27);
}
.flatpickr-months,
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
background: rgb(24 24 27);
color: rgb(244 244 245);
}
.flatpickr-weekday,
span.flatpickr-weekday {
color: rgb(161 161 170);
}
.flatpickr-day {
color: rgb(228 228 231);
}
.flatpickr-day:hover,
.flatpickr-day:focus {
border-color: rgb(59 130 246);
background: rgb(39 39 42);
color: rgb(255 255 255);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
border-color: rgb(37 99 235);
background: rgb(37 99 235);
color: rgb(255 255 255);
}
.flatpickr-day.today {
border-color: rgb(34 197 94);
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
color: rgb(113 113 122);
}
.hd-helpdesk-surface .hd-btn,
.hd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5rem;
border-radius: .85rem;
padding: .62rem 1.05rem;
font-size: .875rem;
line-height: 1.25rem;
font-weight: 800;
font-size: .95rem;
color: #ffffff !important;
text-decoration: none !important;
border: 1px solid rgba(255,255,255,.14);
box-shadow: 0 12px 28px rgba(0,0,0,.22);
transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-helpdesk-surface .hd-btn:hover,
.hd-btn:hover {
transform: translateY(-1px);
box-shadow: 0 16px 34px rgba(0,0,0,.30);
}
.hd-helpdesk-surface .hd-btn-sm,
.hd-btn-sm {
border-radius: .65rem;
padding: .42rem .78rem;
font-size: .8125rem;
}
.hd-helpdesk-surface .hd-btn-blue,
.hd-btn-blue { background: #2563eb !important; }
.hd-helpdesk-surface .hd-btn-blue:hover,
.hd-btn-blue:hover { background: #1d4ed8 !important; }
.hd-helpdesk-surface .hd-btn-green,
.hd-btn-green { background: #16a34a !important; }
.hd-helpdesk-surface .hd-btn-green:hover,
.hd-btn-green:hover { background: #15803d !important; }
.hd-helpdesk-surface .hd-btn-amber,
.hd-btn-amber { background: #f59e0b !important; }
.hd-helpdesk-surface .hd-btn-amber:hover,
.hd-btn-amber:hover { background: #d97706 !important; }
.hd-helpdesk-surface .hd-btn-red,
.hd-btn-red { background: #dc2626 !important; }
.hd-helpdesk-surface .hd-btn-red:hover,
.hd-btn-red:hover { background: #b91c1c !important; }
.hd-helpdesk-surface .hd-btn-violet,
.hd-btn-violet { background: #7c3aed !important; }
.hd-helpdesk-surface .hd-btn-violet:hover,
.hd-btn-violet:hover { background: #6d28d9 !important; }
.hd-helpdesk-surface button[type="submit"],
.hd-helpdesk-surface button[data-flux-button][type="submit"] {
background: #16a34a !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="reset"],
.hd-helpdesk-surface button[wire\:target^="reset"] {
background: #f59e0b !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="edit"],
.hd-helpdesk-surface button[wire\:target^="edit"] {
background: #2563eb !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="delete"],
.hd-helpdesk-surface button[wire\:target^="delete"] {
background: #dc2626 !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-select-wrap {
position: relative;
width: 100%;
max-width: 18rem;
}
.hd-select-wrap::after {
position: absolute;
top: 50%;
right: 1rem;
width: .55rem;
height: .55rem;
content: "";
pointer-events: none;
border-right: 2px solid #93c5fd;
border-bottom: 2px solid #93c5fd;
transform: translateY(-65%) rotate(45deg);
}
.hd-select {
width: 100%;
min-height: 2.75rem;
appearance: none;
-webkit-appearance: none;
border-radius: .9rem;
border: 1px solid rgba(96, 165, 250, .38) !important;
background: linear-gradient(135deg, #030712 0%, #111827 54%, #0f172a 100%) !important;
color: #f8fafc !important;
padding: .62rem 2.45rem .62rem .9rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 30px rgba(2,6,23,.38);
}
.hd-select option {
background: #020617 !important;
color: #f8fafc !important;
}
.hd-select:focus {
border-color: #60a5fa !important;
box-shadow: 0 0 0 3px rgba(96,165,250,.38), inset 0 1px 0 rgba(255,255,255,.08), 0 14px 30px rgba(2,6,23,.38);
}
.hd-ticket-board-select-wrap {
position: relative;
max-width: 12.5rem;
}
.hd-ticket-board-select-wrap::after {
position: absolute;
top: 50%;
right: .7rem;
width: .45rem;
height: .45rem;
content: "";
pointer-events: none;
border-right: 2px solid #86efac;
border-bottom: 2px solid #86efac;
transform: translateY(-65%) rotate(45deg);
}
.hd-ticket-board-select {
width: 100%;
min-height: 2.35rem;
appearance: none;
-webkit-appearance: none;
border-radius: .85rem;
border: 1px solid rgba(34,197,94,.35) !important;
background: linear-gradient(135deg, #052e16 0%, #064e3b 100%) !important;
color: #ecfdf5 !important;
padding: .48rem 2rem .48rem .75rem;
font-size: .75rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 22px rgba(0,0,0,.26);
}
.hd-ticket-board-select option {
background: #052e16 !important;
color: #ecfdf5 !important;
}
.hd-ticket-board-select:focus {
border-color: #86efac !important;
box-shadow: 0 0 0 3px rgba(34,197,94,.28), inset 0 1px 0 rgba(255,255,255,.08);
}
.helpdesk-ticket-form,
.helpdesk-ticket-form * {
-webkit-tap-highlight-color: transparent;
}
.helpdesk-ticket-form input,
.helpdesk-ticket-form textarea,
.helpdesk-ticket-form select,
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple,
.helpdesk-ticket-form .select2-container--default .select2-selection__rendered,
.helpdesk-ticket-form .select2-container--default .select2-selection__choice {
background: #09090b !important;
background-color: #09090b !important;
color: #f4f4f5 !important;
border-color: #3f3f46 !important;
caret-color: #f4f4f5 !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:disabled,
.helpdesk-ticket-form textarea:disabled,
.helpdesk-ticket-form select:disabled,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--single,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--multiple,
.helpdesk-ticket-form [disabled],
.helpdesk-ticket-form [aria-disabled="true"] {
background: #09090b !important;
background-color: #09090b !important;
color: #a1a1aa !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:-webkit-autofill,
.helpdesk-ticket-form input:-webkit-autofill:hover,
.helpdesk-ticket-form input:-webkit-autofill:focus,
.helpdesk-ticket-form textarea:-webkit-autofill,
.helpdesk-ticket-form textarea:-webkit-autofill:hover,
.helpdesk-ticket-form textarea:-webkit-autofill:focus,
.helpdesk-ticket-form select:-webkit-autofill,
.helpdesk-ticket-form select:-webkit-autofill:hover,
.helpdesk-ticket-form select:-webkit-autofill:focus {
-webkit-text-fill-color: #f4f4f5 !important;
box-shadow: 0 0 0 1000px #09090b inset !important;
transition: background-color 9999s ease-in-out 0s;
}
.hd-helpdesk-surface .hd-btn,
.hd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5rem;
border-radius: .85rem;
padding: .62rem 1.05rem;
font-size: .875rem;
line-height: 1.25rem;
font-weight: 800;
color: #ffffff !important;
text-decoration: none !important;
border: 1px solid rgba(255,255,255,.14);
box-shadow: 0 12px 28px rgba(0,0,0,.22);
transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-helpdesk-surface .hd-btn:hover,
.hd-btn:hover {
transform: translateY(-1px);
box-shadow: 0 16px 34px rgba(0,0,0,.30);
}
.hd-helpdesk-surface .hd-btn-sm,
.hd-btn-sm {
border-radius: .65rem;
padding: .42rem .78rem;
font-size: .8125rem;
}
.hd-helpdesk-surface .hd-btn-blue,
.hd-btn-blue { background: #2563eb !important; }
.hd-helpdesk-surface .hd-btn-blue:hover,
.hd-btn-blue:hover { background: #1d4ed8 !important; }
.hd-helpdesk-surface .hd-btn-green,
.hd-btn-green { background: #16a34a !important; }
.hd-helpdesk-surface .hd-btn-green:hover,
.hd-btn-green:hover { background: #15803d !important; }
.hd-helpdesk-surface .hd-btn-amber,
.hd-btn-amber { background: #f59e0b !important; }
.hd-helpdesk-surface .hd-btn-amber:hover,
.hd-btn-amber:hover { background: #d97706 !important; }
.hd-helpdesk-surface .hd-btn-red,
.hd-btn-red { background: #dc2626 !important; }
.hd-helpdesk-surface .hd-btn-red:hover,
.hd-btn-red:hover { background: #b91c1c !important; }
.hd-helpdesk-surface .hd-btn-violet,
.hd-btn-violet { background: #7c3aed !important; }
.hd-helpdesk-surface .hd-btn-violet:hover,
.hd-btn-violet:hover { background: #6d28d9 !important; }
.hd-helpdesk-surface button[type="submit"],
.hd-helpdesk-surface button[data-flux-button][type="submit"] {
background: #16a34a !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="reset"],
.hd-helpdesk-surface button[wire\:target^="reset"] {
background: #f59e0b !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="edit"],
.hd-helpdesk-surface button[wire\:target^="edit"] {
background: #2563eb !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-helpdesk-surface button[wire\:click^="delete"],
.hd-helpdesk-surface button[wire\:target^="delete"] {
background: #dc2626 !important;
color: #ffffff !important;
border-color: rgba(255,255,255,.14) !important;
}
.hd-select {
width: 100%;
min-height: 3.35rem;
border-radius: 1rem;
border: 1px solid #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
padding: .78rem 3rem .78rem 1rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.24);
}
.hd-select:focus {
border-color: #60a5fa !important;
box-shadow: 0 0 0 3px rgba(96,165,250,.38), inset 0 1px 0 rgba(255,255,255,.05);
}
.helpdesk-ticket-form,
.helpdesk-ticket-form * {
-webkit-tap-highlight-color: transparent;
}
.helpdesk-ticket-form input,
.helpdesk-ticket-form textarea,
.helpdesk-ticket-form select,
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple,
.helpdesk-ticket-form .select2-container--default .select2-selection__rendered,
.helpdesk-ticket-form .select2-container--default .select2-selection__choice {
background: #09090b !important;
background-color: #09090b !important;
color: #f4f4f5 !important;
border-color: #3f3f46 !important;
caret-color: #f4f4f5 !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:disabled,
.helpdesk-ticket-form textarea:disabled,
.helpdesk-ticket-form select:disabled,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--single,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--multiple,
.helpdesk-ticket-form [disabled],
.helpdesk-ticket-form [aria-disabled="true"] {
background: #09090b !important;
background-color: #09090b !important;
color: #a1a1aa !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:-webkit-autofill,
.helpdesk-ticket-form input:-webkit-autofill:hover,
.helpdesk-ticket-form input:-webkit-autofill:focus,
.helpdesk-ticket-form textarea:-webkit-autofill,
.helpdesk-ticket-form textarea:-webkit-autofill:hover,
.helpdesk-ticket-form textarea:-webkit-autofill:focus,
.helpdesk-ticket-form select:-webkit-autofill,
.helpdesk-ticket-form select:-webkit-autofill:hover,
.helpdesk-ticket-form select:-webkit-autofill:focus {
-webkit-text-fill-color: #f4f4f5 !important;
box-shadow: 0 0 0 1000px #09090b inset !important;
transition: background-color 9999s ease-in-out 0s;
}
+131
View File
@@ -0,0 +1,131 @@
import './bootstrap';
import $ from 'jquery';
import select2 from 'select2/dist/js/select2.full.js';
import flatpickr from 'flatpickr';
import 'flatpickr/dist/flatpickr.css';
window.$ = $;
window.jQuery = $;
select2(window, $);
function livewireComponentFor(element) {
const componentRoot = element.closest('[wire\\:id]');
if (!componentRoot || ! window.Livewire) {
return null;
}
return window.Livewire.find(componentRoot.getAttribute('wire:id'));
}
function setLivewireProperty(element, model, value) {
const component = livewireComponentFor(element);
if (!component || !model) {
return;
}
component.set(model, value === '' ? null : value);
}
function initialiseHelpdeskSelects() {
$('[data-helpdesk-select2]').each(function () {
const select = this;
const $select = $(select);
const placeholder = $select.data('placeholder') || $select.find('option[value=""]').first().text() || 'Select option';
if ($select.hasClass('select2-hidden-accessible')) {
return;
}
if (!$select.find('option[value=""]').length) {
$select.prepend(new Option('', '', false, false));
}
$select.select2({
width: '100%',
allowClear: true,
placeholder,
});
$select.on('change.helpdesk-select2', function () {
setLivewireProperty(select, $select.data('wire-model'), $select.val());
});
});
}
function clearHelpdeskSelects(root = document) {
$(root).find('[data-helpdesk-select2]').each(function () {
const $select = $(this);
$select.val(null);
$select.trigger('change.select2');
$select.trigger('change.helpdesk-select2');
$select.trigger('change');
});
}
function initialiseHelpdeskDatePickers() {
document.querySelectorAll('[data-helpdesk-flatpickr]').forEach((input) => {
if (input._helpdeskFlatpickr) {
return;
}
input._helpdeskFlatpickr = flatpickr(input, {
allowInput: true,
altInput: true,
altFormat: 'd M Y',
dateFormat: 'Y-m-d',
disableMobile: false,
onChange: (_selectedDates, dateText) => {
setLivewireProperty(input, input.dataset.wireModel, dateText || null);
},
onClose: (_selectedDates, dateText) => {
setLivewireProperty(input, input.dataset.wireModel, dateText || null);
},
});
});
}
function clearHelpdeskDatePickers(root = document) {
root.querySelectorAll('[data-helpdesk-flatpickr]').forEach((input) => {
if (input._helpdeskFlatpickr) {
input._helpdeskFlatpickr.clear();
}
input.value = '';
setLivewireProperty(input, input.dataset.wireModel, null);
});
}
function initialiseHelpdeskFormControls() {
initialiseHelpdeskSelects();
initialiseHelpdeskDatePickers();
}
function clearHelpdeskFormControls() {
clearHelpdeskSelects();
clearHelpdeskDatePickers();
}
window.initialiseHelpdeskFormControls = initialiseHelpdeskFormControls;
window.clearHelpdeskFormControls = clearHelpdeskFormControls;
document.addEventListener('DOMContentLoaded', initialiseHelpdeskFormControls);
document.addEventListener('livewire:navigated', initialiseHelpdeskFormControls);
document.addEventListener('helpdesk-form-cleared', clearHelpdeskFormControls);
document.addEventListener('livewire:init', () => {
initialiseHelpdeskFormControls();
Livewire.hook('morphed', () => {
initialiseHelpdeskFormControls();
});
Livewire.on('helpdesk-form-cleared', () => {
clearHelpdeskFormControls();
});
});
console.info('Helpdesk module assets loaded');
+4
View File
@@ -0,0 +1,4 @@
import axios from 'axios';
window.axios = window.axios || axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
@@ -0,0 +1,3 @@
.helpdesk-module {
min-height: 100vh;
}
@@ -0,0 +1,75 @@
@php
$lines = preg_split('/\r\n|\r|\n/', $contents);
$attachmentId = data_get($attachment, 'id');
$attachmentName = (string) data_get($attachment, 'original_name', 'Attachment');
$attachmentSize = (int) data_get($attachment, 'size', 0);
$ticketId = data_get($attachment, 'ticket_id');
$downloadUrl = route('helpdesk.attachments.download', $attachmentId);
$backUrl = is_numeric($ticketId) ? route('helpdesk.tickets.show', ['ticket' => $ticketId]) : route('helpdesk.index');
@endphp
@extends('helpdesk::layouts.master')
@section('content')
<div class="min-h-screen bg-zinc-950 px-4 py-6 text-zinc-100 sm:px-6 lg:px-8">
<div class="mx-auto max-w-7xl space-y-4">
<header class="rounded-2xl border border-zinc-700 bg-zinc-900 p-5 shadow-sm">
<div class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div class="min-w-0">
<p class="text-xs font-black uppercase tracking-[0.18em] text-blue-300">Read-only source viewer</p>
<h1 class="mt-1 truncate text-2xl font-black text-white">{{ $attachmentName }}</h1>
<p class="mt-2 text-sm text-zinc-400">
Language: <span class="font-semibold text-zinc-200">{{ strtoupper($language) }}</span>
<span class="mx-2 text-zinc-600">•</span>
Size: <span class="font-semibold text-zinc-200">{{ Number::fileSize($attachmentSize) }}</span>
</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ $backUrl }}"
class="inline-flex items-center gap-2 rounded-xl bg-zinc-700 px-4 py-2 text-sm font-bold text-white hover:bg-zinc-600">
<i class="fa-solid fa-arrow-left" aria-hidden="true"></i>
Back to ticket
</a>
<a href="{{ route('helpdesk.index') }}"
class="inline-flex items-center gap-2 rounded-xl bg-blue-700 px-4 py-2 text-sm font-bold text-white hover:bg-blue-800">
<i class="fa-solid fa-gauge-high" aria-hidden="true"></i>
Dashboard
</a>
<a href="{{ $downloadUrl }}"
class="inline-flex items-center gap-2 rounded-xl bg-blue-600 px-4 py-2 text-sm font-bold text-white hover:bg-blue-700">
<i class="fa-solid fa-download" aria-hidden="true"></i>
Download
</a>
<button type="button" data-helpdesk-copy-source
class="inline-flex items-center gap-2 rounded-xl bg-green-600 px-4 py-2 text-sm font-bold text-white hover:bg-green-700">
<i class="fa-regular fa-copy" aria-hidden="true"></i>
Copy code
</button>
</div>
</div>
</header>
<section class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-950 shadow-sm">
<div class="overflow-auto">
<table class="min-w-full border-collapse font-mono text-xs leading-6">
<tbody>
@foreach ($lines as $index => $line)
<tr class="group hover:bg-zinc-900/80">
<td class="select-none border-r border-zinc-800 bg-zinc-900 px-4 text-right text-zinc-500">{{ $index + 1 }}</td>
<td class="whitespace-pre px-4 text-zinc-100"><code>{{ $line }}</code></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</section>
</div>
</div>
<script>
document.querySelector('[data-helpdesk-copy-source]')?.addEventListener('click', async () => {
await navigator.clipboard.writeText(@js($contents));
});
</script>
@endsection
@@ -0,0 +1,16 @@
@props([
'color' => 'gray',
'label' => null,
])
@php
$background = \Modules\Helpdesk\Support\Color::css($color);
$foreground = \Modules\Helpdesk\Support\Color::text($color);
@endphp
<span
{{ $attributes->class('inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold shadow-sm ring-1 ring-zinc-900/10') }}
style="background-color: {{ $background }}; color: {{ $foreground }};"
>
{{ $label ?? $slot }}
</span>
@@ -0,0 +1,74 @@
@props([
'label' => 'Badge colour',
'model',
'options' => [],
])
@php
$currentValue = data_get($this, $model, 'gray');
$currentHex = \Modules\Helpdesk\Support\Color::css($currentValue);
$currentText = \Modules\Helpdesk\Support\Color::text($currentValue);
$currentLabel = \Modules\Helpdesk\Support\Color::label($currentValue);
@endphp
<div {{ $attributes->class('rounded-xl border border-zinc-200 bg-white p-3 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/50') }}>
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end">
<div class="min-w-0 space-y-2">
<label class="block text-xs font-bold uppercase tracking-wide text-zinc-600 dark:text-zinc-300">
{{ $label }}
</label>
<div class="grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center">
<select
wire:model.live="{{ $model }}"
class="h-9 w-full rounded-lg border border-zinc-300 bg-white px-3 text-sm font-semibold text-zinc-900 shadow-sm outline-none transition-colors duration-150 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100"
>
@foreach ($options as $key => $option)
<option value="{{ $key }}" style="color: {{ $option['hex'] }};">
● {{ $option['name'] }} — {{ $option['hex'] }}
</option>
@endforeach
</select>
<span
class="inline-flex h-9 min-w-28 items-center justify-center rounded-lg px-3 text-xs font-bold shadow-sm ring-1 ring-zinc-900/10 dark:ring-white/10"
style="background-color: {{ $currentHex }}; color: {{ $currentText }};"
>
{{ $currentLabel }}
</span>
</div>
<div class="flex flex-wrap items-center gap-1.5" aria-label="Available Helpdesk colours">
@foreach ($options as $key => $option)
<button
type="button"
wire:click="$set('{{ $model }}', '{{ $key }}')"
title="{{ $option['name'] }} {{ $option['hex'] }}"
class="inline-flex h-6 w-6 items-center justify-center rounded-full border border-white/80 shadow-sm ring-1 ring-zinc-900/10 transition hover:scale-105 focus:outline-none focus:ring-2 focus:ring-blue-500/40 dark:ring-white/15"
style="background-color: {{ $option['hex'] }}"
>
<span class="sr-only">Use {{ $option['name'] }}</span>
</button>
@endforeach
</div>
</div>
<div class="grid grid-cols-[2.75rem_minmax(0,11rem)] items-center gap-2 lg:justify-end">
<input
type="color"
value="{{ $currentHex }}"
wire:change="$set('{{ $model }}', $event.target.value)"
class="h-9 w-11 cursor-pointer rounded-lg border border-zinc-300 bg-white p-1 shadow-sm dark:border-zinc-700 dark:bg-zinc-900"
aria-label="Choose a custom hex colour"
/>
<input
type="text"
wire:model.live.debounce.500ms="{{ $model }}"
class="h-9 w-full rounded-lg border border-zinc-300 bg-white px-3 text-xs font-semibold text-zinc-900 placeholder:text-zinc-400 shadow-sm outline-none transition-colors duration-150 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:placeholder:text-zinc-500"
placeholder="#ffffff"
aria-label="Custom hex colour"
/>
</div>
</div>
</div>
@@ -0,0 +1,21 @@
@props(['id', 'model', 'label' => null, 'required' => false, 'placeholder' => 'Select date'])
<div>
@if ($label)
<label class="block text-sm font-semibold text-zinc-200" for="{{ $id }}">
{{ $label }}
@if ($required)
<span class="helpdesk-required-star">*</span>
@endif
</label>
@endif
<div class="mt-2" wire:ignore>
<input id="{{ $id }}" type="text" value="{{ $attributes->get('value') }}" data-helpdesk-flatpickr
data-wire-model="{{ $model }}" placeholder="{{ $placeholder }}" autocomplete="off"
{{ $attributes->except('value')->merge([
'class' =>
'block w-full rounded-xl border border-zinc-700 bg-zinc-950 px-4 py-3 text-sm text-zinc-100 shadow-sm outline-none transition-colors duration-150 placeholder:text-zinc-500 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/40',
]) }} />
</div>
</div>
@@ -0,0 +1,143 @@
@props([
'model' => 'body',
'label' => 'Details',
'placeholder' => 'Describe the ticket, include steps to reproduce, expected result, actual result and any useful technical details.',
'rows' => 10,
'editorDusk' => null,
])
<div
class="space-y-2"
x-data="{
model: @js($model),
value: @entangle($model),
init() {
this.$nextTick(() => {
this.writeEditorValue(this.value || '');
});
},
writeEditorValue(value) {
if (!this.$refs.editor) {
return;
}
const nextValue = value || '';
const currentValue = this.$refs.editor.innerText || '';
if (document.activeElement === this.$refs.editor && currentValue !== '' && currentValue !== nextValue) {
return;
}
this.$refs.editor.textContent = nextValue;
},
syncToLivewire(live = true) {
this.value = this.$refs.editor?.innerText || '';
if (this.$refs.input) {
this.$refs.input.value = this.value;
}
this.$wire.set(this.model, this.value, live);
},
resetEditor() {
this.value = '';
this.writeEditorValue('');
this.syncToLivewire(true);
},
runCommand(command) {
this.$refs.editor?.focus();
document.execCommand(command, false, null);
this.syncToLivewire(true);
},
wrapBlock(tagName) {
this.$refs.editor?.focus();
document.execCommand('formatBlock', false, tagName);
this.syncToLivewire(true);
},
}"
x-on:helpdesk-editor-sync.window="if (! $event.detail?.model || $event.detail.model === @js($model)) syncToLivewire($event.detail?.live ?? true)"
x-on:helpdesk-editor-reset.window="if (! $event.detail?.model || $event.detail.model === @js($model)) resetEditor()"
>
<label for="{{ $model }}-editor" class="block text-sm font-semibold text-zinc-200">
{{ $label }}
</label>
<div class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-950 shadow-sm">
<div class="flex flex-wrap items-center gap-1.5 border-b border-zinc-700 bg-zinc-900/80 px-4 py-2 text-sm text-zinc-300" data-helpdesk-editor-toolbar>
<span class="mr-2 rounded-lg bg-zinc-800 px-2 py-1 text-xs font-black uppercase tracking-wide text-zinc-100">Spellcheck enabled</span>
<button type="button" x-on:click="runCommand('bold')" data-helpdesk-editor-command="bold"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Bold selected text">
B
</button>
<button type="button" x-on:click="runCommand('italic')" data-helpdesk-editor-command="italic"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black italic text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Italic selected text">
I
</button>
<button type="button" x-on:click="runCommand('underline')" data-helpdesk-editor-command="underline"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black underline text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Underline selected text">
U
</button>
<button type="button" x-on:click="runCommand('insertUnorderedList')" data-helpdesk-editor-command="insertUnorderedList"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
• List
</button>
<button type="button" x-on:click="runCommand('insertOrderedList')" data-helpdesk-editor-command="insertOrderedList"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
1. List
</button>
<button type="button" x-on:click="wrapBlock('blockquote')" data-helpdesk-editor-command="blockquote"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
Quote
</button>
<button type="button" x-on:click="wrapBlock('pre')" data-helpdesk-editor-command="pre"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
Code
</button>
</div>
<div
id="{{ $model }}-editor"
x-ref="editor"
contenteditable="true"
spellcheck="true"
lang="en-GB"
autocorrect="on"
autocomplete="on"
autocapitalize="sentences"
inputmode="text"
role="textbox"
aria-multiline="true"
data-placeholder="{{ $placeholder }}"
data-wire-model="{{ $model }}"
data-helpdesk-sync-target="{{ $model }}"
data-helpdesk-editor-model="{{ $model }}"
@if ($editorDusk) data-dusk="{{ $editorDusk }}" dusk="{{ $editorDusk }}" @endif
x-on:paste="syncToLivewire(false)"
x-on:blur="syncToLivewire(true)"
class="helpdesk-rich-editor block min-h-[14rem] w-full overflow-y-auto whitespace-pre-wrap break-words border-0 bg-zinc-950 px-5 py-4 text-base leading-7 text-zinc-100 outline-none transition placeholder:text-zinc-500 empty:before:pointer-events-none empty:before:text-zinc-500 empty:before:content-[attr(data-placeholder)] focus:ring-2 focus:ring-blue-500"
></div>
<textarea
x-ref="input"
wire:model.defer="{{ $model }}"
spellcheck="true"
lang="en-GB"
autocorrect="on"
autocomplete="on"
autocapitalize="sentences"
inputmode="text"
class="sr-only"
tabindex="-1"
aria-hidden="true"
data-helpdesk-spellcheck-mirror="{{ $model }}"
></textarea>
</div>
<p class="text-xs font-semibold text-zinc-400">
Browser spellcheck stays active in the native editable area. Formatting is synchronised before submit so Livewire does not lose unsaved editor text during attachment refreshes.
</p>
</div>
@@ -0,0 +1,9 @@
@props(['title' => null])
{{--
Helpdesk compatibility component.
Do not call <x-layouts.app> from here: when Laravel resolves this component path first,
that creates an infinite component loop. Delegate directly to the central WMS layout instead.
--}}
@include('layouts.app.sidebar')
@@ -0,0 +1,47 @@
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-3 py-2.5">Name</th>
<th class="px-3 py-2.5">Slug</th>
<th class="px-3 py-2.5">Colour</th>
<th class="px-3 py-2.5">Default</th>
<th class="px-3 py-2.5">Tickets</th>
<th class="px-3 py-2.5 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($items as $item)
<tr>
<td class="px-3 py-2.5 font-medium text-zinc-900 dark:text-zinc-100">{{ $item->name }}</td>
<td class="px-3 py-2.5 font-mono text-xs text-zinc-500">{{ $item->slug }}</td>
<td class="px-3 py-2.5">
<span class="inline-flex items-center gap-2 rounded-full border border-zinc-200 bg-white px-2.5 py-1 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<span class="h-3 w-3 rounded-full" style="background-color: {{ \Modules\Helpdesk\Support\Color::css($item->color) }}"></span>
{{ \Illuminate\Support\Str::of(\Modules\Helpdesk\Support\Color::normalise($item->color))->headline() }}
</span>
</td>
<td class="px-3 py-2.5">
<flux:badge color="{{ $item->is_default ?? false ? 'emerald' : 'zinc' }}">
{{ $item->is_default ?? false ? 'Default' : 'No' }}
</flux:badge>
</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->tickets_count ?? 0 }}</td>
<td class="px-3 py-2.5 text-right">
<div class="flex justify-end gap-1.5">
<button type="button" wire:click="{{ $edit }}({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-blue">Edit</button>
<button type="button" wire:click="{{ $delete }}({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-red">Delete</button>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-3 py-8 text-center text-zinc-500">No records yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@@ -0,0 +1,47 @@
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-3 py-2.5">Project</th>
<th class="px-3 py-2.5">Company</th>
<th class="px-3 py-2.5">Team</th>
<th class="px-3 py-2.5">Colour</th>
<th class="px-3 py-2.5">Default</th>
<th class="px-3 py-2.5">Tickets</th>
<th class="px-3 py-2.5 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($items as $item)
<tr>
<td class="px-3 py-2.5 font-medium text-zinc-900 dark:text-zinc-100">{{ $item->title }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->company?->name ?? 'Global' }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->team?->name ?? 'No team' }}</td>
<td class="px-3 py-2.5">
<span class="inline-flex items-center gap-2 rounded-full border border-zinc-200 bg-white px-2.5 py-1 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<span class="h-3 w-3 rounded-full" style="background-color: {{ \Modules\Helpdesk\Support\Color::css($item->color) }}"></span>
{{ \Illuminate\Support\Str::of(\Modules\Helpdesk\Support\Color::normalise($item->color))->headline() }}
</span>
</td>
<td class="px-3 py-2.5">
<flux:badge color="{{ $item->is_default ?? false ? 'emerald' : 'zinc' }}">
{{ $item->is_default ?? false ? 'Default' : 'No' }}</flux:badge>
</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->tickets_count ?? 0 }}</td>
<td class="px-3 py-2.5 text-right">
<div class="flex justify-end gap-1.5"><button type="button"
wire:click="editProject({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-blue">Edit</button><button type="button"
wire:click="deleteProject({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-red">Delete</button></div>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="px-3 py-8 text-center text-zinc-500">No projects yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@@ -0,0 +1,36 @@
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-3 py-2.5">Name</th>
<th class="px-3 py-2.5">Provider</th>
<th class="px-3 py-2.5">Project</th>
<th class="px-3 py-2.5">Commits</th>
<th class="px-3 py-2.5 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($items as $item)
<tr>
<td class="px-3 py-2.5 font-medium text-zinc-900 dark:text-zinc-100">{{ $item->name }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ strtoupper($item->provider) }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->project?->title ?? 'No project' }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->commits_count ?? 0 }}</td>
<td class="px-3 py-2.5 text-right">
<div class="flex justify-end gap-1.5"><button type="button"
wire:click="editRepository({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-blue">Edit</button><button type="button"
wire:click="deleteRepository({{ $item->id }})"
wire:confirm="Delete this repository?"
class="hd-btn hd-btn-sm hd-btn-red">Delete</button></div>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-3 py-8 text-center text-zinc-500">No repositories yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@@ -0,0 +1,33 @@
@props([
'title' => 'Settings',
'description' => '',
])
<section
{{ $attributes->merge([
'class' => 'overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm ring-1 ring-zinc-900/5 dark:border-zinc-700 dark:bg-zinc-900 dark:ring-white/10',
]) }}>
<div class="border-b border-zinc-200 bg-gradient-to-r from-slate-950 via-blue-950 to-slate-900 px-4 py-3 text-white dark:border-zinc-700">
<div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
<div class="min-w-0">
<p class="text-[10px] font-black uppercase tracking-[0.22em] text-blue-200">Configuration</p>
<h2 class="mt-0.5 text-base font-bold tracking-tight text-white">{{ $title }}</h2>
<p class="mt-1 max-w-3xl text-xs font-medium leading-5 text-blue-100/90 sm:text-sm">{{ $description }}</p>
</div>
<span class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-white/10 bg-white/10 text-blue-100 shadow-inner">
<i class="fa-solid fa-sliders text-xs" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="border-b border-zinc-200 bg-zinc-50 px-3 py-3 dark:border-zinc-800 dark:bg-zinc-950/45 sm:px-4">
<div class="mx-auto max-w-7xl rounded-xl border border-zinc-200 bg-white p-3 shadow-sm dark:border-zinc-700 dark:bg-zinc-900/90 sm:p-4 [&_input:not([type='checkbox']):not([type='radio']):not([type='color'])]:min-h-9 [&_textarea]:min-h-20 [&_textarea]:leading-6">
{{ $form }}
</div>
</div>
<div class="bg-white dark:bg-zinc-900">
{{ $slot }}
</div>
</section>
@@ -0,0 +1,45 @@
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-3 py-2.5">Team</th>
<th class="px-3 py-2.5">Company</th>
<th class="px-3 py-2.5">Colour</th>
<th class="px-3 py-2.5">Default</th>
<th class="px-3 py-2.5">Tickets</th>
<th class="px-3 py-2.5 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($items as $item)
<tr>
<td class="px-3 py-2.5 font-medium text-zinc-900 dark:text-zinc-100">{{ $item->name }}</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->company?->name ?? 'Global' }}</td>
<td class="px-3 py-2.5">
<span class="inline-flex items-center gap-2 rounded-full border border-zinc-200 bg-white px-2.5 py-1 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<span class="h-3 w-3 rounded-full" style="background-color: {{ \Modules\Helpdesk\Support\Color::css($item->color) }}"></span>
{{ \Illuminate\Support\Str::of(\Modules\Helpdesk\Support\Color::normalise($item->color))->headline() }}
</span>
</td>
<td class="px-3 py-2.5">
<flux:badge color="{{ $item->is_default ?? false ? 'emerald' : 'zinc' }}">
{{ $item->is_default ?? false ? 'Default' : 'No' }}</flux:badge>
</td>
<td class="px-3 py-2.5 text-zinc-500">{{ $item->tickets_count ?? 0 }}</td>
<td class="px-3 py-2.5 text-right">
<div class="flex justify-end gap-1.5"><button type="button"
wire:click="editTeam({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-blue">Edit</button><button type="button"
wire:click="deleteTeam({{ $item->id }})"
class="hd-btn hd-btn-sm hd-btn-red">Delete</button></div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-3 py-8 text-center text-zinc-500">No teams yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@@ -0,0 +1 @@
<livewire:helpdesk.dashboard-widget />
@@ -0,0 +1,267 @@
<style>
.hd-helpdesk-surface .hd-btn,
.hd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5rem;
border-radius: .65rem;
padding: .46rem .78rem;
font-size: .8125rem;
line-height: 1.25rem;
font-weight: 800;
color: #ffffff !important;
text-decoration: none !important;
border: 1px solid rgba(255, 255, 255, .14);
box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-helpdesk-surface .hd-btn:hover,
.hd-btn:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(0, 0, 0, .24);
}
.hd-helpdesk-surface .hd-btn-sm,
.hd-btn-sm {
border-radius: .55rem;
padding: .32rem .62rem;
font-size: .75rem;
}
.hd-helpdesk-surface .hd-btn-blue,
.hd-btn-blue {
background: #2563eb !important;
}
.hd-helpdesk-surface .hd-btn-blue:hover,
.hd-btn-blue:hover {
background: #1d4ed8 !important;
}
.hd-helpdesk-surface .hd-btn-green,
.hd-btn-green {
background: #16a34a !important;
}
.hd-helpdesk-surface .hd-btn-green:hover,
.hd-btn-green:hover {
background: #15803d !important;
}
.hd-helpdesk-surface .hd-btn-amber,
.hd-btn-amber {
background: #f59e0b !important;
}
.hd-helpdesk-surface .hd-btn-amber:hover,
.hd-btn-amber:hover {
background: #d97706 !important;
}
.hd-helpdesk-surface .hd-btn-red,
.hd-btn-red {
background: #dc2626 !important;
}
.hd-helpdesk-surface .hd-btn-red:hover,
.hd-btn-red:hover {
background: #b91c1c !important;
}
.hd-helpdesk-surface .hd-btn-violet,
.hd-btn-violet {
background: #7c3aed !important;
}
.hd-helpdesk-surface .hd-btn-violet:hover,
.hd-btn-violet:hover {
background: #6d28d9 !important;
}
.hd-helpdesk-surface button[type="submit"],
.hd-helpdesk-surface button[data-flux-button][type="submit"] {
background: #16a34a !important;
color: #ffffff !important;
border-color: rgba(255, 255, 255, .14) !important;
}
.hd-helpdesk-surface button[wire\:click^="reset"],
.hd-helpdesk-surface button[wire\:target^="reset"] {
background: #f59e0b !important;
color: #ffffff !important;
border-color: rgba(255, 255, 255, .14) !important;
}
.hd-helpdesk-surface button[wire\:click^="edit"],
.hd-helpdesk-surface button[wire\:target^="edit"] {
background: #2563eb !important;
color: #ffffff !important;
border-color: rgba(255, 255, 255, .14) !important;
}
.hd-helpdesk-surface button[wire\:click^="delete"],
.hd-helpdesk-surface button[wire\:target^="delete"] {
background: #dc2626 !important;
color: #ffffff !important;
border-color: rgba(255, 255, 255, .14) !important;
}
.hd-select {
width: 100%;
min-height: 3.35rem;
border-radius: 1rem;
border: 1px solid #3f3f46 !important;
background: #09090b !important;
color: #f4f4f5 !important;
padding: .78rem 3rem .78rem 1rem;
font-weight: 800;
outline: none;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 12px 26px rgba(0, 0, 0, .24);
}
.hd-select:focus {
border-color: #60a5fa !important;
box-shadow: 0 0 0 3px rgba(96, 165, 250, .38), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.helpdesk-ticket-form,
.helpdesk-ticket-form * {
-webkit-tap-highlight-color: transparent;
}
.helpdesk-ticket-form input,
.helpdesk-ticket-form textarea,
.helpdesk-ticket-form select,
.helpdesk-ticket-form .select2-container--default .select2-selection--single,
.helpdesk-ticket-form .select2-container--default .select2-selection--multiple,
.helpdesk-ticket-form .select2-container--default .select2-selection__rendered,
.helpdesk-ticket-form .select2-container--default .select2-selection__choice {
background: #09090b !important;
background-color: #09090b !important;
color: #f4f4f5 !important;
border-color: #3f3f46 !important;
caret-color: #f4f4f5 !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:disabled,
.helpdesk-ticket-form textarea:disabled,
.helpdesk-ticket-form select:disabled,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--single,
.helpdesk-ticket-form .select2-container--disabled .select2-selection--multiple,
.helpdesk-ticket-form [disabled],
.helpdesk-ticket-form [aria-disabled="true"] {
background: #09090b !important;
background-color: #09090b !important;
color: #a1a1aa !important;
opacity: 1 !important;
}
.helpdesk-ticket-form input:-webkit-autofill,
.helpdesk-ticket-form input:-webkit-autofill:hover,
.helpdesk-ticket-form input:-webkit-autofill:focus,
.helpdesk-ticket-form textarea:-webkit-autofill,
.helpdesk-ticket-form textarea:-webkit-autofill:hover,
.helpdesk-ticket-form textarea:-webkit-autofill:focus,
.helpdesk-ticket-form select:-webkit-autofill,
.helpdesk-ticket-form select:-webkit-autofill:hover,
.helpdesk-ticket-form select:-webkit-autofill:focus {
-webkit-text-fill-color: #f4f4f5 !important;
box-shadow: 0 0 0 1000px #09090b inset !important;
transition: background-color 9999s ease-in-out 0s;
}
</style>
<div class="hd-helpdesk-surface space-y-5">
<div class="overflow-hidden rounded-2xl border border-blue-400/20 bg-slate-950 shadow-sm ring-1 ring-white/5">
<div class="relative overflow-hidden bg-[radial-gradient(circle_at_78%_18%,rgba(37,99,235,0.28),transparent_34%),linear-gradient(135deg,#020617_0%,#07112d_48%,#111827_100%)] px-5 py-5 text-white sm:px-6">
<div class="grid items-center gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(26rem,34rem)]">
<div class="relative z-10 max-w-4xl">
<p class="text-[0.67rem] font-black uppercase tracking-[0.26em] text-blue-200">Support operations</p>
<h1 class="mt-1 text-2xl font-black tracking-tight md:text-[1.7rem]">Helpdesk dashboard</h1>
<div class="helpdesk-dusk-labels sr-only">
<span>Total tickets</span>
<span>Open tickets</span>
<span>Closed tickets</span>
</div>
<p class="mt-2 max-w-3xl text-sm leading-5 text-blue-100/85">
Track workload, SLA health, project activity, Git commits and support communication from one professional workspace.
</p>
<div class="mt-4 flex flex-wrap gap-2">
<a href="{{ route('helpdesk.tickets.create') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-green">
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span>New Ticket</span>
</a>
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-blue">
<i class="fa-solid fa-ticket" aria-hidden="true"></i>
<span>Active tickets</span>
</a>
<a href="{{ route('helpdesk.kanban') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-amber">
<i class="fa-solid fa-table-columns" aria-hidden="true"></i>
<span>Kanban</span>
</a>
<a href="{{ route('helpdesk.settings') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-violet">
<i class="fa-solid fa-gear" aria-hidden="true"></i>
<span>Settings</span>
</a>
</div>
</div>
<div class="relative hidden min-h-[8.5rem] lg:block" aria-hidden="true">
<div class="absolute inset-0 rounded-2xl bg-[radial-gradient(circle_at_30%_20%,rgba(59,130,246,0.22),transparent_36%),radial-gradient(circle_at_88%_76%,rgba(16,185,129,0.16),transparent_30%)]"></div>
<div class="relative h-full rounded-2xl border border-blue-300/15 bg-slate-950/70 p-4 shadow-2xl shadow-blue-950/30 backdrop-blur-sm">
<div class="flex items-start justify-between gap-4 border-b border-white/10 pb-3">
<div>
<p class="text-[0.62rem] font-black uppercase tracking-[0.24em] text-blue-200">Support workflow</p>
<p class="mt-0.5 text-[0.72rem] text-slate-400">Tickets, replies, files, commits and SLA</p>
</div>
<div class="flex shrink-0 gap-1.5 pt-1">
<span class="h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_12px_rgba(52,211,153,0.8)]"></span>
<span class="h-2 w-2 rounded-full bg-amber-400 shadow-[0_0_12px_rgba(251,191,36,0.8)]"></span>
<span class="h-2 w-2 rounded-full bg-rose-400 shadow-[0_0_12px_rgba(251,113,133,0.8)]"></span>
</div>
</div>
<div class="mt-3 grid grid-cols-4 items-stretch gap-2">
<div class="rounded-xl border border-blue-400/25 bg-blue-500/10 px-2 py-2 text-center">
<i class="fa-solid fa-ticket text-sm text-blue-300"></i>
<p class="mt-1 text-[0.58rem] font-black uppercase tracking-wide text-white">New</p>
</div>
<div class="rounded-xl border border-amber-400/25 bg-amber-500/10 px-2 py-2 text-center">
<i class="fa-solid fa-user-gear text-sm text-amber-300"></i>
<p class="mt-1 text-[0.58rem] font-black uppercase tracking-wide text-white">Assigned</p>
</div>
<div class="rounded-xl border border-violet-400/25 bg-violet-500/10 px-2 py-2 text-center">
<i class="fa-solid fa-comments text-sm text-violet-300"></i>
<p class="mt-1 text-[0.58rem] font-black uppercase tracking-wide text-white">Response</p>
</div>
<div class="rounded-xl border border-emerald-400/25 bg-emerald-500/10 px-2 py-2 text-center">
<i class="fa-solid fa-circle-check text-sm text-emerald-300"></i>
<p class="mt-1 text-[0.58rem] font-black uppercase tracking-wide text-white">Resolved</p>
</div>
</div>
<div class="mt-2 grid grid-cols-3 gap-2">
<div class="rounded-lg border border-white/10 bg-slate-900/65 px-2 py-1.5 text-[0.62rem] font-bold text-slate-200">
<i class="fa-solid fa-paperclip mr-1 text-blue-300"></i> Attachments
</div>
<div class="rounded-lg border border-white/10 bg-slate-900/65 px-2 py-1.5 text-[0.62rem] font-bold text-slate-200">
<i class="fa-solid fa-code-branch mr-1 text-violet-300"></i> Commits
</div>
<div class="rounded-lg border border-white/10 bg-slate-900/65 px-2 py-1.5 text-[0.62rem] font-bold text-slate-200">
<i class="fa-solid fa-stopwatch mr-1 text-emerald-300"></i> SLA
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<livewire:helpdesk.dashboard-widget />
</div>
@@ -0,0 +1,3 @@
@include('layouts.app.sidebar')
@livewireScripts
@fluxScripts
@@ -0,0 +1,4 @@
<x-layouts.app :title="$title ?? __('Helpdesk')">
{{ $slot ?? '' }}
@yield('content')
</x-layouts.app>
@@ -0,0 +1,103 @@
@php
$user = auth()->user();
$dashboardRoute =
Route::has('platform.dashboard') && method_exists($user, 'isMpbaPlatformAdmin') && $user?->isMpbaPlatformAdmin()
? 'platform.dashboard'
: (Route::has('dashboard')
? 'dashboard'
: null);
@endphp
<header class="sticky top-0 z-40 border-b border-white/10 bg-[#111118]/95 backdrop-blur" role="banner">
<div class="flex h-16 items-center justify-between px-4 lg:px-6">
<div class="flex min-w-0 items-center gap-3">
<button type="button"
class="inline-flex h-10 w-10 items-center justify-center rounded-xl border border-white/10 bg-white/5 text-white lg:hidden"
data-wms-mobile-open aria-label="{{ __('Open navigation menu') }}" aria-controls="wms-main-sidebar"
aria-expanded="false">
<i class="fa-solid fa-bars" aria-hidden="true"></i>
</button>
<a href="{{ $dashboardRoute ? route($dashboardRoute) : '#' }}" wire:navigate
class="flex min-w-0 items-center gap-3" aria-label="{{ __('Warehouse Management System') }}">
<span
class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-cyan-600 text-sm font-bold text-white shadow-lg shadow-cyan-950/40">
W
</span>
<span class="min-w-0">
<span class="block truncate text-sm font-semibold text-white sm:text-base">
{{ __('Warehouse Management System') }}
</span>
<span class="block text-xs font-semibold uppercase tracking-wide text-cyan-400">
MPBA
</span>
</span>
</a>
</div>
<div class="relative flex shrink-0 items-center gap-3" x-data="{ open: false }"
x-on:keydown.escape.window="open = false">
<button type="button"
class="flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-3 py-2 text-left transition hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2 focus:ring-offset-[#111118]"
x-on:click="open = ! open" x-bind:aria-expanded="open.toString()" aria-haspopup="menu"
data-test="top-user-menu-button">
<span class="hidden text-right sm:block">
<span class="block text-sm font-semibold text-white">{{ $user?->name ?? __('User') }}</span>
<span class="block text-xs text-white/50">{{ $user?->email ?? '' }}</span>
</span>
<span
class="flex h-10 w-10 items-center justify-center rounded-full bg-blue-700 text-xs font-bold text-white shadow-lg shadow-blue-950/40">
{{ $user?->initials() ?? 'U' }}
</span>
<i class="fa-solid fa-chevron-down hidden text-white/50 sm:block" aria-hidden="true"></i>
</button>
<div x-cloak x-show="open" x-transition.origin.top.right x-on:click.outside="open = false"
class="absolute right-0 top-full mt-2 w-72 overflow-hidden rounded-2xl border border-white/10 bg-[#181820] shadow-2xl shadow-black/40"
role="menu">
<div class="border-b border-white/10 px-4 py-3">
<div class="text-sm font-semibold text-white">{{ $user?->name ?? __('User') }}</div>
<div class="truncate text-xs text-white/50">{{ $user?->email ?? '' }}</div>
</div>
<div class="p-2">
@if ($dashboardRoute)
<a href="{{ route($dashboardRoute) }}" wire:navigate
class="block rounded-xl px-3 py-2 text-sm text-white/80 hover:bg-white/10 hover:text-white"
role="menuitem">
{{ __('Dashboard') }}
</a>
@endif
@if (Route::has('profile.edit'))
<a href="{{ route('profile.edit') }}" wire:navigate
class="block rounded-xl px-3 py-2 text-sm text-white/80 hover:bg-white/10 hover:text-white"
role="menuitem">
{{ __('Profile') }}
</a>
@endif
@if (Route::has('settings.index'))
<a href="{{ route('settings.index') }}" wire:navigate
class="block rounded-xl px-3 py-2 text-sm text-white/80 hover:bg-white/10 hover:text-white"
role="menuitem">
{{ __('Settings') }}
</a>
@endif
<form method="POST" action="{{ route('logout') }}" class="mt-2 border-t border-white/10 pt-2">
@csrf
<button type="submit"
class="w-full rounded-xl px-3 py-2 text-left text-sm text-red-300 hover:bg-red-500/10 hover:text-red-200"
role="menuitem" data-test="logout-button">
{{ __('Sign out') }}
</button>
</form>
</div>
</div>
</div>
</div>
</header>
@@ -0,0 +1,196 @@
<div class="space-y-5" dusk="helpdesk-dashboard-widget">
<span class="sr-only">Total tickets Open tickets Closed tickets</span>
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
<div class="rounded-2xl border border-blue-400/20 bg-gradient-to-br from-slate-950 to-blue-950/40 p-4 shadow-sm ring-1 ring-white/5">
<div class="flex items-center justify-between gap-3">
<div>
<div class="text-xs font-black uppercase tracking-[0.18em] text-blue-200/80">Total tickets</div>
<div class="mt-2 text-3xl font-black text-white">{{ $totalCount }}</div>
</div>
<div class="flex h-11 w-11 items-center justify-center rounded-xl bg-blue-500/20 text-blue-200 ring-1 ring-blue-300/20">
<i class="fa-solid fa-ticket" aria-hidden="true"></i>
</div>
</div>
<div class="mt-4 h-1.5 rounded-full bg-slate-800">
<div class="h-1.5 rounded-full bg-blue-400" style="width: 100%"></div>
</div>
</div>
<div class="rounded-2xl border border-blue-400/20 bg-gradient-to-br from-slate-950 to-blue-950/40 p-4 shadow-sm ring-1 ring-white/5">
<div class="flex items-center justify-between gap-3">
<div>
<div class="text-xs font-black uppercase tracking-[0.18em] text-blue-200/80">Open tickets</div>
<div class="mt-2 text-3xl font-black text-blue-200">{{ $openCount }}</div>
</div>
<div class="flex h-11 w-11 items-center justify-center rounded-xl bg-blue-500/20 text-blue-200 ring-1 ring-blue-300/20">
<i class="fa-solid fa-inbox" aria-hidden="true"></i>
</div>
</div>
<div class="mt-4 h-1.5 rounded-full bg-slate-800">
<div class="h-1.5 rounded-full bg-blue-400" style="width: {{ $openPercent }}%"></div>
</div>
</div>
<div class="rounded-2xl border border-emerald-400/20 bg-gradient-to-br from-slate-950 to-emerald-950/30 p-4 shadow-sm ring-1 ring-white/5">
<div class="flex items-center justify-between gap-3">
<div>
<div class="text-xs font-black uppercase tracking-[0.18em] text-emerald-200/80">Closed tickets</div>
<div class="mt-2 text-3xl font-black text-emerald-200">{{ $closedCount }}</div>
</div>
<div class="flex h-11 w-11 items-center justify-center rounded-xl bg-emerald-500/20 text-emerald-200 ring-1 ring-emerald-300/20">
<i class="fa-solid fa-circle-check" aria-hidden="true"></i>
</div>
</div>
<div class="mt-4 h-1.5 rounded-full bg-slate-800">
<div class="h-1.5 rounded-full bg-emerald-400" style="width: {{ $closedPercent }}%"></div>
</div>
</div>
<div class="rounded-2xl border border-rose-400/20 bg-gradient-to-br from-slate-950 to-rose-950/25 p-4 shadow-sm ring-1 ring-white/5">
<div class="flex items-center justify-between gap-3">
<div>
<div class="text-xs font-black uppercase tracking-[0.18em] text-rose-200/80">High priority</div>
<div class="mt-2 text-3xl font-black text-rose-200">{{ $criticalCount }}</div>
</div>
<div class="flex h-11 w-11 items-center justify-center rounded-xl bg-rose-500/20 text-rose-200 ring-1 ring-rose-300/20">
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
</div>
</div>
<div class="mt-4 text-xs font-semibold text-slate-400">Open urgent/high/critical workload.</div>
</div>
</div>
<div class="grid gap-5 xl:grid-cols-[minmax(0,2fr)_minmax(22rem,1fr)]">
<div class="rounded-2xl border border-zinc-700 bg-gradient-to-br from-slate-950 via-slate-950 to-blue-950/20 shadow-sm ring-1 ring-white/5">
<div class="flex items-center justify-between border-b border-white/10 px-5 py-4">
<div class="flex items-center gap-3">
<span class="flex h-10 w-10 items-center justify-center rounded-xl bg-blue-500/15 text-blue-200 ring-1 ring-blue-300/20">
<i class="fa-solid fa-list-check" aria-hidden="true"></i>
</span>
<div>
<h2 class="text-lg font-black text-white">Recent tickets</h2>
<p class="text-sm text-slate-400">Latest support activity.</p>
</div>
</div>
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-blue">View all tickets</a>
</div>
{{-- Recent Tickets --}}
<div class="divide-y divide-white/10">
@forelse ($recentTickets as $ticket)
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate
class="flex flex-nowrap items-center gap-4 px-5 py-4 transition hover:bg-blue-500/10">
<div class="flex w-36 shrink-0 items-center gap-3 text-sm font-semibold text-slate-300">
<span class="h-2 w-2 shrink-0 rounded-full bg-blue-400"></span>
<span class="whitespace-nowrap">{{ $ticket->reference }}</span>
</div>
<div class="min-w-0 flex-1">
<div class="truncate font-black text-white">{{ $ticket->subject }}</div>
<div class="mt-1 truncate text-xs text-slate-400">
{{ optional($ticket->last_activity_at)->format('d M Y H:i') ?? 'No activity yet' }}
</div>
</div>
<div class="w-28 shrink-0">
<x-helpdesk::colour-badge :color="$ticket->status?->color ?? 'zinc'">
{{ $ticket->status?->name ?? 'No status' }}
</x-helpdesk::colour-badge>
</div>
<div class="w-28 shrink-0">
<x-helpdesk::colour-badge :color="$ticket->priority?->color ?? 'zinc'">
{{ $ticket->priority?->name ?? 'No priority' }}
</x-helpdesk::colour-badge>
</div>
<div class="w-28 shrink-0 whitespace-nowrap text-right text-sm font-semibold text-slate-400">
{{ optional($ticket->last_activity_at)->diffForHumans() ?? 'No activity' }}
</div>
</a>
@empty
<div class="px-5 py-8 text-center text-sm text-slate-400">No helpdesk tickets yet.</div>
@endforelse
</div>
{{-- Recent Tickets End--}}
</div>
<div class="space-y-5">
<div class="rounded-2xl border border-zinc-700 bg-gradient-to-br from-slate-950 to-slate-900 p-5 shadow-sm ring-1 ring-white/5">
<div class="mb-5 flex items-center justify-between">
<div>
<h2 class="text-lg font-black text-white">SLA overview</h2>
<p class="text-sm text-slate-400">Closure rate and open workload.</p>
</div>
<span class="rounded-xl bg-emerald-500/15 px-3 py-1.5 text-sm font-black text-emerald-200 ring-1 ring-emerald-300/20">{{ $closedPercent }}% closed</span>
</div>
<div class="grid gap-5 sm:grid-cols-[9rem_minmax(0,1fr)] sm:items-center">
<div class="relative mx-auto flex h-32 w-32 items-center justify-center rounded-full bg-slate-900 ring-8 ring-emerald-400/20">
<div class="absolute inset-2 rounded-full border-8 border-emerald-400" style="clip-path: polygon(0 0, {{ max($closedPercent, 8) }}% 0, {{ max($closedPercent, 8) }}% 100%, 0 100%);"></div>
<div class="relative text-center">
<div class="text-3xl font-black text-white">{{ $closedPercent }}%</div>
<div class="text-xs font-bold text-slate-400">closed</div>
</div>
</div>
<div class="space-y-4">
<div>
<div class="mb-2 flex justify-between text-sm font-semibold text-slate-300"><span>Closed</span><span>{{ $closedPercent }}%</span></div>
<div class="h-2 rounded-full bg-slate-800"><div class="h-2 rounded-full bg-emerald-400" style="width: {{ $closedPercent }}%"></div></div>
</div>
<div>
<div class="mb-2 flex justify-between text-sm font-semibold text-slate-300"><span>Open</span><span>{{ $openPercent }}%</span></div>
<div class="h-2 rounded-full bg-slate-800"><div class="h-2 rounded-full bg-blue-400" style="width: {{ $openPercent }}%"></div></div>
</div>
</div>
</div>
</div>
<details
class="group rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900"
dusk="recent-commits-card">
<summary
class="-mx-4 -mt-4 mb-4 flex cursor-pointer list-none items-center justify-between gap-3 rounded-t-xl bg-violet-700 px-4 py-4 text-white marker:hidden">
<div class="flex min-w-0 items-center gap-3">
<span
class="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-violet-950 text-white ring-1 ring-violet-300/60 shadow-lg">
<i class="fa-solid fa-code-branch text-lg" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h2 class="text-lg font-black uppercase tracking-wide">Recent commits</h2>
<p class="text-xs font-semibold text-violet-100">Latest linked Git activity</p>
</div>
</div>
<span
class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-white/15 text-white ring-1 ring-white/20">
<i class="fa-solid fa-chevron-right text-xs transition group-open:rotate-90" aria-hidden="true"></i>
</span>
</summary>
<div class="mb-4 flex justify-end">
<a href="{{ route('helpdesk.settings') }}" wire:navigate class="hd-btn hd-btn-sm hd-btn-violet">
Git setup
</a>
</div>
<div class="space-y-2">
@forelse ($recentCommits as $commit)
<div class="rounded-xl border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-700 dark:bg-zinc-950">
<div class="font-mono text-xs text-zinc-500 dark:text-zinc-400">
{{ $commit->short_hash }} · {{ $commit->repository?->name }}
</div>
<div class="mt-1 truncate text-sm font-semibold text-zinc-900 dark:text-zinc-100">
{{ $commit->message }}
</div>
</div>
@empty
<div class="rounded-xl border border-dashed border-zinc-300 p-4 text-center text-sm text-zinc-500 dark:border-zinc-700 dark:text-zinc-400">
No commits tracked yet.
</div>
@endforelse
</div>
</details>
</div>
</div>
</div>
@@ -0,0 +1,349 @@
@vite(['resources/css/app.css'])
<div class="hd-helpdesk-surface mx-auto max-w-[1800px] space-y-6" dusk="helpdesk-kanban-board"
wire:poll.visible.5s="refreshBoard" wire:key="helpdesk-kanban-root">
<div
class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">Helpdesk workflow</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">Kanban board</h1>
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">Drag tickets between board columns. Boards and
columns are configured in Helpdesk Settings.</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('helpdesk.index') }}" wire:navigate class="hd-btn hd-btn-blue">
<i class="fa-solid fa-gauge-high" aria-hidden="true"></i>
<span>Dashboard</span>
</a>
<a href="{{ route('helpdesk.tickets.create') }}" wire:navigate class="hd-btn hd-btn-green">
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span>New Ticket</span>
</a>
<a href="{{ route('helpdesk.settings') }}" wire:navigate class="hd-btn hd-btn-amber">
<i class="fa-solid fa-gear" aria-hidden="true"></i>
<span>Configure boards</span>
</a>
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate class="hd-btn hd-btn-blue">
<i class="fa-solid fa-list" aria-hidden="true"></i>
<span>List view</span>
</a>
</div>
</div>
</div>
</div>
@if ($boards->isEmpty())
<div
class="rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100">
No Kanban boards exist yet. Open Helpdesk Settings and create a board with at least one status column.
</div>
@else
<div
class="flex flex-col gap-4 rounded-2xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900 md:flex-row md:items-center md:justify-between">
<div class="min-w-0">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">Active board: {{ $board?->name ?? 'None' }}</h2>
<p class="text-xs text-zinc-500 dark:text-zinc-400">
{{ $board?->description ?: 'Use settings to configure which statuses appear as draggable columns.' }}
</p>
@if ($board?->owner)
<p class="mt-1 text-xs font-semibold text-emerald-600 dark:text-emerald-300">Owner:
{{ $board->owner->name }}</p>
@endif
</div>
<div class="hd-select-wrap shrink-0 md:w-72">
<select
class="hd-select"
aria-label="Select Kanban board"
onchange="window.location.href = '{{ route('helpdesk.kanban') }}?board_id=' + encodeURIComponent(this.value)"
>
@foreach ($boards as $availableBoard)
<option value="{{ $availableBoard->id }}" @selected((int) $board_id === (int) $availableBoard->id)>
{{ $availableBoard->name }}{{ $availableBoard->owner ? ' · ' . $availableBoard->owner->name : '' }}
</option>
@endforeach
</select>
</div>
</div>
@if ($statuses->isEmpty())
<div
class="rounded-2xl border border-amber-500/40 bg-amber-950/70 px-5 py-4 text-sm font-semibold text-amber-100">
This board is being initialised with the default workflow statuses. Refresh the page if the columns do
not appear immediately.
</div>
@else
<div class="flex gap-4 overflow-x-auto pb-4" data-helpdesk-kanban-board
wire:key="helpdesk-kanban-columns-{{ $board?->id ?? 0 }}-{{ $refreshNonce }}">
@foreach ($statuses as $status)
@php($tickets = $ticketsByStatus[$status->id] ?? collect())
<section
class="flex min-h-[640px] w-[330px] shrink-0 flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-zinc-100 shadow-sm dark:border-zinc-700 dark:bg-zinc-950"
dusk="kanban-column-{{ $status->slug }}"
wire:key="kanban-column-{{ $board?->id ?? 0 }}-{{ $status->id }}-{{ $refreshNonce }}">
<header
class="border-b border-zinc-200 bg-white px-4 py-4 dark:border-zinc-800 dark:bg-zinc-900">
<div class="flex items-start justify-between gap-3">
<div>
<h2
class="text-sm font-bold uppercase tracking-wide text-zinc-900 dark:text-zinc-100">
{{ $status->name }}</h2>
<p class="mt-1 text-xs text-zinc-500"><span data-helpdesk-kanban-count
data-status-id="{{ $status->id }}">{{ $tickets->count() }}</span>
tickets</p>
</div>
<span class="inline-flex h-4 w-4 rounded-full ring-4 ring-zinc-100 dark:ring-zinc-800"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($status->color) }}"></span>
</div>
</header>
<div id="helpdesk-kanban-column-{{ $status->id }}"
class="helpdesk-kanban-column min-h-[560px] flex-1 space-y-3 p-3 transition data-[drag-over=true]:bg-blue-50 dark:data-[drag-over=true]:bg-blue-950/30"
data-helpdesk-kanban-column data-status-id="{{ $status->id }}"
wire:key="kanban-dropzone-{{ $board?->id ?? 0 }}-{{ $status->id }}-{{ $refreshNonce }}">
@forelse ($tickets as $ticket)
<article
class="group cursor-grab rounded-2xl border border-zinc-200 bg-white p-4 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md active:cursor-grabbing dark:border-zinc-800 dark:bg-zinc-900"
draggable="true" data-helpdesk-kanban-ticket data-ticket-id="{{ $ticket->id }}"
wire:key="kanban-ticket-{{ $ticket->id }}-{{ $ticket->status_id }}-{{ $ticket->board_id }}-{{ optional($ticket->updated_at)->timestamp }}"
dusk="kanban-ticket-{{ $ticket->id }}">
<div class="flex items-start justify-between gap-3">
<div class="min-w-0">
<div
class="font-mono text-xs font-semibold text-blue-700 dark:text-blue-300">
{{ $ticket->reference }}</div>
<h3
class="mt-1 line-clamp-3 text-sm font-semibold leading-5 text-zinc-900 dark:text-zinc-100">
{{ $ticket->subject }}</h3>
</div>
@if ($ticket->priority)
<span class="shrink-0 rounded-full px-2 py-1 text-xs font-bold text-white"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($ticket->priority->color) }}">
{{ $ticket->priority->name }}
</span>
@endif
</div>
<div class="mt-3 space-y-1.5 text-xs text-zinc-500 dark:text-zinc-400">
<div class="flex items-center gap-2"><i class="fa-solid fa-user w-3"
aria-hidden="true"></i> {{ $ticket->owner?->name ?? 'Unknown' }}</div>
<div class="flex items-center gap-2"><i class="fa-solid fa-user-gear w-3"
aria-hidden="true"></i> {{ $ticket->agent?->name ?? 'Unassigned' }}
</div>
@if ($ticket->project)
<div class="flex items-center gap-2"><i
class="fa-solid fa-diagram-project w-3" aria-hidden="true"></i>
{{ $ticket->project->title }}</div>
@endif
@if ($ticket->team)
<div class="flex items-center gap-2"><i class="fa-solid fa-users w-3"
aria-hidden="true"></i> {{ $ticket->team->name }}</div>
@endif
@if ($ticket->product)
<div class="flex items-center gap-2"><i class="fa-solid fa-box w-3"
aria-hidden="true"></i> {{ $ticket->product->name }}</div>
@endif
</div>
<form method="POST" action="{{ route('helpdesk.tickets.board.update', $ticket) }}"
class="mt-3 rounded-xl border border-emerald-500/20 bg-emerald-950/20 p-2"
onclick="event.stopPropagation()"
onmousedown="event.stopPropagation()"
ondragstart="event.preventDefault(); event.stopPropagation();">
@csrf
<input type="hidden" name="return_to_board_id" value="{{ $board?->id }}">
<label
class="mb-1 block text-[11px] font-bold uppercase tracking-wide text-emerald-200/80">Board</label>
<div class="hd-ticket-board-select-wrap">
<select name="board_id"
class="hd-ticket-board-select"
draggable="false"
onchange="this.form.requestSubmit ? this.form.requestSubmit() : this.form.submit()"
onclick="event.stopPropagation()"
onmousedown="event.stopPropagation()"
aria-label="Move {{ $ticket->reference }} to another board">
@foreach ($boards as $ticketBoard)
<option value="{{ $ticketBoard->id }}"
@selected((int) $ticket->board_id === (int) $ticketBoard->id)>{{ $ticketBoard->name }}</option>
@endforeach
</select>
</div>
</form>
@if ($ticket->tags->isNotEmpty())
<div class="mt-3 flex flex-wrap gap-1">
@foreach ($ticket->tags as $tag)
<span
class="rounded-full px-2 py-0.5 text-[11px] font-semibold text-white"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($tag->color) }}">{{ $tag->name }}</span>
@endforeach
</div>
@endif
@if ($ticket->checklistItems->isNotEmpty())
@php($done = $ticket->checklistItems->where('is_completed', true)->count())
<div class="mt-3 text-xs text-zinc-500">Checklist
{{ $done }}/{{ $ticket->checklistItems->count() }}</div>
@endif
@if ($ticket->sla_first_response_breached || $ticket->sla_resolution_breached)
<div
class="mt-3 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-xs font-semibold text-red-800 dark:border-red-900 dark:bg-red-950 dark:text-red-100">
SLA breach</div>
@endif
<div
class="mt-4 flex items-center justify-between gap-2 border-t border-zinc-100 pt-3 dark:border-zinc-800">
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate
class="rounded-lg bg-blue-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-700">Open</a>
@can('update', $ticket)
<a href="{{ route('helpdesk.tickets.edit', $ticket) }}" wire:navigate
class="rounded-lg bg-emerald-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-emerald-700">Edit</a>
@endcan
</div>
</article>
@empty
<div
class="rounded-2xl border border-dashed border-zinc-300 bg-white p-6 text-center text-sm text-zinc-500 dark:border-zinc-700 dark:bg-zinc-900">
Drop tickets here for {{ $status->name }}.
</div>
@endforelse
</div>
</section>
@endforeach
</div>
@endif
@endif
@script
<script>
const initialiseHelpdeskKanban = function() {
let draggedTicketId = null;
let draggedCard = null;
const updateColumnCounts = function() {
document.querySelectorAll('[data-helpdesk-kanban-count]').forEach(function(counter) {
const statusId = counter.dataset.statusId;
const column = document.querySelector('[data-helpdesk-kanban-column][data-status-id="' +
statusId + '"]');
if (!column) {
return;
}
counter.textContent = column.querySelectorAll('[data-helpdesk-kanban-ticket]').length
.toString();
});
};
const forceLivewireRefresh = function() {
if (typeof $wire !== 'undefined' && typeof $wire.$refresh === 'function') {
return Promise.resolve($wire.$refresh());
}
if (typeof Livewire !== 'undefined' && typeof Livewire.find === 'function') {
const root = document.querySelector('[wire\\:id]');
const component = root ? Livewire.find(root.getAttribute('wire:id')) : null;
if (component && typeof component.$refresh === 'function') {
return Promise.resolve(component.$refresh());
}
}
window.location.reload();
return Promise.resolve();
};
document.querySelectorAll('[data-helpdesk-kanban-ticket]').forEach(function(card) {
if (card.dataset.nativeDragReady === '1') return;
card.dataset.nativeDragReady = '1';
card.addEventListener('dragstart', function(event) {
draggedTicketId = card.dataset.ticketId;
draggedCard = card;
event.dataTransfer.effectAllowed = 'move';
event.dataTransfer.setData('text/plain', draggedTicketId);
event.dataTransfer.setData('application/x-helpdesk-ticket-id', draggedTicketId);
card.classList.add('opacity-60');
});
card.addEventListener('dragend', function() {
card.classList.remove('opacity-60');
document.querySelectorAll('[data-helpdesk-kanban-column]').forEach(function(
column) {
column.dataset.dragOver = 'false';
column.dataset.refreshing = 'false';
});
});
});
document.querySelectorAll('[data-helpdesk-kanban-column]').forEach(function(column) {
if (column.dataset.nativeDropReady === '1') return;
column.dataset.nativeDropReady = '1';
column.addEventListener('dragover', function(event) {
event.preventDefault();
event.dataTransfer.dropEffect = 'move';
column.dataset.dragOver = 'true';
});
column.addEventListener('dragleave', function(event) {
if (!column.contains(event.relatedTarget)) {
column.dataset.dragOver = 'false';
}
});
column.addEventListener('drop', function(event) {
event.preventDefault();
column.dataset.dragOver = 'false';
const ticketId = event.dataTransfer.getData('application/x-helpdesk-ticket-id') ||
event.dataTransfer.getData('text/plain') || draggedTicketId;
const statusId = column.dataset.statusId;
const card = draggedCard || document.querySelector(
'[data-helpdesk-kanban-ticket][data-ticket-id="' + ticketId + '"]');
if (!ticketId || !statusId || !card) return;
column.dataset.refreshing = 'true';
column.appendChild(card);
updateColumnCounts();
Promise.resolve($wire.moveTicket(ticketId, statusId))
.then(forceLivewireRefresh)
.finally(function() {
column.dataset.refreshing = 'false';
draggedTicketId = null;
draggedCard = null;
updateColumnCounts();
setTimeout(initialiseHelpdeskKanban, 50);
});
});
});
updateColumnCounts();
};
initialiseHelpdeskKanban();
document.addEventListener('livewire:navigated', initialiseHelpdeskKanban);
document.addEventListener('livewire:updated', initialiseHelpdeskKanban);
document.addEventListener('helpdesk-kanban-moved', function() {
setTimeout(function() {
initialiseHelpdeskKanban();
if (typeof $wire !== 'undefined' && typeof $wire.$refresh === 'function') {
$wire.$refresh();
}
}, 50);
});
</script>
@endscript
</div>
@@ -0,0 +1,988 @@
@php
/**
* Keep the settings view safe during rolling module upgrades or Livewire navigate
* hydration where the compiled Blade view may be newer than the loaded component.
*/
$companies = collect($companies ?? []);
$statuses = collect($statuses ?? []);
$priorities = collect($priorities ?? []);
$categories = collect($categories ?? []);
$teams = collect($teams ?? []);
$projects = collect($projects ?? []);
$boards = collect($boards ?? []);
$repositories = collect($repositories ?? []);
$workflowTemplates = collect($workflowTemplates ?? []);
$cannedResponses = collect($cannedResponses ?? []);
$slaPolicies = collect($slaPolicies ?? []);
$automationRules = collect($automationRules ?? []);
$checklistTemplates = collect($checklistTemplates ?? []);
$tags = collect($tags ?? []);
$products = collect($products ?? []);
@endphp
<div class="hd-helpdesk-surface space-y-4" dusk="helpdesk-settings-manager">
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-5 py-5 text-white">
<div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">Helpdesk administration
</p>
<h1 class="mt-2 text-2xl font-semibold tracking-tight">Support configuration</h1>
<p class="mt-1 max-w-3xl text-sm text-blue-100/90">Manage lookup data, workflow messages, canned
responses, SLA policies, automation rules, checklists, tags and product/service linkage.</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('helpdesk.index') }}" wire:navigate class="hd-btn hd-btn-blue">
<i class="fa-solid fa-gauge-high" aria-hidden="true"></i>
<span>Dashboard</span>
</a>
</div>
</div>
</div>
</div>
<div class="grid gap-2 md:grid-cols-4 xl:grid-cols-7">
@foreach ([
'statuses' => ['label' => 'Statuses', 'count' => $statuses->count()],
'priorities' => ['label' => 'Priorities', 'count' => $priorities->count()],
'categories' => ['label' => 'Categories', 'count' => $categories->count()],
'teams' => ['label' => 'Teams', 'count' => $teams->count()],
'projects' => ['label' => 'Projects', 'count' => $projects->count()],
'boards' => ['label' => 'Boards', 'count' => $boards->count()],
'git' => ['label' => 'Git', 'count' => $repositories->count()],
'workflow' => ['label' => 'Workflow', 'count' => $workflowTemplates->count()],
'canned' => ['label' => 'Canned', 'count' => $cannedResponses->count()],
'sla' => ['label' => 'SLA', 'count' => $slaPolicies->count()],
'automation' => ['label' => 'Rules', 'count' => $automationRules->count()],
'checklists' => ['label' => 'Checks', 'count' => $checklistTemplates->count()],
'tags' => ['label' => 'Tags', 'count' => $tags->count()],
'products' => ['label' => 'Products', 'count' => $products->count()],
'defaults' => ['label' => 'Defaults', 'count' => 1],
] as $key => $item)
@php
$sectionPalette = match ($key) {
'statuses' => ['border' => '#38bdf8', 'bg' => 'rgba(14, 165, 233, .22)', 'active' => '#0284c7'],
'priorities' => ['border' => '#f87171', 'bg' => 'rgba(239, 68, 68, .22)', 'active' => '#dc2626'],
'categories' => ['border' => '#818cf8', 'bg' => 'rgba(99, 102, 241, .22)', 'active' => '#4f46e5'],
'teams' => ['border' => '#60a5fa', 'bg' => 'rgba(37, 99, 235, .22)', 'active' => '#2563eb'],
'projects' => ['border' => '#22d3ee', 'bg' => 'rgba(8, 145, 178, .22)', 'active' => '#0891b2'],
'boards' => ['border' => '#fbbf24', 'bg' => 'rgba(245, 158, 11, .24)', 'active' => '#f59e0b'],
'git' => ['border' => '#94a3b8', 'bg' => 'rgba(71, 85, 105, .28)', 'active' => '#475569'],
'workflow' => ['border' => '#34d399', 'bg' => 'rgba(5, 150, 105, .22)', 'active' => '#059669'],
'canned' => ['border' => '#2dd4bf', 'bg' => 'rgba(13, 148, 136, .22)', 'active' => '#0d9488'],
'sla' => ['border' => '#fb923c', 'bg' => 'rgba(234, 88, 12, .22)', 'active' => '#ea580c'],
'automation' => ['border' => '#c084fc', 'bg' => 'rgba(147, 51, 234, .22)', 'active' => '#9333ea'],
'checklists' => ['border' => '#a3e635', 'bg' => 'rgba(101, 163, 13, .22)', 'active' => '#65a30d'],
'tags' => ['border' => '#f472b6', 'bg' => 'rgba(219, 39, 119, .22)', 'active' => '#db2777'],
'products' => ['border' => '#a78bfa', 'bg' => 'rgba(124, 58, 237, .22)', 'active' => '#7c3aed'],
'defaults' => ['border' => '#4ade80', 'bg' => 'rgba(22, 163, 74, .22)', 'active' => '#16a34a'],
default => ['border' => '#71717a', 'bg' => 'rgba(63, 63, 70, .22)', 'active' => '#3f3f46'],
};
$sectionStyle =
$section === $key
? 'border-color: ' .
$sectionPalette['border'] .
'; background-color: ' .
$sectionPalette['active'] .
'; color: #ffffff; box-shadow: 0 16px 36px rgba(0,0,0,.32);'
: 'border-color: ' .
$sectionPalette['border'] .
'; background-color: ' .
$sectionPalette['bg'] .
'; color: #ffffff; box-shadow: 0 10px 24px rgba(0,0,0,.20);';
@endphp
<a href="{{ route('helpdesk.settings', ['section' => $key]) }}"
dusk="helpdesk-settings-section-{{ $key }}"
class="rounded-xl border px-3 py-2 text-left shadow-sm transition hover:-translate-y-0.5"
style="{{ $sectionStyle }}">
<div class="text-xs font-semibold uppercase tracking-wide opacity-70">{{ $item['label'] }}</div>
<div class="mt-0.5 text-xl font-semibold">{{ $item['count'] }}</div>
</a>
@endforeach
</div>
@if ($section === 'defaults')
<x-helpdesk::settings-section title="Ticket defaults"
description="Choose the company default used when a new Helpdesk ticket is created. Lookup defaults are configured on the Statuses, Priorities, Categories, Teams and Projects sections.">
<x-slot:form>
<form class="grid gap-3 md:grid-cols-3">
<flux:select wire:model="default_helpdesk_company_id" label="Default company">
<option value="">No default company</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">
{{ $company->name }}{{ $company->is_default_helpdesk_company ?? false ? ' — Default' : '' }}
</option>
@endforeach
</flux:select>
<div class="md:col-span-3 flex gap-2">
<flux:button size="sm" type="button" wire:click="saveDefaultHelpdeskCompany" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">
Save default company
</flux:button>
</div>
</form>
</x-slot:form>
<div
class="rounded-2xl border border-zinc-200 bg-zinc-50 p-4 text-sm text-zinc-700 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<p class="font-semibold">Lookup defaults</p>
<p class="mt-1">Set the default Status, Priority, Category, Team and Project from their own settings
sections. Only one default per company/global scope is kept for each lookup type.</p>
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'statuses')
<x-helpdesk::settings-section title="Statuses"
description="Control workflow stages and mark which statuses close tickets.">
<x-slot:form>
<form wire:submit.prevent="saveStatus" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-3">
<flux:input wire:model="statusForm.name" label="Name" />
</div>
<div class="xl:col-span-3">
<flux:input wire:model="statusForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="statusForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-2">
<flux:input wire:model="statusForm.sort_order" label="Sort" type="number" min="0" />
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-3">
<input type="checkbox" wire:model="statusForm.is_closed" class="rounded border-zinc-600 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Closed status
</label>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<input type="checkbox" wire:model="statusForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default status for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save status
</flux:button>
<flux:button size="sm" type="button" wire:click="resetStatusForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::lookup-table :items="$statuses" edit="editStatus" delete="deleteStatus" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'priorities')
<x-helpdesk::settings-section title="Priorities" description="Define ticket urgency levels and display order.">
<x-slot:form>
<form wire:submit.prevent="savePriority" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-3">
<flux:input wire:model="priorityForm.name" label="Name" />
</div>
<div class="xl:col-span-3">
<flux:input wire:model="priorityForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="priorityForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-2">
<flux:input wire:model="priorityForm.sort_order" label="Sort" type="number" min="0" />
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<input type="checkbox" wire:model="priorityForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save priority
</flux:button>
<flux:button size="sm" type="button" wire:click="resetPriorityForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::lookup-table :items="$priorities" edit="editPriority" delete="deletePriority" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'categories')
<x-helpdesk::settings-section title="Categories"
description="Group tickets by support area, optionally per company.">
<x-slot:form>
<form wire:submit.prevent="saveCategory" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-3">
<flux:select wire:model="categoryForm.company_id" label="Company">
<option value="">Global</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">{{ $company->name }}</option>
@endforeach
</flux:select>
</div>
<div class="xl:col-span-3">
<flux:input wire:model="categoryForm.name" label="Name" />
</div>
<div class="xl:col-span-3">
<flux:input wire:model="categoryForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="categoryForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-12">
<flux:textarea wire:model="categoryForm.description" label="Description" rows="3" />
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<input type="checkbox" wire:model="categoryForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default category for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
category</flux:button>
<flux:button size="sm" type="button" wire:click="resetCategoryForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::lookup-table :items="$categories" edit="editCategory" delete="deleteCategory" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'teams')
<x-helpdesk::settings-section title="Teams"
description="Create support teams under each company and assign projects to them.">
<x-slot:form>
<form wire:submit.prevent="saveTeam" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-3">
<flux:select wire:model="teamForm.company_id" label="Company">
<option value="">Global</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">{{ $company->name }}</option>
@endforeach
</flux:select>
</div>
<div class="xl:col-span-3">
<flux:input wire:model="teamForm.name" label="Name" />
</div>
<div class="xl:col-span-3">
<flux:input wire:model="teamForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="teamForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-12">
<flux:textarea wire:model="teamForm.description" label="Description" rows="3" />
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<input type="checkbox" wire:model="teamForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default team for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save team
</flux:button>
<flux:button size="sm" type="button" wire:click="resetTeamForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::team-table :items="$teams" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'projects')
<x-helpdesk::settings-section title="Projects"
description="Create company projects and optionally assign them to support teams.">
<x-slot:form>
<form wire:submit.prevent="saveProject" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-2">
<flux:select wire:model="projectForm.company_id" label="Company">
<option value="">Global</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">{{ $company->name }}</option>
@endforeach
</flux:select>
</div>
<div class="xl:col-span-2">
<flux:select wire:model="projectForm.team_id" label="Team">
<option value="">No team</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}">{{ $team->name }}</option>
@endforeach
</flux:select>
</div>
<div class="xl:col-span-2">
<flux:input wire:model="projectForm.title" label="Title" />
</div>
<div class="xl:col-span-2">
<flux:input wire:model="projectForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="projectForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-12">
<flux:textarea wire:model="projectForm.description" label="Description" rows="3" />
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<input type="checkbox" wire:model="projectForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default project for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save project
</flux:button>
<flux:button size="sm" type="button" wire:click="resetProjectForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::project-table :items="$projects" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'boards')
<x-helpdesk::settings-section title="Kanban Boards"
description="Create configurable workflow boards and choose which statuses appear as draggable columns.">
<x-slot:form>
<form wire:submit.prevent="saveBoard" class="grid gap-3 md:grid-cols-7">
<flux:input wire:model="boardForm.name" label="Name" />
<flux:input wire:model="boardForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="boardForm.sort_order" label="Sort" type="number" min="0" />
<flux:select wire:model="boardForm.owner_id" label="Owner">
<option value="">No owner</option>
@foreach ($boardOwners as $owner)
<option value="{{ $owner->id }}">{{ $owner->name }}</option>
@endforeach
</flux:select>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200">
<input type="checkbox" wire:model="boardForm.is_default" class="rounded border-zinc-300">
Default board
</label>
<div class="md:col-span-2">
<flux:textarea wire:model="boardForm.description" label="Description" rows="2" />
</div>
<div class="md:col-span-full">
<label class="mb-2 block text-sm font-medium text-zinc-700 dark:text-zinc-200">Board
columns</label>
<div class="grid gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6">
@foreach ($statuses as $status)
<label
class="flex items-center gap-2 rounded-xl border border-zinc-200 bg-white px-3 py-2 text-sm text-zinc-700 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<input type="checkbox" wire:model="boardForm.status_ids"
value="{{ $status->id }}" class="rounded border-zinc-300">
<span class="inline-flex h-3 w-3 rounded-full"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($status->color) }}"></span>
<span>{{ $status->name }}</span>
</label>
@endforeach
</div>
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save board
</flux:button>
<flux:button size="sm" type="button" wire:click="resetBoardForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-4 py-3">Board</th>
<th class="px-4 py-3">Owner</th>
<th class="px-4 py-3">Columns</th>
<th class="px-4 py-3">Tickets</th>
<th class="px-4 py-3">Default</th>
<th class="px-4 py-3 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($boards as $boardItem)
<tr>
<td class="px-4 py-3">
<div class="font-medium text-zinc-900 dark:text-zinc-100">{{ $boardItem->name }}
</div>
<div class="text-xs text-zinc-500">{{ $boardItem->slug }}</div>
</td>
<td class="px-4 py-3 text-sm text-zinc-600 dark:text-zinc-300">
{{ $boardItem->owner?->name ?? 'Unassigned' }}</td>
<td class="px-4 py-3">
<div class="flex flex-wrap gap-1">
@foreach ($boardItem->statuses as $status)
<span class="rounded-full px-2 py-1 text-xs font-semibold text-white"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($status->color) }}">{{ $status->name }}</span>
@endforeach
</div>
</td>
<td class="px-4 py-3 text-zinc-500">{{ $boardItem->tickets_count ?? 0 }}</td>
<td class="px-4 py-3">
<flux:badge color="{{ $boardItem->is_default ? 'emerald' : 'zinc' }}">
{{ $boardItem->is_default ? 'Default' : 'No' }}</flux:badge>
</td>
<td class="px-4 py-3 text-right">
<flux:button size="sm" variant="primary"
wire:click="editBoard({{ $boardItem->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">
Edit</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteBoard({{ $boardItem->id }})"
wire:confirm="Delete this board?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-4 py-8 text-center text-zinc-500">No Kanban boards yet.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'git')
<x-helpdesk::settings-section title="Git repositories"
description="Configure repositories that can be linked to projects and tickets. Commits can then be stored against tickets for traceability.">
<x-slot:form>
<form wire:submit.prevent="saveRepository" class="grid gap-3 md:grid-cols-6">
<flux:select wire:model="repositoryForm.company_id" label="Company">
<option value="">Global</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">{{ $company->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="repositoryForm.project_id" label="Project">
<option value="">No project</option>
@foreach ($projects as $project)
<option value="{{ $project->id }}">{{ $project->title }}</option>
@endforeach
</flux:select>
<flux:input wire:model="repositoryForm.name" label="Name" />
<flux:input wire:model="repositoryForm.provider" label="Provider"
placeholder="git, github, gitlab" />
<flux:input wire:model="repositoryForm.default_branch" label="Default branch" />
<flux:input wire:model="repositoryForm.webhook_secret" label="Webhook secret" />
<div class="md:col-span-full">
<flux:input wire:model="repositoryForm.remote_url" label="Remote URL"
placeholder="git@github.com:company/repo.git" />
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
repository</flux:button>
<flux:button size="sm" type="button" wire:click="resetRepositoryForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk::repository-table :items="$repositories" />
</x-helpdesk::settings-section>
@endif
@if ($section === 'workflow')
<x-helpdesk::settings-section title="Workflow messages"
description="Define the professional email messages sent when tickets are raised, updated, replied to and closed.">
<x-slot:form>
<form wire:submit.prevent="saveWorkflowTemplate" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="workflowForm.name" label="Name" />
<flux:select wire:model="workflowForm.event" label="Event">
<option value="ticket.created">Ticket raised</option>
<option value="ticket.updated">Ticket updated</option>
<option value="ticket.commented">Response added</option>
<option value="ticket.reply_created">Reply added</option>
<option value="ticket.closed">Ticket closed</option>
</flux:select>
<flux:select wire:model="workflowForm.to_role" label="Send to">
<option value="requester">Requester</option>
<option value="agent">Assigned agent</option>
<option value="actor">User making change</option>
</flux:select>
<flux:input wire:model="workflowForm.cc" label="CC"
placeholder="Optional comma-separated emails" />
<flux:input wire:model="workflowForm.bcc" label="BCC"
placeholder="Optional comma-separated emails" />
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200"><input
type="checkbox" wire:model="workflowForm.is_active" class="rounded border-zinc-300">
Active</label>
<div class="md:col-span-full">
<flux:input wire:model="workflowForm.subject" label="Subject"
placeholder="Ticket @{{ ticket.reference }} has been raised" />
</div>
<div class="md:col-span-full">
<flux:textarea wire:model="workflowForm.html_body" label="HTML email body" rows="8"
placeholder="Use tokens like @{{ ticket.reference }}, @{{ ticket.subject }}, @{{ ticket.status }}, @{{ requester.name }}, @{{ ticket.url }}" />
</div>
<div class="md:col-span-full">
<flux:textarea wire:model="workflowForm.text_body" label="Plain text body" rows="4"
placeholder="Optional fallback text" />
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
workflow message</flux:button>
<flux:button size="sm" type="button" wire:click="resetWorkflowTemplateForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-4 py-3">Name</th>
<th class="px-4 py-3">Event</th>
<th class="px-4 py-3">Recipient</th>
<th class="px-4 py-3">Active</th>
<th class="px-4 py-3 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($workflowTemplates as $template)
<tr>
<td class="px-4 py-3 font-medium text-zinc-900 dark:text-zinc-100">
{{ $template->name }}</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">{{ $template->event }}</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">{{ $template->to_role }}</td>
<td class="px-4 py-3">
<flux:badge color="{{ $template->is_active ? 'emerald' : 'zinc' }}">
{{ $template->is_active ? 'Active' : 'Inactive' }}</flux:badge>
</td>
<td class="px-4 py-3 text-right">
<flux:button size="sm" variant="ghost"
wire:click="editWorkflowTemplate({{ $template->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">
Edit</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteWorkflowTemplate({{ $template->id }})"
wire:confirm="Delete this workflow message?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-4 py-8 text-center text-zinc-500">No workflow messages
yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'canned')
<x-helpdesk::settings-section title="Canned responses"
description="Save professional reusable replies with macro tokens for ticket, requester, agent, status and URL values.">
<x-slot:form>
<form wire:submit.prevent="saveCannedResponse" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="cannedForm.name" label="Name" />
<flux:input wire:model="cannedForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="cannedForm.sort_order" label="Sort" type="number" min="0" />
<flux:select wire:model="cannedForm.category_id" label="Category">
<option value="">Any category</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="cannedForm.team_id" label="Team">
<option value="">Any team</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}">{{ $team->name }}</option>
@endforeach
</flux:select>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200"><input
type="checkbox" wire:model="cannedForm.is_active" class="rounded border-zinc-300">
Active</label>
<div class="md:col-span-full">
<flux:input wire:model="cannedForm.subject" label="Optional subject" />
</div>
<div class="md:col-span-full">
<flux:textarea wire:model="cannedForm.body" label="Reply body" rows="6"
placeholder="Hello @{{ requester.name }},&#10;&#10;Your ticket @{{ ticket.reference }} has been reviewed." />
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save canned
response</flux:button>
<flux:button size="sm" type="button" wire:click="resetCannedResponseForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div class="grid gap-3 md:grid-cols-2 xl:grid-cols-3">
@forelse ($cannedResponses as $response)
<div class="rounded-2xl border border-zinc-200 bg-white p-4 dark:border-zinc-700 dark:bg-zinc-900">
<div class="flex items-start justify-between gap-3">
<div>
<h3 class="font-semibold text-zinc-900 dark:text-zinc-100">{{ $response->name }}</h3>
<p class="text-xs text-zinc-500">{{ $response->category?->name ?? 'Any category' }} ·
{{ $response->team?->name ?? 'Any team' }}</p>
</div>
<flux:badge color="{{ $response->is_active ? 'emerald' : 'zinc' }}">
{{ $response->is_active ? 'Active' : 'Inactive' }}</flux:badge>
</div>
<p class="mt-3 line-clamp-3 text-sm text-zinc-600 dark:text-zinc-300">
{{ strip_tags($response->body) }}</p>
<div class="mt-4 flex justify-end gap-2">
<flux:button size="sm" variant="primary"
wire:click="editCannedResponse({{ $response->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">Edit
</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteCannedResponse({{ $response->id }})"
wire:confirm="Delete this canned response?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</div>
</div>
@empty
<div
class="rounded-2xl border border-dashed border-zinc-300 p-8 text-center text-sm text-zinc-500 dark:border-zinc-700 md:col-span-2 xl:col-span-3">
No canned responses yet.</div>
@endforelse
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'sla')
<x-helpdesk::settings-section title="SLA policies"
description="Define first response and resolution targets used for breach indicators, reporting and ticket cards.">
<x-slot:form>
<form wire:submit.prevent="saveSlaPolicy" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="slaForm.name" label="Name" />
<flux:input wire:model="slaForm.slug" label="Slug" placeholder="auto-generated" />
<flux:select wire:model="slaForm.priority_id" label="Priority">
<option value="">Any priority</option>
@foreach ($priorities as $priority)
<option value="{{ $priority->id }}">{{ $priority->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="slaForm.category_id" label="Category">
<option value="">Any category</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</flux:select>
<flux:input wire:model="slaForm.first_response_minutes" label="First response minutes"
type="number" min="1" />
<flux:input wire:model="slaForm.resolution_minutes" label="Resolution minutes" type="number"
min="1" />
<label class="flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-200"><input
type="checkbox" wire:model="slaForm.is_default" class="rounded border-zinc-300">
Default</label>
<label class="flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-200"><input
type="checkbox" wire:model="slaForm.business_hours_only" class="rounded border-zinc-300">
Business hours</label>
<label class="flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-200"><input
type="checkbox" wire:model="slaForm.is_active" class="rounded border-zinc-300">
Active</label>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save SLA
policy</flux:button>
<flux:button size="sm" type="button" wire:click="resetSlaPolicyForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead class="bg-zinc-50 text-left text-xs font-semibold uppercase text-zinc-500 dark:bg-zinc-800">
<tr>
<th class="px-4 py-3">Policy</th>
<th class="px-4 py-3">Targets</th>
<th class="px-4 py-3">Applies to</th>
<th class="px-4 py-3 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($slaPolicies as $policy)
<tr>
<td class="px-4 py-3 font-medium">{{ $policy->name }} @if ($policy->is_default)
<flux:badge color="blue">Default</flux:badge>
@endif
</td>
<td class="px-4 py-3">{{ $policy->first_response_minutes }}m response ·
{{ $policy->resolution_minutes }}m close</td>
<td class="px-4 py-3">{{ $policy->priority?->name ?? 'Any priority' }} ·
{{ $policy->category?->name ?? 'Any category' }}</td>
<td class="px-4 py-3 text-right">
<flux:button size="sm" variant="primary"
wire:click="editSlaPolicy({{ $policy->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">
Edit</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteSlaPolicy({{ $policy->id }})"
wire:confirm="Delete this SLA policy?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</td>
</tr>@empty<tr>
<td colspan="6" class="px-4 py-8 text-center text-zinc-500">No SLA policies yet.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'automation')
<x-helpdesk::settings-section title="Email automation rules"
description="Match incoming support messages and automatically assign priority, category, team, project, agent and status.">
<x-slot:form>
<form wire:submit.prevent="saveAutomationRule" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="automationForm.name" label="Name" />
<flux:input wire:model="automationForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="automationForm.sort_order" label="Sort" type="number"
min="0" />
<flux:input wire:model="automationForm.match_sender" label="Sender contains" />
<flux:input wire:model="automationForm.match_subject" label="Subject contains" />
<flux:input wire:model="automationForm.match_mailbox" label="Mailbox contains" />
<flux:select wire:model="automationForm.set_priority_id" label="Set priority">
<option value="">No change</option>
@foreach ($priorities as $priority)
<option value="{{ $priority->id }}">{{ $priority->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="automationForm.set_category_id" label="Set category">
<option value="">No change</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="automationForm.set_team_id" label="Set team">
<option value="">No change</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}">{{ $team->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="automationForm.set_project_id" label="Set project">
<option value="">No change</option>
@foreach ($projects as $project)
<option value="{{ $project->id }}">{{ $project->title }}</option>
@endforeach
</flux:select>
<flux:select wire:model="automationForm.set_status_id" label="Set status">
<option value="">No change</option>
@foreach ($statuses as $status)
<option value="{{ $status->id }}">{{ $status->name }}</option>
@endforeach
</flux:select>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200"><input
type="checkbox" wire:model="automationForm.is_active" class="rounded border-zinc-300">
Active</label>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
automation rule</flux:button>
<flux:button size="sm" type="button" wire:click="resetAutomationRuleForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div class="grid gap-3 md:grid-cols-2">
@forelse ($automationRules as $rule)
<div class="rounded-2xl border border-zinc-200 bg-white p-4 dark:border-zinc-700 dark:bg-zinc-900">
<h3 class="font-semibold">{{ $rule->name }}</h3>
<p class="mt-1 text-sm text-zinc-500">Sender: {{ $rule->match_sender ?: 'Any' }} · Subject:
{{ $rule->match_subject ?: 'Any' }}</p>
<div class="mt-4 flex justify-end gap-2">
<flux:button size="sm" variant="primary"
wire:click="editAutomationRule({{ $rule->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">Edit
</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteAutomationRule({{ $rule->id }})"
wire:confirm="Delete this rule?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</div>
</div>@empty<div
class="rounded-2xl border border-dashed border-zinc-300 p-8 text-center text-sm text-zinc-500 dark:border-zinc-700 md:col-span-2">
No automation rules yet.</div>
@endforelse
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'checklists')
<x-helpdesk::settings-section title="Checklist templates"
description="Apply repeatable checklist items by category or project and show completion progress on tickets and Kanban cards.">
<x-slot:form>
<form wire:submit.prevent="saveChecklistTemplate" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="checklistTemplateForm.name" label="Name" />
<flux:input wire:model="checklistTemplateForm.slug" label="Slug" />
<flux:select wire:model="checklistTemplateForm.category_id" label="Category">
<option value="">Any category</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model="checklistTemplateForm.project_id" label="Project">
<option value="">Any project</option>
@foreach ($projects as $project)
<option value="{{ $project->id }}">{{ $project->title }}</option>
@endforeach
</flux:select>
<label class="flex items-end gap-2 pb-2 text-sm"><input type="checkbox"
wire:model="checklistTemplateForm.is_active" class="rounded border-zinc-300">
Active</label>
<div class="md:col-span-full">
<flux:textarea wire:model="checklistTemplateForm.items_text"
label="Checklist items, one per line" rows="6" />
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
checklist</flux:button>
<flux:button size="sm" type="button" wire:click="resetChecklistTemplateForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div class="grid gap-3 md:grid-cols-2 xl:grid-cols-3">
@forelse ($checklistTemplates as $template)
<div class="rounded-2xl border border-zinc-200 bg-white p-4 dark:border-zinc-700 dark:bg-zinc-900">
<h3 class="font-semibold">{{ $template->name }}</h3>
<p class="mt-1 text-sm text-zinc-500">{{ count($template->items ?? []) }} items</p>
<div class="mt-4 flex justify-end gap-2">
<flux:button size="sm" variant="primary"
wire:click="editChecklistTemplate({{ $template->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">Edit
</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteChecklistTemplate({{ $template->id }})"
wire:confirm="Delete this checklist?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</div>
</div>@empty<div
class="rounded-2xl border border-dashed border-zinc-300 p-8 text-center text-sm text-zinc-500 dark:border-zinc-700 md:col-span-2 xl:col-span-3">
No checklist templates yet.</div>
@endforelse
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'tags')
<x-helpdesk::settings-section title="Ticket tags"
description="Maintain visible ticket labels for search, triage and Kanban card context.">
<x-slot:form>
<form wire:submit.prevent="saveTag" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-4">
<flux:input wire:model="tagForm.name" label="Name" />
</div>
<div class="xl:col-span-4">
<flux:input wire:model="tagForm.slug" label="Slug" />
</div>
<x-helpdesk::colour-select class="xl:col-span-12" model="tagForm.color" label="Colour" :options="$colourOptions" />
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save tag
</flux:button>
<flux:button size="sm" type="button" wire:click="resetTagForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div class="flex flex-wrap gap-3">
@forelse ($tags as $tag)
<div
class="rounded-2xl border border-zinc-200 bg-white px-4 py-3 dark:border-zinc-700 dark:bg-zinc-900">
<span class="rounded-full px-2 py-1 text-xs font-semibold text-white"
style="background-color: {{ \Modules\Helpdesk\Support\Color::css($tag->color) }}">{{ $tag->name }}</span>
<div class="mt-3 flex gap-2">
<flux:button size="sm" variant="primary" wire:click="editTag({{ $tag->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">Edit
</flux:button>
<flux:button size="sm" variant="danger" wire:click="deleteTag({{ $tag->id }})"
wire:confirm="Delete this tag?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</div>
</div>@empty<div
class="rounded-2xl border border-dashed border-zinc-300 p-8 text-center text-sm text-zinc-500 dark:border-zinc-700">
No tags yet.</div>
@endforelse
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'products')
<x-helpdesk::settings-section title="Products and services"
description="Link tickets to products, services, releases or builds and report support cost/time by product.">
<x-slot:form>
<form wire:submit.prevent="saveProduct" class="grid gap-3 md:grid-cols-6">
<flux:input wire:model="productForm.name" label="Name" />
<flux:input wire:model="productForm.slug" label="Slug" />
<flux:input wire:model="productForm.type" label="Type" />
<flux:input wire:model="productForm.version" label="Version" />
<flux:input wire:model="productForm.release_channel" label="Release/build" /><label
class="flex items-end gap-2 pb-2 text-sm"><input type="checkbox"
wire:model="productForm.is_active" class="rounded border-zinc-300"> Active</label>
<div class="md:col-span-full">
<flux:textarea wire:model="productForm.description" label="Description" rows="3" />
</div>
<div class="md:col-span-full flex gap-2">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save
product/service</flux:button>
<flux:button size="sm" type="button" wire:click="resetProductForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
</flux:button>
</div>
</form>
</x-slot:form>
<div class="grid gap-3 md:grid-cols-2 xl:grid-cols-3">
@forelse ($products as $product)
<div class="rounded-2xl border border-zinc-200 bg-white p-4 dark:border-zinc-700 dark:bg-zinc-900">
<h3 class="font-semibold">{{ $product->name }}</h3>
<p class="mt-1 text-sm text-zinc-500">{{ ucfirst($product->type) }} ·
{{ $product->version ?: 'No version' }} · {{ $product->tickets_count }} tickets</p>
<div class="mt-4 flex justify-end gap-2">
<flux:button size="sm" variant="primary"
wire:click="editProduct({{ $product->id }})"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-blue-600 !text-white hover:!bg-blue-700 focus:!ring-blue-400/60">Edit
</flux:button>
<flux:button size="sm" variant="danger"
wire:click="deleteProduct({{ $product->id }})"
wire:confirm="Delete this product/service?"
class="!h-8 !rounded-lg !px-2.5 !text-xs !font-semibold !bg-red-600 !text-white hover:!bg-red-700 focus:!ring-red-400/60">Delete
</flux:button>
</div>
</div>@empty<div
class="rounded-2xl border border-dashed border-zinc-300 p-8 text-center text-sm text-zinc-500 dark:border-zinc-700 md:col-span-2 xl:col-span-3">
No products or services yet.</div>
@endforelse
</div>
</x-helpdesk::settings-section>
@endif
</div>
@@ -0,0 +1,405 @@
@php
$helpdeskAttachmentAccept = collect(config('helpdesk.allowed_extensions', config('helpdesk.allowed_mimes', [])))
->filter(fn ($extension) => is_string($extension) && trim($extension) !== '')
->map(fn ($extension) => '.' . strtolower(ltrim(trim($extension), '.')))
->unique()
->implode(',');
@endphp
<div class="hd-helpdesk-surface space-y-6" dusk="helpdesk-ticket-create" x-data="{ helpdeskAttachmentsUploading: false }">
@include('helpdesk::partials.page-header', [
'eyebrow' => 'Helpdesk',
'title' => 'Create ticket',
'subtitle' =>
'Raise a new support request with priority, product/service, project, category, team and full details.',
])
<form
wire:submit.prevent="save"
x-on:submit.capture="
if (helpdeskAttachmentsUploading) {
$event.preventDefault();
return;
}
const editor = document.querySelector('[data-helpdesk-sync-target=&quot;body&quot;], [data-helpdesk-editor-model=&quot;body&quot;]');
const target = Array.from(document.querySelectorAll('textarea')).find(function (textarea) {
return textarea.getAttribute('wire:model.defer') === 'body'
|| textarea.getAttribute('wire:model') === 'body'
|| textarea.getAttribute('name') === 'body'
|| textarea.id === 'body';
});
const body = (editor?.innerText || editor?.textContent || editor?.value || '').trim();
if (target) {
target.value = body;
target.dispatchEvent(new Event('input', { bubbles: true }));
target.dispatchEvent(new Event('change', { bubbles: true }));
}
if ($wire) {
$wire.set('body', body, false);
}
$dispatch('helpdesk-editor-sync', { model: 'body', live: false });
"
class="helpdesk-ticket-form space-y-6"
>
<div class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-900 shadow-sm">
<div class="border-b border-zinc-700 bg-zinc-800/80 px-6 py-4">
<h2 class="text-lg font-semibold text-zinc-100">Ticket details</h2>
<p class="mt-1 text-sm text-zinc-400">
Mandatory fields are marked with <span class="helpdesk-required-star">*</span>.
Use the searchable lists to keep the ticket correctly routed.
</p>
</div>
<div class="grid gap-5 p-6 lg:grid-cols-3 xl:grid-cols-6">
<div class="lg:col-span-3 xl:col-span-6">
<label class="block text-sm font-semibold text-zinc-200" for="subject">
Subject <span class="helpdesk-required-star">*</span>
</label>
<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" autocomplete="off" />
@error('subject')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
@if ($companies->isNotEmpty())
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="company_id">
Company <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="company_id" dusk="ticket-company" data-helpdesk-select2 wire:model.defer="company_id" name="company_id"
data-placeholder="Select option" data-wire-model="company_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">Select company</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}" @selected((string) $company_id === (string) $company->id)>
{{ $company->name }}</option>
@endforeach
</select>
</div>
@error('company_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
@endif
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="board_id">
Board <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="board_id" data-helpdesk-select2 wire:model.defer="board_id" name="board_id" data-placeholder="Select option"
data-wire-model="board_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-board" dusk="ticket-board">
<option value="">No board</option>
@foreach ($boards as $board)
<option value="{{ $board->id }}" @selected((int) $board_id === (int) $board->id)>
{{ $board->name }}{{ $board->owner ? ' · ' . $board->owner->name : '' }}</option>
@endforeach
</select>
</div>
@error('board_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="priority_id">
Priority <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="priority_id" data-helpdesk-select2 wire:model.defer="priority_id" name="priority_id" data-placeholder="Select option"
data-wire-model="priority_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-priority" dusk="ticket-priority">
<option value="">Select priority</option>
@foreach ($priorities as $priority)
<option value="{{ $priority->id }}" @selected((string) $priority_id === (string) $priority->id)>{{ $priority->name }}
</option>
@endforeach
</select>
</div>
@error('priority_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="category_id">
Category <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="category_id" data-helpdesk-select2 wire:model.defer="category_id" name="category_id" data-placeholder="Select option"
data-wire-model="category_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">Select category</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}" @selected((string) $category_id === (string) $category->id)>{{ $category->name }}
</option>
@endforeach
</select>
</div>
@error('category_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="project_id">
Project <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="project_id" data-helpdesk-select2 wire:model.defer="project_id" name="project_id" data-placeholder="Select option"
data-wire-model="project_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">Select project</option>
@foreach ($projects as $project)
<option value="{{ $project->id }}" @selected((string) $project_id === (string) $project->id)>
{{ $project->title ?? $project->name }}</option>
@endforeach
</select>
</div>
@error('project_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="team_id">
Team <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="team_id" data-helpdesk-select2 wire:model.defer="team_id" name="team_id" data-placeholder="Select option"
data-wire-model="team_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">Select team</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}" @selected((string) $team_id === (string) $team->id)>{{ $team->name }}
</option>
@endforeach
</select>
</div>
@error('team_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="lg:col-span-3 xl:col-span-6">
<fieldset class="rounded-2xl border border-zinc-700 bg-zinc-950/70 p-4">
<div class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between">
<legend class="text-sm font-semibold text-zinc-200">
Tags
</legend>
<span class="text-xs text-zinc-500">
Optional · select all that apply
</span>
</div>
<div class="mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
@forelse ($tags as $tag)
<label for="tag_{{ $tag->id }}"
class="flex cursor-pointer items-center gap-3 rounded-xl border border-zinc-700 bg-zinc-900 px-4 py-3 text-sm font-medium text-zinc-200 transition hover:border-blue-500 hover:bg-zinc-800">
<input id="tag_{{ $tag->id }}" type="checkbox" wire:model.defer="tag_ids"
value="{{ $tag->id }}"
class="h-4 w-4 rounded border-zinc-600 bg-zinc-950 text-blue-600 focus:ring-blue-500">
<span class="truncate">
{{ $tag->name }}
</span>
</label>
@empty
<div
class="rounded-xl border border-dashed border-zinc-700 bg-zinc-900 px-4 py-3 text-sm text-zinc-400">
No tags are available.
</div>
@endforelse
</div>
@error('tag_ids')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
@error('tag_ids.*')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
</fieldset>
</div>
<div class="xl:col-span-2">
<x-helpdesk::date-picker id="due_at" model="due_at" label="Due date"
placeholder="Select due date" value="{{ $due_at }}" />
@error('due_at')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="lg:col-span-3 xl:col-span-6">
<x-helpdesk::html-editor
model="body"
label="Details"
rows="12"
placeholder="Describe the issue, expected outcome, steps to reproduce and any useful context..."
editor-dusk="ticket-body-editor"
/>
<p class="mt-2 flex items-center gap-2 text-xs font-medium text-zinc-400">
<i class="fa-solid fa-circle-info text-blue-400" aria-hidden="true"></i>
Rich formatting is available. Browser spelling suggestions appear by right-clicking or Ctrl-clicking red-underlined words.
</p>
</div>
<div class="lg:col-span-3 xl:col-span-6">
<div
wire:key="ticket-create-attachments-uploader"
class="rounded-2xl border border-zinc-700 bg-zinc-950/70 p-4"
x-data="{ progress: 0 }"
x-on:livewire-upload-start="helpdeskAttachmentsUploading = true"
x-on:livewire-upload-progress="progress = $event.detail.progress"
x-on:livewire-upload-finish="helpdeskAttachmentsUploading = false"
x-on:livewire-upload-error="helpdeskAttachmentsUploading = false"
x-on:livewire-upload-cancel="helpdeskAttachmentsUploading = false"
>
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<label class="block text-sm font-semibold text-zinc-200" for="attachments">
Attachments
</label>
<p class="mt-1 text-sm text-zinc-500">
Files are uploaded to Livewire temporary storage first. They are attached permanently only after the ticket is created.
</p>
</div>
<label for="attachments"
class="inline-flex cursor-pointer items-center justify-center gap-2 rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-950">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
<span>Add attachments</span>
</label>
</div>
<label for="attachments"
class="mt-4 flex cursor-pointer flex-col items-center justify-center rounded-2xl border border-dashed border-zinc-700 bg-zinc-900/70 px-4 py-8 text-center transition hover:border-blue-500 hover:bg-zinc-900">
<i class="fa-solid fa-cloud-arrow-up text-2xl text-blue-300" aria-hidden="true"></i>
<span class="mt-3 text-sm font-bold text-zinc-100">Click to choose files</span>
<span class="mt-1 text-xs text-zinc-500">Maximum {{ (int) config('helpdesk.max_upload_kb', 10240) }} KB per file.</span>
</label>
<div x-data class="rounded-2xl border border-zinc-700 bg-zinc-950/70 p-4">
<input
x-ref="attachmentsInput"
id="attachments"
type="file"
wire:model="attachments"
multiple
accept="{{ $helpdeskAttachmentAccept }}"
class="hidden"
wire:key="ticket-create-attachments-input"
dusk="ticket-create-attachments-input"
data-dusk="ticket-create-attachments-input"/>
<button
type="button"
x-on:click="$refs.attachmentsInput.click()"
class="inline-flex items-center justify-center gap-2 rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
Add attachments
</button>
<button
type="button"
x-on:click="$refs.attachmentsInput.click()"
class="mt-4 flex w-full flex-col items-center justify-center rounded-2xl border border-dashed border-zinc-700 bg-zinc-900/70 px-4 py-8 text-center">
<i class="fa-solid fa-cloud-arrow-up text-2xl text-blue-300" aria-hidden="true"></i>
<span class="mt-3 text-sm font-bold text-zinc-100">Click to choose files</span>
<span class="mt-1 text-xs text-zinc-500">
Maximum {{ (int) config('helpdesk.max_upload_kb', 10240) }} KB per file.
</span>
</button>
</div>
@if (count($attachments) > 0)
<div class="mt-4 grid gap-2 sm:grid-cols-2" dusk="ticket-create-selected-attachments">
@foreach ($attachments as $attachment)
<div class="flex items-center gap-3 rounded-xl border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs text-zinc-300" wire:key="ticket-create-selected-attachment-{{ $loop->index }}">
<i class="fa-regular fa-file-lines text-blue-300" aria-hidden="true"></i>
<span class="min-w-0 flex-1 truncate">{{ $attachment->getClientOriginalName() }}</span>
<span class="shrink-0 text-zinc-500">{{ number_format($attachment->getSize() / 1024, 1) }} KB</span>
</div>
@endforeach
</div>
@endif
<div x-show="helpdeskAttachmentsUploading" x-cloak
class="mt-4 rounded-xl border border-blue-500/30 bg-blue-500/10 px-4 py-3 text-sm font-medium text-blue-200">
<div class="flex items-center justify-between gap-3">
<span class="inline-flex items-center gap-2"><i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>Uploading attachments...</span>
<span x-text="progress + '%'"></span>
</div>
<div class="mt-3 h-2 overflow-hidden rounded-full bg-zinc-800">
<div class="h-full rounded-full bg-blue-500 transition-all" x-bind:style="`width: ${progress}%`"></div>
</div>
</div>
@error('attachments')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
@error('attachments.*')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
</div>
</div>
<div class="flex flex-col-reverse gap-2 border-t border-zinc-700 bg-zinc-900 px-6 py-4 sm:flex-row sm:items-center sm:justify-end">
<button type="button" wire:click="clearForm" wire:loading.attr="disabled" wire:target="clearForm"
class="inline-flex min-h-10 items-center justify-center rounded-lg bg-red-600 px-4 py-2 text-xs font-black text-white shadow-sm transition hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-400/70 disabled:cursor-not-allowed disabled:opacity-50"
data-dusk="ticket-create-clear" dusk="ticket-create-clear">
<i class="fa-solid fa-eraser mr-2" aria-hidden="true"></i>
<span wire:loading.remove wire:target="clearForm">Clear</span>
<span wire:loading wire:target="clearForm">Clearing...</span>
</button>
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate
class="inline-flex min-h-10 items-center justify-center rounded-lg bg-blue-600 px-4 py-2 text-xs font-black text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
data-dusk="ticket-create-cancel" dusk="ticket-create-cancel">
<i class="fa-solid fa-arrow-left mr-2" aria-hidden="true"></i>
Cancel
</a>
<button type="submit"
class="inline-flex min-h-10 items-center justify-center rounded-lg bg-emerald-600 px-4 py-2 text-xs font-black text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/70 disabled:cursor-not-allowed disabled:opacity-50"
data-dusk="ticket-create-submit" dusk="ticket-create-submit" wire:loading.attr="disabled" wire:target="save,attachments" x-bind:disabled="helpdeskAttachmentsUploading" wire:dirty.class="ring-2 ring-amber-400/40">
<i class="fa-regular fa-floppy-disk mr-2" aria-hidden="true"></i>
<span wire:loading.remove wire:target="save,attachments">Create ticket</span>
<span wire:loading wire:target="attachments">Uploading...</span>
<span wire:loading wire:target="save">Creating...</span>
</button>
</div>
</div>
</form>
</div>
@@ -0,0 +1,429 @@
@php
$helpdeskAttachmentAccept = collect(config('helpdesk.allowed_extensions', config('helpdesk.allowed_mimes', [])))
->filter(fn ($extension) => is_string($extension) && trim($extension) !== '')
->map(fn ($extension) => '.' . strtolower(ltrim(trim($extension), '.')))
->unique()
->implode(',');
@endphp
<div class="space-y-6">
@vite(['resources/css/app.css', 'resources/js/app.js'])
@include('helpdesk::partials.page-header', [
'eyebrow' => 'Helpdesk',
'title' => 'Edit Ticket',
'subtitle' =>
'Update ownership, assignment, workflow status, product/service, project, team, category, priority and ticket details.',
])
<form wire:submit.prevent="save" class="space-y-6">
<div class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-900 shadow-sm">
<div class="border-b border-zinc-700 bg-zinc-800/80 px-6 py-4">
<div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
<div>
<div class="flex flex-wrap items-center gap-3">
<h2 class="text-lg font-semibold text-zinc-100">
{{ $ticket->reference }} · Ticket controls
</h2>
<span
class="inline-flex items-center gap-2 rounded-xl border border-zinc-700 bg-zinc-900 px-3 py-1.5 text-sm font-medium text-zinc-200">
<i class="fa-regular fa-user text-zinc-400" aria-hidden="true"></i>
Owner:
<span class="font-semibold text-white">{{ $ticket->owner?->name ?? 'Unknown' }}</span>
</span>
</div>
<p class="mt-2 text-sm text-zinc-400">
Mandatory fields are marked with <span class="helpdesk-required-star">*</span>.
Assignment and status updates trigger configured workflow messages.
</p>
</div>
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate
class="inline-flex items-center justify-center rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700">
Back to ticket
</a>
</div>
</div>
<div class="grid gap-5 p-6 lg:grid-cols-3 xl:grid-cols-6">
<div class="lg:col-span-3 xl:col-span-6">
<label class="block text-sm font-semibold text-zinc-200" for="subject">
Subject <span class="helpdesk-required-star">*</span>
</label>
<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-edit-subject" dusk="ticket-edit-subject" />
@error('subject')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
@if ($companies->isNotEmpty())
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="company_id">
Company <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="company_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="company_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">Select company</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}" @selected((string) $company_id === (string) $company->id)>
{{ $company->name }}</option>
@endforeach
</select>
</div>
@error('company_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
@endif
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="board_id">Board</label>
<div class="mt-2" wire:ignore>
<select id="board_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="board_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-edit-board">
<option value="">No board</option>
@foreach ($boards as $board)
<option value="{{ $board->id }}" @selected((string) $board_id === (string) $board->id)>
{{ $board->name }}{{ $board->owner ? ' · ' . $board->owner->name : '' }}</option>
@endforeach
</select>
</div>
@error('board_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="status_id">
Status <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="status_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="status_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-edit-status">
<option value="">No status</option>
@foreach ($statuses as $status)
<option value="{{ $status->id }}" @selected((string) $status_id === (string) $status->id)>{{ $status->name }}
</option>
@endforeach
</select>
</div>
@error('status_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="priority_id">
Priority <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="priority_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="priority_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-edit-priority">
<option value="">Select priority</option>
@foreach ($priorities as $priority)
<option value="{{ $priority->id }}" @selected((string) $priority_id === (string) $priority->id)>{{ $priority->name }}
</option>
@endforeach
</select>
</div>
@error('priority_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="agent_id">Assigned agent</label>
<div class="mt-2">
<select id="agent_id" wire:model.live="agent_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500"
data-dusk="ticket-edit-agent">
<option value="">Unassigned</option>
@forelse ($agents as $agent)
<option value="{{ $agent->id }}">{{ $agent->name }} · {{ $agent->email }}
</option>
@empty
<option value="" disabled>No users available for assignment</option>
@endforelse
</select>
</div>
@error('agent_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="category_id">
Category <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="category_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="category_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">No category</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}" @selected((string) $category_id === (string) $category->id)>
{{ $category->name }}</option>
@endforeach
</select>
</div>
@error('category_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="project_id">
Project <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="project_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="project_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">No project</option>
@foreach ($projects as $project)
<option value="{{ $project->id }}" @selected((string) $project_id === (string) $project->id)>
{{ $project->title ?? $project->name }}</option>
@endforeach
</select>
</div>
@error('project_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="xl:col-span-2">
<label class="block text-sm font-semibold text-zinc-200" for="team_id">
Team <span class="helpdesk-required-star">*</span>
</label>
<div class="mt-2" wire:ignore>
<select id="team_id" data-helpdesk-select2 data-placeholder="Select option"
data-wire-model="team_id"
class="block w-full rounded-xl border-zinc-700 bg-zinc-950 text-zinc-100 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option value="">No team</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}" @selected((string) $team_id === (string) $team->id)>{{ $team->name }}
</option>
@endforeach
</select>
</div>
@error('team_id')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="lg:col-span-3 xl:col-span-6">
<fieldset class="rounded-2xl border border-zinc-700 bg-zinc-950/70 p-4">
<div class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between">
<legend class="text-sm font-semibold text-zinc-200">
Tags
</legend>
<span class="text-xs text-zinc-500">
Optional · select all that apply
</span>
</div>
<div class="mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
@forelse ($tags as $tag)
<label for="tag_{{ $tag->id }}"
class="flex cursor-pointer items-center gap-3 rounded-xl border border-zinc-700 bg-zinc-900 px-4 py-3 text-sm font-medium text-zinc-200 transition hover:border-blue-500 hover:bg-zinc-800">
<input id="tag_{{ $tag->id }}" type="checkbox" wire:model.defer="tag_ids"
value="{{ $tag->id }}"
class="h-4 w-4 rounded border-zinc-600 bg-zinc-950 text-blue-600 focus:ring-blue-500">
<span class="truncate">
{{ $tag->name }}
</span>
</label>
@empty
<div
class="rounded-xl border border-dashed border-zinc-700 bg-zinc-900 px-4 py-3 text-sm text-zinc-400">
No tags are available.
</div>
@endforelse
</div>
@error('tag_ids')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
@error('tag_ids.*')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
</fieldset>
</div>
<div class="xl:col-span-2">
<x-helpdesk::date-picker id="due_at" model="due_at" label="Due date"
placeholder="Select due date" value="{{ $due_at }}" />
@error('due_at')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="lg:col-span-3 xl:col-span-6">
<x-helpdesk::html-editor
model="body"
label="Details *"
rows="10"
placeholder="Update the ticket details..."
editor-dusk="ticket-edit-body-editor"
/>
@error('body')
<p class="mt-2 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div class="lg:col-span-3 xl:col-span-6">
<div
class="overflow-hidden rounded-2xl border border-blue-500/30 bg-zinc-950/70 shadow-sm shadow-blue-950/30">
<div class="bg-gradient-to-r from-blue-700 via-sky-600 to-emerald-600 px-5 py-4 text-white">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<label
class="flex items-center gap-2 text-base font-extrabold text-white drop-shadow-sm"
for="attachments">
<span
class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-white/15 ring-1 ring-white/25">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
</span>
Attachments
</label>
<p class="mt-2 max-w-2xl text-sm font-medium text-blue-50/90">
Add screenshots, documents, logs or supporting files to help resolve the ticket.
</p>
</div>
<label for="attachments"
class="inline-flex cursor-pointer items-center justify-center gap-2 rounded-xl bg-white px-4 py-2.5 text-sm font-bold text-blue-700 shadow-sm transition hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-white/80 focus:ring-offset-2 focus:ring-offset-blue-700">
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span>Add attachments</span>
</label>
</div>
</div>
<div class="p-4">
<input id="attachments" type="file" wire:model="attachments" multiple accept="{{ $helpdeskAttachmentAccept }}"
class="sr-only">
<div wire:loading.flex wire:target="attachments"
class="mt-4 items-center gap-2 rounded-xl border border-blue-500/30 bg-blue-500/10 px-4 py-3 text-sm font-medium text-blue-200">
<i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>
Uploading attachments...
</div>
@if ($ticket->attachments->isNotEmpty())
<div class="mt-4 space-y-3">
<div
class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3">
<h3
class="inline-flex items-center gap-2 text-sm font-extrabold text-emerald-200">
<span
class="inline-flex h-7 w-7 items-center justify-center rounded-lg bg-emerald-500 text-white shadow-sm">
<i class="fa-solid fa-folder-open" aria-hidden="true"></i>
</span>
Existing attachments
</h3>
<span
class="inline-flex items-center gap-2 rounded-full bg-emerald-100 px-3 py-1 text-xs font-extrabold text-emerald-800 shadow-sm ring-1 ring-emerald-300/70">
<span class="inline-flex h-2 w-2 rounded-full bg-emerald-500"></span>
{{ $ticket->attachments->count() }} file(s)
</span>
</div>
@foreach ($ticket->attachments as $attachment)
<div
class="flex flex-col gap-3 rounded-xl border border-zinc-700 bg-zinc-900 p-3 text-sm sm:flex-row sm:items-center sm:justify-between">
<a href="{{ route('helpdesk.attachments.download', $attachment->id) }}"
target="_blank"
class="min-w-0 font-medium text-blue-300 hover:text-blue-200">
<i class="fa-regular fa-file mr-2" aria-hidden="true"></i>
{{ $attachment->original_name ?? ($attachment->original_filename ?? ($attachment->filename ?? ($attachment->file_name ?? basename($attachment->path ?? ($attachment->file_path ?? ''))))) }}
</a>
<button type="button"
wire:click="removeAttachment({{ $attachment->id }})"
wire:confirm="Remove this attachment?"
class="inline-flex items-center justify-center rounded-lg bg-red-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-red-700">
Remove
</button>
</div>
@endforeach
</div>
@endif
@if ($attachments !== [])
<div
class="mt-4 rounded-xl border border-blue-500/30 bg-blue-500/10 px-4 py-3 text-sm text-blue-100">
{{ count($attachments) }} new attachment(s) selected. Save the ticket to attach
them.
</div>
@endif
@error('attachments')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
@error('attachments.*')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
</div>
</div>
</div>
<div class="flex items-center justify-end gap-3 border-t border-zinc-700 bg-zinc-900 px-6 py-4">
<button type="button" wire:click="clearForm"
class="rounded-xl bg-red-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-700">
Clear
</button>
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate
class="rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700">
Cancel
</a>
<button type="submit"
class="inline-flex items-center gap-2 rounded-xl bg-green-600 px-5 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-700 disabled:cursor-not-allowed disabled:opacity-50"
data-dusk="ticket-edit-submit" wire:loading.attr="disabled">
<i class="fa-regular fa-floppy-disk" aria-hidden="true"></i>
<span wire:loading.remove>Save Ticket</span>
<span wire:loading>Saving...</span>
</button>
</div>
</div>
</form>
</div>
@@ -0,0 +1,219 @@
<div class="hd-helpdesk-surface space-y-6" dusk="helpdesk-ticket-index">
<div
class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">Ticket management</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">Active tickets</h1>
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">Search, triage and manage support requests across
companies, projects, teams, priorities and statuses.</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('helpdesk.index') }}" wire:navigate class="hd-btn hd-btn-blue">
<i class="fa-solid fa-chart-bar" aria-hidden="true"></i>
<span>Dashboard</span>
</a>
<a href="{{ route('helpdesk.tickets.create') }}" wire:navigate class="hd-btn hd-btn-green">
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span>New Ticket</span>
</a>
</div>
</div>
</div>
</div>
<div class="rounded-2xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="grid gap-4 md:grid-cols-4">
<flux:input wire:model.live.debounce.350ms="search" icon="magnifying-glass"
placeholder="Search reference, subject or body" />
<flux:select wire:model.live="scope">
<option value="open">Open tickets</option>
<option value="closed">Closed tickets</option>
<option value="all">All tickets</option>
</flux:select>
<flux:select wire:model.live="status">
<option value="">All statuses</option>
@foreach ($statuses as $status)
<option value="{{ $status->id }}">{{ $status->name }}</option>
@endforeach
</flux:select>
<flux:select wire:model.live="priority">
<option value="">All priorities</option>
@foreach ($priorities as $priority)
<option value="{{ $priority->id }}">{{ $priority->name }}</option>
@endforeach
</flux:select>
</div>
</div>
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div wire:loading.flex
class="items-center gap-2 border-b border-zinc-200 bg-blue-50 px-4 py-3 text-sm text-blue-800 dark:border-zinc-700 dark:bg-blue-950 dark:text-blue-200">
<flux:icon.arrow-path class="size-4 animate-spin" /> Refreshing tickets...
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead
class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-300">
<tr>
<th class="px-4 py-3">Reference</th>
<th class="px-4 py-3">Subject</th>
<th class="px-4 py-3">Status</th>
<th class="px-4 py-3">Priority</th>
<th class="px-4 py-3">Agent</th>
<th class="px-4 py-3 text-center">Files</th>
<th class="px-4 py-3">Last activity</th>
<th class="px-4 py-3 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($tickets as $ticket)
<tr class="hover:bg-zinc-50 dark:hover:bg-zinc-800/70">
<td class="whitespace-nowrap px-4 py-3 font-mono text-xs">
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate
class="font-semibold text-blue-700 hover:underline dark:text-blue-300">
{{ $ticket->reference }}
</a>
</td>
<td class="px-4 py-3">
<div class="font-medium text-zinc-900 dark:text-zinc-100">{{ $ticket->subject }}</div>
<div class="text-xs text-zinc-500">
{{ $ticket->category?->name ?? 'No category' }}
@if ($ticket->project)
· {{ $ticket->project->title }}
@endif
@if ($ticket->team)
· {{ $ticket->team->name }}
@endif
</div>
</td>
<td class="px-4 py-3">
<x-helpdesk::colour-badge :color="$ticket->status?->color ?? 'zinc'">
{{ $ticket->status?->name ?? 'No status' }}
</x-helpdesk::colour-badge>
</td>
<td class="px-4 py-3">
<x-helpdesk::colour-badge :color="$ticket->priority?->color ?? 'zinc'">
{{ $ticket->priority?->name ?? 'No priority' }}
</x-helpdesk::colour-badge>
</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">
{{ $ticket->agent_name ?? 'Unassigned' }}
</td>
<td class="whitespace-nowrap px-4 py-3 text-center">
@if (($ticket->attachments_count ?? 0) > 0)
<span
class="inline-flex items-center justify-center gap-1 rounded-full border border-blue-200 bg-blue-50 px-2.5 py-1 text-xs font-black text-blue-700 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200"
title="{{ $ticket->attachments_count }} attachment{{ $ticket->attachments_count === 1 ? '' : 's' }}">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
<span>{{ $ticket->attachments_count }}</span>
<span
class="sr-only">attachment{{ $ticket->attachments_count === 1 ? '' : 's' }}</span>
</span>
@else
<span
class="inline-flex items-center justify-center rounded-full border border-zinc-200 bg-zinc-50 px-2.5 py-1 text-xs font-bold text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-500"
title="No attachments">
<i class="fa-regular fa-circle" aria-hidden="true"></i>
<span class="sr-only">No attachments</span>
</span>
@endif
</td>
<td class="whitespace-nowrap px-4 py-3 text-zinc-500">
{{ $ticket->last_activity_at?->diffForHumans() ?? $ticket->created_at->diffForHumans() }}
</td>
<td class="whitespace-nowrap px-4 py-3 text-right">
@can('delete', $ticket)
<button type="button" wire:click="askToDeleteTicket({{ $ticket->id }})"
wire:loading.attr="disabled" wire:target="askToDeleteTicket({{ $ticket->id }})"
class="hd-btn hd-btn-sm hd-btn-red disabled:cursor-not-allowed disabled:opacity-60"
title="Delete {{ $ticket->reference }}" dusk="delete-ticket-{{ $ticket->id }}">
<i class="fa-solid fa-trash" aria-hidden="true"></i>
<span>Delete</span>
</button>
@endcan
</td>
</tr>
@empty
<tr>
<td colspan="8" class="px-4 py-12 text-center text-zinc-500">No tickets matched your
filters.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="border-t border-zinc-200 p-4 dark:border-zinc-700">
{{ $tickets->links() }}
</div>
</div>
@if ($deleteModalOpen)
<div class="fixed inset-0 z-[9998] flex items-center justify-center bg-black/75 px-4 py-6 backdrop-blur-sm"
role="dialog" aria-modal="true" aria-labelledby="delete-ticket-modal-title"
wire:key="ticket-delete-modal-{{ $pendingDeleteTicketId ?? 'none' }}"
dusk="delete-ticket-confirmation-modal">
<div
class="w-full max-w-lg overflow-hidden rounded-3xl border border-red-500/30 bg-zinc-950 text-zinc-100 shadow-2xl">
<div class="border-b border-red-500/20 bg-red-950/40 px-6 py-5">
<div class="flex items-start gap-4">
<span
class="grid h-12 w-12 shrink-0 place-items-center rounded-2xl bg-red-600 text-white shadow-lg shadow-red-950/40">
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h2 id="delete-ticket-modal-title" class="text-xl font-black tracking-tight text-white">
Delete ticket?
</h2>
<p class="mt-1 text-sm leading-6 text-red-100/90">
This will delete <span
class="font-mono font-bold">{{ $pendingDeleteTicketReference }}</span>. This
action cannot be undone.
</p>
</div>
</div>
</div>
<div class="space-y-3 px-6 py-5">
@if ($pendingDeleteTicketSubject)
<div class="rounded-2xl border border-zinc-800 bg-zinc-900 px-4 py-3">
<p class="text-xs font-bold uppercase tracking-[0.22em] text-zinc-500">Ticket subject</p>
<p class="mt-1 text-sm font-semibold text-zinc-100">{{ $pendingDeleteTicketSubject }}</p>
</div>
@endif
<p class="text-sm leading-6 text-zinc-300">
Confirm only if this ticket was created in error or is no longer required.
</p>
</div>
<div
class="flex flex-col-reverse gap-3 border-t border-zinc-800 bg-zinc-900/80 px-6 py-4 sm:flex-row sm:justify-end">
<button type="button" wire:click="cancelTicketDelete" class="hd-btn hd-btn-sm hd-btn-blue"
dusk="cancel-delete-ticket">
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
<span>Cancel</span>
</button>
<button type="button" wire:click="confirmTicketDelete" wire:loading.attr="disabled"
wire:target="confirmTicketDelete"
class="hd-btn hd-btn-sm hd-btn-red disabled:cursor-not-allowed disabled:opacity-60"
dusk="confirm-delete-ticket">
<i class="fa-solid fa-trash" aria-hidden="true"></i>
<span wire:loading.remove wire:target="confirmTicketDelete">Delete ticket</span>
<span wire:loading wire:target="confirmTicketDelete">Deleting...</span>
</button>
</div>
</div>
</div>
@endif
</div>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,151 @@
<div
class="mb-4 rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-950"
data-helpdesk-ticket-timer
>
@php
$hasRunningTimer = $activeTimer && $activeTimer->ended_at === null;
$startedAtIso = $hasRunningTimer ? $activeTimer->started_at?->toIso8601String() : null;
$startedAtDisplay = $hasRunningTimer ? $activeTimer->started_at?->format('d M Y H:i') : null;
@endphp
<div class="flex flex-col gap-4">
<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div class="flex min-w-0 items-start gap-3">
<span class="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-blue-600 text-white shadow-sm">
<i class="fa-solid fa-stopwatch text-sm" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h3 class="text-sm font-black text-zinc-950 dark:text-zinc-100">
Ticket timer
</h3>
<p class="mt-1 text-xs font-semibold text-zinc-600 dark:text-zinc-300">
Record focused work against this ticket.
</p>
</div>
</div>
@if ($hasRunningTimer)
<div class="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-right shadow-sm dark:border-emerald-900 dark:bg-emerald-950/40">
<div class="flex items-center justify-end gap-2 text-[0.65rem] font-black uppercase tracking-[0.16em] text-emerald-700 dark:text-emerald-300">
<span class="h-2 w-2 rounded-full bg-emerald-500"></span>
Running
</div>
<div
class="mt-1 font-mono text-2xl font-black leading-none text-emerald-950 dark:text-emerald-100"
data-helpdesk-live-elapsed
data-helpdesk-started-at="{{ $startedAtIso }}"
data-dusk="ticket-running-time"
>
{{ gmdate('H:i:s', max(0, (int) $elapsedSeconds)) }}
</div>
<p class="mt-1 text-[0.68rem] font-bold text-emerald-700 dark:text-emerald-300">
Started {{ $startedAtDisplay }}
</p>
</div>
@endif
</div>
@if ($message)
<div class="rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100">
{{ $message }}
</div>
@endif
@error('timer')
<div class="rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs font-bold text-red-800 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100">
{{ $message }}
</div>
@enderror
<div class="space-y-2">
<label class="block text-xs font-bold text-zinc-800 dark:text-zinc-100" for="ticket_timer_description">
Timer note
</label>
<textarea
id="ticket_timer_description"
wire:model.defer="description"
rows="2"
placeholder="Optional work note"
class="block w-full rounded-lg border border-zinc-300 bg-white p-3 text-sm font-semibold text-zinc-900 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100"
data-dusk="ticket-timer-description"
></textarea>
</div>
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<p class="text-xs font-semibold text-zinc-500 dark:text-zinc-400">
{{ $hasRunningTimer ? 'End the timer to add the elapsed time to the ticket.' : 'Start a timer when work begins. Only one active timer is allowed.' }}
</p>
@if ($hasRunningTimer)
<button
type="button"
wire:click="endTimer"
wire:loading.attr="disabled"
wire:target="endTimer"
class="inline-flex min-w-[9.5rem] shrink-0 items-center justify-center whitespace-nowrap rounded-md bg-red-600 px-4 py-2 text-sm font-black text-white shadow-sm transition hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:focus:ring-offset-zinc-950"
data-dusk="end-ticket-timer"
>
<i class="fa-solid fa-stop mr-2" aria-hidden="true"></i>
<span wire:loading.remove wire:target="endTimer">End timer</span>
<span wire:loading wire:target="endTimer">Ending...</span>
</button>
@else
<button
type="button"
wire:click="startTimer"
wire:loading.attr="disabled"
wire:target="startTimer"
class="inline-flex min-w-[9.5rem] shrink-0 items-center justify-center whitespace-nowrap rounded-md bg-blue-600 px-4 py-2 text-sm font-black text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:focus:ring-offset-zinc-950"
data-dusk="start-ticket-timer"
>
<i class="fa-solid fa-play mr-2 text-xs" aria-hidden="true"></i>
<span wire:loading.remove wire:target="startTimer">Start timer</span>
<span wire:loading wire:target="startTimer">Starting...</span>
</button>
@endif
</div>
</div>
<script>
(() => {
if (window.helpdeskTicketTimerDisplayBooted === true) {
return;
}
window.helpdeskTicketTimerDisplayBooted = true;
const formatElapsed = (totalSeconds) => {
const seconds = Math.max(0, Number.parseInt(totalSeconds, 10) || 0);
const hours = String(Math.floor(seconds / 3600)).padStart(2, '0');
const minutes = String(Math.floor((seconds % 3600) / 60)).padStart(2, '0');
const remainingSeconds = String(seconds % 60).padStart(2, '0');
return `${hours}:${minutes}:${remainingSeconds}`;
};
const updateTimers = () => {
document.querySelectorAll('[data-helpdesk-live-elapsed][data-helpdesk-started-at]').forEach((timer) => {
const startedAt = Date.parse(timer.getAttribute('data-helpdesk-started-at') || '');
if (!Number.isFinite(startedAt)) {
timer.textContent = '00:00:00';
return;
}
timer.textContent = formatElapsed(Math.floor((Date.now() - startedAt) / 1000));
});
};
updateTimers();
window.setInterval(updateTimers, 1000);
document.addEventListener('livewire:navigated', updateTimers);
document.addEventListener('livewire:update', updateTimers);
document.addEventListener('livewire:updated', updateTimers);
})();
</script>
</div>
@@ -0,0 +1,327 @@
@php
$helpdeskAttachmentAccept = collect(config('helpdesk.allowed_extensions', config('helpdesk.allowed_mimes', [])))
->filter(fn ($extension) => is_string($extension) && trim($extension) !== '')
->map(fn ($extension) => '.' . strtolower(ltrim(trim($extension), '.')))
->unique()
->implode(',');
@endphp
@props(['comments', 'level' => 0, 'ticket' => null, 'canSeeInternalNotes' => false])
<div class="space-y-3" data-helpdesk-thread-level="{{ (int) $level }}">
@foreach ($comments as $comment)
@php
$commentUser = $comment->relationLoaded('user') ? $comment->getRelation('user') : null;
$commentAttachments = $comment->relationLoaded('attachments')
? $comment->getRelation('attachments')
: collect();
$commentReplies = $comment->relationLoaded('replies') ? $comment->getRelation('replies') : collect();
$replyFormId = 'helpdesk-reply-form-' . $comment->id;
$currentTicket = $ticket ?? ($comment->ticket ?? null);
$replyCount = $commentReplies->count();
$isInternal = (bool) $comment->is_internal;
$borderClass = $isInternal
? 'border-purple-400/70 dark:border-purple-600/70'
: 'border-zinc-200 dark:border-zinc-700';
$railClass = $isInternal
? 'bg-purple-500'
: ((int) $level % 3 === 0
? 'bg-red-500'
: ((int) $level % 3 === 1
? 'bg-blue-500'
: 'bg-emerald-500'));
$commentSubject = trim((string) ($comment->subject ?? ''));
if ($commentSubject === '') {
$plainSubject = trim((string) ($comment->body_text ?? strip_tags((string) $comment->body)));
$commentSubject = Str::limit($plainSubject !== '' ? $plainSubject : 'Response', 72);
}
if ($isInternal && !Str::startsWith(Str::lower($commentSubject), 'internal')) {
$commentSubject = 'Internal note';
}
$renderedBody = html_entity_decode((string) $comment->body, ENT_QUOTES | ENT_HTML5, 'UTF-8');
while (
str_contains($renderedBody, '&lt;') ||
str_contains($renderedBody, '&gt;') ||
str_contains($renderedBody, '&amp;lt;')
) {
$decodedBody = html_entity_decode($renderedBody, ENT_QUOTES | ENT_HTML5, 'UTF-8');
if ($decodedBody === $renderedBody) {
break;
}
$renderedBody = $decodedBody;
}
if ($currentTicket !== null) {
$renderedBody = strtr($renderedBody, [
'{{ ticket . reference }}' => (string) e((string) ($currentTicket->reference ?? '')),
'{{ ticket . subject }}' => (string) e((string) ($currentTicket->subject ?? '')),
'{{ ticket . status }}' => (string) e((string) ($currentTicket->status?->name ?? '')),
'{{ ticket . priority }}' => (string) e((string) ($currentTicket->priority?->name ?? '')),
'{{ ticket . category }}' => (string) e((string) ($currentTicket->category?->name ?? '')),
'{{ ticket . project }}' => (string) e((string) ($currentTicket->project?->title ?? '')),
'{{ ticket . team }}' => (string) e((string) ($currentTicket->team?->name ?? '')),
'{{ requester . name }}' => (string) e(
(string) ($currentTicket->owner?->name ?? ($currentTicket->user?->name ?? '')),
),
'{{ agent . name }}' => (string) e((string) ($currentTicket->agent?->name ?? '')),
'{{ actor . name }}' => (string) e((string) ($commentUser?->name ?? '')),
'{{ ticket . url }}' => (string) e(
route('helpdesk.tickets.show', ['ticket' => $currentTicket->getKey()]),
),
]);
}
$containsHtml = $renderedBody !== strip_tags($renderedBody);
$renderedBody = preg_replace('/<\s*(script|style)[^>]*>.*?<\s*\/\s*\1\s*>/is', '', $renderedBody) ?: '';
$renderedBody = preg_replace('/\s+on[a-z]+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $renderedBody) ?: '';
$renderedBody = preg_replace('/javascript\s*:/i', '', $renderedBody) ?: '';
$renderedBody = strip_tags(
$renderedBody,
'<p><br><strong><b><em><i><u><ul><ol><li><blockquote><pre><code><a>',
);
$renderedBody = $containsHtml ? $renderedBody : nl2br(e($renderedBody));
@endphp
@if (!$isInternal || $canSeeInternalNotes)
<details class="group rounded-2xl border {{ $borderClass }} bg-white shadow-sm transition dark:bg-zinc-900"
data-helpdesk-comment-card
data-helpdesk-comment-text="{{ e(Str::lower($commentSubject . ' ' . strip_tags((string) $comment->body) . ' ' . ($comment->body_text ?? '') . ' ' . ($commentUser?->name ?? '') . ' ' . ($comment->unid ?? '') . ' ' . ($comment->guid ?? ''))) }}"
style="margin-left: {{ min((int) $level, 4) * 1.25 }}rem">
<summary class="flex cursor-pointer list-none items-start gap-3 rounded-2xl p-4 marker:hidden">
<span class="mt-1 inline-flex h-12 w-2 shrink-0 rounded-full {{ $railClass }}"
aria-hidden="true"></span>
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-center gap-2">
<span
class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-zinc-100 text-zinc-700 ring-1 ring-zinc-200 dark:bg-zinc-800 dark:text-zinc-100 dark:ring-zinc-700">
<i class="fa-solid {{ $isInternal ? 'fa-note-sticky' : 'fa-envelope' }}"
aria-hidden="true"></i>
</span>
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-center gap-2">
<span
class="truncate text-base font-extrabold text-zinc-900 dark:text-zinc-100">{{ $commentSubject }}</span>
<span
class="rounded-full bg-zinc-100 px-2.5 py-1 text-[11px] font-extrabold text-zinc-700 dark:bg-zinc-800 dark:text-zinc-100">{{ $replyCount }}
{{ $replyCount === 1 ? 'reply' : 'replies' }}</span>
@if ($commentAttachments->isNotEmpty())
<span
class="rounded-full bg-emerald-100 px-2.5 py-1 text-[11px] font-extrabold text-emerald-800 dark:bg-emerald-950 dark:text-emerald-100">
<i class="fa-solid fa-paperclip mr-1"
aria-hidden="true"></i>{{ $commentAttachments->count() }}
</span>
@endif
@if ($isInternal)
<span
class="rounded-full bg-purple-600 px-2.5 py-1 text-[11px] font-extrabold uppercase tracking-wide text-white">Internal</span>
@else
<span
class="rounded-full bg-emerald-600 px-2.5 py-1 text-[11px] font-extrabold uppercase tracking-wide text-white">Public</span>
@endif
</div>
<div
class="mt-1 flex flex-wrap items-center gap-2 text-xs font-semibold text-zinc-500 dark:text-zinc-400">
<span>{{ $commentUser?->name ?? 'Unknown user' }}</span>
<span aria-hidden="true">•</span>
<span>{{ $comment->created_at?->format('d M Y H:i') }}</span>
</div>
</div>
</div>
</div>
<span
class="mt-1 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-zinc-100 text-zinc-600 transition group-open:rotate-90 dark:bg-zinc-800 dark:text-zinc-200">
<i class="fa-solid fa-chevron-right text-xs" aria-hidden="true"></i>
</span>
</summary>
<div class="border-t border-zinc-100 px-4 pb-4 pt-3 dark:border-zinc-800">
<div class="prose prose-sm max-w-none dark:prose-invert">
{!! $renderedBody !!}
</div>
@if ($commentAttachments->isNotEmpty())
<div
class="mt-4 rounded-xl border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-700 dark:bg-zinc-950/60">
<div
class="mb-2 flex items-center gap-2 text-xs font-extrabold uppercase tracking-wide text-zinc-500">
<i class="fa-solid fa-paperclip text-blue-500" aria-hidden="true"></i>
Attachments
</div>
<div class="flex flex-wrap gap-2">
@foreach ($commentAttachments as $attachment)
<a href="{{ route('helpdesk.attachments.download', $attachment->id) }}"
target="_blank"
class="inline-flex items-center gap-2 rounded-lg border border-blue-200 bg-white px-3 py-2 text-xs font-bold text-blue-700 shadow-sm hover:bg-blue-50 dark:border-blue-900 dark:bg-zinc-900 dark:text-blue-200 dark:hover:bg-blue-950/50">
<i class="fa-solid fa-thumbtack" aria-hidden="true"></i>
{{ $attachment->original_name ?? ($attachment->original_filename ?? ($attachment->filename ?? ($attachment->file_name ?? basename($attachment->path ?? ($attachment->file_path ?? ''))))) }}
</a>
@endforeach
</div>
</div>
@endif
@if ($currentTicket !== null)
<div class="mt-4 flex flex-wrap justify-end gap-2">
<button type="button" dusk="reply-to-comment-{{ $comment->id }}"
data-helpdesk-reply-toggle="{{ $replyFormId }}"
class="inline-flex items-center justify-center rounded-lg bg-blue-600 px-3 py-2 text-xs font-bold text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
<i class="fa-solid fa-reply mr-2" aria-hidden="true"></i>
Respond
</button>
@if (auth()->user()?->isMpbaPlatformAdmin())
<form method="POST"
action="{{ route('helpdesk.tickets.comments.destroy', [$currentTicket, $comment]) }}"
onsubmit="return confirm('Delete this response? This will remove it from the visible conversation but keep the replication identity/audit trail.');">
@csrf
@method('DELETE')
<button type="submit" dusk="delete-comment-{{ $comment->id }}"
class="inline-flex items-center justify-center rounded-lg bg-red-600 px-3 py-2 text-xs font-bold text-white shadow-sm transition hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-400/70">
<i class="fa-solid fa-trash-can mr-2" aria-hidden="true"></i>
Delete
</button>
</form>
@endif
</div>
<form id="{{ $replyFormId }}" method="POST"
action="{{ route('helpdesk.tickets.comments.store', $currentTicket) }}"
enctype="multipart/form-data"
class="mt-4 hidden rounded-xl border border-red-200 bg-red-50/60 p-4 dark:border-red-900 dark:bg-red-950/20"
data-helpdesk-comment-form>
@csrf
<input type="hidden" name="parent_id" value="{{ $comment->id }}">
<div class="mb-3">
<label for="reply-subject-{{ $comment->id }}"
class="mb-2 block text-sm font-bold text-zinc-700 dark:text-zinc-200">Subject</label>
<input id="reply-subject-{{ $comment->id }}" name="subject"
value="{{ old('subject', 'RE: ' . $commentSubject) }}"
spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"
class="block w-full rounded-xl border border-zinc-300 bg-white p-3 text-sm font-semibold text-zinc-900 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
</div>
<label for="reply-body-{{ $comment->id }}"
class="mb-2 block text-sm font-bold text-zinc-700 dark:text-zinc-200">Response to
response</label>
<div class="mb-2 flex flex-wrap gap-2"
data-helpdesk-html-toolbar="reply-body-{{ $comment->id }}">
<button type="button" data-helpdesk-tag="strong"
class="rounded-lg border px-2 py-1 text-xs font-black">B</button>
<button type="button" data-helpdesk-tag="em"
class="rounded-lg border px-2 py-1 text-xs italic">I</button>
<button type="button" data-helpdesk-tag="ul"
class="rounded-lg border px-2 py-1 text-xs">List</button>
<button type="button" data-helpdesk-wrap="<blockquote>"
data-helpdesk-wrap-end="</blockquote>"
class="rounded-lg border px-2 py-1 text-xs">Quote</button>
<button type="button" data-helpdesk-wrap="<code>" data-helpdesk-wrap-end="</code>"
class="rounded-lg border px-2 py-1 text-xs">Code</button>
</div>
<textarea spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text" id="reply-body-{{ $comment->id }}" dusk="reply-body-{{ $comment->id }}" name="commentBody" rows="4"
required
class="block w-full rounded-xl border border-zinc-300 bg-white p-3 text-sm text-zinc-900 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
placeholder="Write a threaded Lotus Notes-style response..."></textarea>
<div class="mt-4 rounded-xl border border-zinc-200 bg-white p-3 shadow-sm dark:border-zinc-700 dark:bg-zinc-950">
<p class="text-xs font-extrabold uppercase tracking-[0.16em] text-zinc-500 dark:text-zinc-400">Visibility</p>
@can('update', $currentTicket)
@if ($canSeeInternalNotes)
<div class="mt-3 grid gap-3 sm:grid-cols-2">
<label class="flex cursor-pointer items-start gap-3 rounded-xl border border-emerald-300 bg-emerald-50 p-3 text-emerald-950 shadow-sm transition hover:border-emerald-400 hover:bg-emerald-100/80 focus-within:border-emerald-500 focus-within:bg-emerald-100/80 focus-within:ring-2 focus-within:ring-emerald-400/30 active:bg-emerald-100/80 dark:border-emerald-900 dark:bg-emerald-950/60 dark:text-emerald-100 dark:hover:border-emerald-700 dark:hover:bg-emerald-900/50 dark:focus-within:bg-emerald-900/50">
<input type="radio" name="internal" value="0" checked class="mt-1 border-emerald-400 text-emerald-600 focus:ring-emerald-500">
<span>
<span class="block text-sm font-extrabold">Public reply</span>
<span class="mt-1 block text-xs font-semibold opacity-80">Visible to the requester and counts towards SLA.</span>
</span>
</label>
<label class="flex cursor-pointer items-start gap-3 rounded-xl border border-purple-300 bg-purple-50 p-3 text-purple-950 shadow-sm transition hover:border-purple-400 hover:bg-purple-100/80 focus-within:border-purple-500 focus-within:bg-purple-100/80 focus-within:ring-2 focus-within:ring-purple-400/30 active:bg-purple-100/80 dark:border-purple-900 dark:bg-purple-950/60 dark:text-purple-100 dark:hover:border-purple-700 dark:hover:bg-purple-900/50 dark:focus-within:bg-purple-900/50">
<input type="radio" name="internal" value="1" class="mt-1 border-purple-400 text-purple-600 focus:ring-purple-500">
<span>
<span class="block text-sm font-extrabold">Internal note</span>
<span class="mt-1 block text-xs font-semibold opacity-80">Support-only note. Does not count as public SLA response.</span>
</span>
</label>
</div>
@else
<input type="hidden" name="internal" value="0">
<div class="mt-3 rounded-xl border border-emerald-300 bg-emerald-50 p-3 text-sm font-semibold text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/60 dark:text-emerald-100">
<i class="fa-solid fa-envelope-circle-check mr-2" aria-hidden="true"></i>
This threaded response will be public.
</div>
@endif
@else
<input type="hidden" name="internal" value="0">
@endcan
</div>
<details
class="mt-4 overflow-hidden rounded-xl border border-zinc-200 bg-white/80 shadow-sm dark:border-zinc-800 dark:bg-zinc-950/50">
<summary
class="group flex cursor-pointer list-none items-center justify-between gap-3 bg-gradient-to-r from-slate-950 via-blue-950 to-slate-900 px-4 py-3 text-white [&::-webkit-details-marker]:hidden">
<span class="flex min-w-0 items-center gap-3">
<span
class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-blue-400/30 bg-blue-500/15 text-blue-200">
<i class="fa-solid fa-paperclip text-xs" aria-hidden="true"></i>
</span>
<span class="min-w-0">
<span
class="block text-[10px] font-black uppercase tracking-[0.22em] text-blue-200">Attachments</span>
<span class="block truncate text-xs font-semibold text-zinc-300">Pin
response files.</span>
</span>
</span>
<span class="flex shrink-0 items-center gap-2">
<span
class="rounded-full border border-white/10 bg-white/10 px-2.5 py-1 text-[10px] font-black text-white"
data-helpdesk-file-count>0 files</span>
<i class="fa-solid fa-chevron-down text-[10px] text-blue-200 transition group-open:rotate-180"
aria-hidden="true"></i>
</span>
</summary>
<div class="p-4">
<div
class="flex min-h-[4.5rem] flex-col gap-3 rounded-xl border border-zinc-200 bg-zinc-50/80 p-4 dark:border-zinc-800 dark:bg-zinc-950/70 sm:flex-row sm:items-center sm:justify-between">
<span class="text-xs font-semibold text-zinc-500 dark:text-zinc-400"
data-helpdesk-file-label>No files attached</span>
<label data-helpdesk-file-button>
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
<span>Attach files</span>
<input name="attachments[]" type="file" multiple accept="{{ $helpdeskAttachmentAccept }}" class="sr-only"
data-helpdesk-file-input>
</label>
</div>
</div>
</details>
<div class="mt-4 flex justify-end gap-2">
<button type="button" data-helpdesk-reply-toggle="{{ $replyFormId }}"
class="inline-flex items-center justify-center rounded-lg bg-slate-600 px-3 py-2 text-xs font-bold text-white shadow-sm transition hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-slate-400/70">Cancel</button>
<button type="submit" dusk="post-reply-{{ $comment->id }}"
class="inline-flex items-center justify-center rounded-lg bg-emerald-600 px-3 py-2 text-xs font-bold text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/70">Post
response</button>
</div>
</form>
@endif
@if ($commentReplies->isNotEmpty())
<div class="mt-4 border-l-4 border-red-500 pl-4">
@include('helpdesk::partials.comment-thread', [
'comments' => $commentReplies,
'level' => ((int) $level) + 1,
'ticket' => $currentTicket,
'canSeeInternalNotes' => $canSeeInternalNotes,
])
</div>
@endif
</div>
</details>
@endif
@endforeach
</div>
@@ -0,0 +1,27 @@
<div class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">
{{ $eyebrow ?? 'Helpdesk' }}
</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">
{{ $title ?? 'Helpdesk' }}
</h1>
@if (!empty($subtitle))
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">
{{ $subtitle }}
</p>
@endif
</div>
@isset($actions)
<div class="flex flex-wrap gap-2">
{{ $actions }}
</div>
@endisset
</div>
</div>
</div>
@@ -0,0 +1,275 @@
@can('update', $ticket)
<details
class="group rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900"
data-helpdesk-ticket-controls>
<summary
class="-mx-4 -mt-4 mb-4 flex cursor-pointer list-none items-center justify-between gap-3 rounded-t-xl bg-indigo-700 px-4 py-4 text-white marker:hidden">
<div class="flex min-w-0 items-center gap-3">
<span
class="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-indigo-950 text-white ring-1 ring-indigo-300/60 shadow-lg">
<i class="fa-solid fa-sliders text-lg" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h2 class="text-lg font-black uppercase tracking-wide">Ticket controls</h2>
<p class="text-xs font-semibold text-indigo-100">
Log time, assignment, status and priority
</p>
</div>
</div>
<span
class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-white/15 text-white ring-1 ring-white/20">
<i class="fa-solid fa-chevron-right text-xs transition group-open:rotate-90" aria-hidden="true"></i>
</span>
</summary>
@if (session('ticket-action-updated'))
<div
class="mb-4 rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-100">
{{ session('ticket-action-updated') }}
</div>
@endif
@include('helpdesk::partials.ticket-time-timer', [
'ticket' => $ticket,
])
<form method="POST" action="{{ route('helpdesk.tickets.time-logs.store', $ticket) }}"
class="mb-4 space-y-2">
@csrf
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200"
for="ticket_time_minutes">Log time</label>
<div class="grid grid-cols-[1fr_auto] gap-2">
<input id="ticket_time_minutes" name="minutes" type="number" min="1" max="1440"
placeholder="Minutes"
class="block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-emerald-500 focus:ring-emerald-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-time-minutes">
<button type="submit" dusk="log-ticket-time" data-dusk="log-ticket-time"
class="inline-flex items-center justify-center rounded-lg bg-emerald-600 px-3 py-2 text-xs font-black text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/70">
<i class="fa-solid fa-clock mr-2" aria-hidden="true"></i>
<span>Log</span>
</button>
</div>
<textarea spellcheck="true" lang="en-GB" name="description" rows="2" placeholder="Optional work note"
class="block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-emerald-500 focus:ring-emerald-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-time-description"></textarea>
@error('minutes')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
@error('description')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</form>
<form method="POST" action="{{ route('helpdesk.tickets.agent.update', $ticket) }}"
class="mb-4 space-y-2">
@csrf
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200"
for="show_agent_id">Assigned agent</label>
<select id="show_agent_id" name="agent_id"
class="hd-select block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-emerald-500 focus:ring-emerald-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-show-agent">
<option value="" @selected($agent_id === null)>Unassigned</option>
@forelse ($agents as $agent)
<option
value="{{ $agent->id }}" @selected((int) $agent_id === (int) $agent->id)>{{ $agent->name }}
·
{{ $agent->email }}</option>
@empty
<option value="" disabled>No users available for assignment</option>
@endforelse
</select>
@error('agent_id')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
<button type="submit" dusk="update-agent" data-dusk="update-agent"
class="inline-flex items-center justify-center rounded-lg bg-emerald-600 px-3 py-2 text-xs font-black text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/70">
<i class="fa-solid fa-user-check mr-2" aria-hidden="true"></i>
<span>Assign agent</span>
</button>
</form>
<form method="POST" action="{{ route('helpdesk.tickets.status.update', $ticket) }}"
class="mb-4 space-y-2"
data-helpdesk-status-form>
@csrf
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200"
for="show_status_id">Status</label>
<select id="show_status_id" name="status_id"
class="hd-select block min-h-10 w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-show-status">
@foreach ($statuses as $status)
<option
value="{{ $status->id }}"
data-is-closed="{{ $status->is_closed ? '1' : '0' }}"
@selected((int) $status_id === (int) $status->id)>{{ $status->name }}
</option>
@endforeach
</select>
@error('status_id')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
@error('closure_comment')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
<dialog data-helpdesk-close-ticket-dialog
class="w-full max-w-lg rounded-2xl border border-zinc-200 bg-white p-0 shadow-2xl backdrop:bg-slate-950/70 dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-r from-red-800 via-red-700 to-slate-900 px-5 py-4 text-white">
<div class="flex items-center gap-3">
<span class="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-white/15 text-white ring-1 ring-white/20">
<i class="fa-solid fa-lock" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h3 class="text-base font-black tracking-tight">Close ticket</h3>
<p class="text-xs font-semibold text-red-100">A closure comment is required for the audit trail.</p>
</div>
</div>
</div>
<div class="space-y-4 p-5">
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200" for="closure_comment">
Closure comment <span class="text-red-600">*</span>
</label>
<textarea id="closure_comment" spellcheck="true" lang="en-GB" name="closure_comment" rows="5" minlength="10" maxlength="5000"
placeholder="Explain what was completed, verified, or agreed before closing this ticket."
class="block w-full rounded-xl border border-zinc-300 bg-white p-3 text-sm font-semibold text-zinc-900 shadow-sm focus:border-red-500 focus:ring-red-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-helpdesk-closure-comment>{{ old('closure_comment') }}</textarea>
<label class="flex items-start gap-3 rounded-xl border border-emerald-200 bg-emerald-50 p-3 text-sm text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-100">
<input type="hidden" name="closure_internal" value="0">
<input type="checkbox" name="closure_internal" value="1"
class="mt-1 rounded border-emerald-400 text-purple-600 focus:ring-purple-500">
<span>
<span class="block font-extrabold">Internal closure note</span>
<span class="mt-1 block text-xs font-semibold opacity-80">Leave unticked to save the closure as a public customer-visible response.</span>
</span>
</label>
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
<button type="button" data-helpdesk-close-dialog-cancel
class="inline-flex items-center justify-center rounded-lg border border-zinc-300 bg-white px-4 py-2 text-xs font-black text-zinc-700 shadow-sm hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100 dark:hover:bg-zinc-800">
Cancel
</button>
<button type="submit" data-helpdesk-confirm-close
class="inline-flex items-center justify-center rounded-lg bg-red-600 px-4 py-2 text-xs font-black text-white shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-400/70">
<i class="fa-solid fa-lock mr-2" aria-hidden="true"></i>
Close ticket
</button>
</div>
</div>
</dialog>
<button type="submit" dusk="update-status"
class="inline-flex items-center justify-center rounded-lg bg-blue-600 px-3 py-2 text-xs font-black text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
<i class="fa-solid fa-circle-check mr-2" aria-hidden="true"></i>
<span>Update status</span>
</button>
</form>
<form method="POST" action="{{ route('helpdesk.tickets.priority.update', $ticket) }}"
class="space-y-2">
@csrf
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200"
for="show_priority_id">Priority</label>
<select id="show_priority_id" name="priority_id"
class="hd-select block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-amber-500 focus:ring-amber-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-show-priority">
@foreach ($priorities as $priority)
<option
value="{{ $priority->id }}" @selected((int) $priority_id === (int) $priority->id)>{{ $priority->name }}
</option>
@endforeach
</select>
@error('priority_id')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
<button type="submit" dusk="update-priority"
class="inline-flex items-center justify-center rounded-lg bg-amber-500 px-3 py-2 text-xs font-black text-white shadow-sm transition hover:bg-amber-600 focus:outline-none focus:ring-2 focus:ring-amber-300/70">
<i class="fa-solid fa-flag mr-2" aria-hidden="true"></i>
<span>Update priority</span>
</button>
</form>
</details>
<script>
(() => {
const initialiseCloseTicketDialogs = () => {
document.querySelectorAll('[data-helpdesk-status-form]').forEach((form) => {
if (form.dataset.helpdeskCloseDialogInitialised === '1') {
return;
}
form.dataset.helpdeskCloseDialogInitialised = '1';
const statusSelect = form.querySelector('[data-dusk="ticket-show-status"]');
const dialog = form.querySelector('[data-helpdesk-close-ticket-dialog]');
const comment = form.querySelector('[data-helpdesk-closure-comment]');
const cancel = form.querySelector('[data-helpdesk-close-dialog-cancel]');
const originalStatus = statusSelect?.value || '';
if (!statusSelect || !dialog || !comment) {
return;
}
const selectedStatusIsClosed = () => {
const selectedOption = statusSelect.options[statusSelect.selectedIndex];
return selectedOption?.dataset?.isClosed === '1';
};
const openDialog = () => {
if (!dialog.open) {
dialog.showModal();
}
window.setTimeout(() => comment.focus(), 50);
};
statusSelect.addEventListener('change', () => {
if (selectedStatusIsClosed()) {
openDialog();
}
});
form.addEventListener('submit', (event) => {
if (!selectedStatusIsClosed() || comment.value.trim().length >= 10) {
return;
}
event.preventDefault();
openDialog();
});
cancel?.addEventListener('click', () => {
dialog.close();
statusSelect.value = originalStatus;
statusSelect.dispatchEvent(new Event('change', { bubbles: true }));
});
});
};
document.addEventListener('DOMContentLoaded', initialiseCloseTicketDialogs);
document.addEventListener('livewire:navigated', initialiseCloseTicketDialogs);
initialiseCloseTicketDialogs();
})();
</script>
@endcan
@@ -0,0 +1,16 @@
@php
$ticketTimeLogs = \Modules\Helpdesk\Models\TicketTimeLog::query()
->with('user')
->where('ticket_id', $ticket->getKey())
->whereNotNull('ended_at')
->latest('logged_at')
->get();
$ticketLoggedSeconds = (int) $ticketTimeLogs->sum(function ($timeLog) {
return (int) ($timeLog->seconds ?? ((int) $timeLog->minutes * 60));
});
$ticketLoggedHours = intdiv($ticketLoggedSeconds, 3600);
$ticketLoggedMinutes = intdiv($ticketLoggedSeconds % 3600, 60);
$ticketLoggedRemainingSeconds = $ticketLoggedSeconds % 60;
@endphp
@@ -0,0 +1,3 @@
@can('update', $ticket)
@livewire('helpdesk.ticket-timer', ['ticket' => $ticket], key('helpdesk-ticket-timer-'.$ticket->getKey()))
@endcan
@@ -0,0 +1,32 @@
<form method="POST" action="{{ route('helpdesk.tickets.time-logs.store', $ticket) }}" class="mb-4 space-y-2">
@csrf
<label class="block text-xs font-bold text-zinc-700 dark:text-zinc-200" for="time_minutes">
Log time
</label>
<div class="grid grid-cols-[1fr_auto] gap-2">
<input id="time_minutes" name="minutes" type="number" min="1" max="1440" value="{{ old('minutes') }}"
placeholder="Minutes"
class="block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-emerald-500 focus:ring-emerald-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-time-minutes">
<button type="submit" dusk="log-ticket-time" data-dusk="log-ticket-time"
class="inline-flex items-center justify-center rounded-lg bg-emerald-600 px-3 py-2 text-xs font-black text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/70">
<i class="fa-solid fa-clock mr-2" aria-hidden="true"></i>
<span>Log</span>
</button>
</div>
<textarea spellcheck="true" lang="en-GB" name="description" rows="2" placeholder="Optional work note"
class="block w-full rounded-lg border border-zinc-300 bg-white p-2 text-xs font-semibold text-zinc-900 shadow-sm focus:border-emerald-500 focus:ring-emerald-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
data-dusk="ticket-time-description">{{ old('description') }}</textarea>
@error('minutes')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
@error('description')
<p class="text-xs font-bold text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</form>