Merge pull request 'Auto-commit local changes before build (2026-01-08 14:30:19)' (#67) from v20260108-32-runchecks-ticket-copy-button into main
Reviewed-on: #67
This commit is contained in:
commit
97f3a7f9dc
@ -1 +1 @@
|
|||||||
v20260108-31-inbox-empty-body-attachment-render
|
v20260108-32-runchecks-ticket-copy-button
|
||||||
|
|||||||
@ -661,12 +661,14 @@ table.addEventListener('change', function (e) {
|
|||||||
html += '<div class="mb-2"><strong>Tickets</strong><div class="mt-1">';
|
html += '<div class="mb-2"><strong>Tickets</strong><div class="mt-1">';
|
||||||
tickets.forEach(function (t) {
|
tickets.forEach(function (t) {
|
||||||
var status = t.resolved_at ? 'Resolved' : 'Active';
|
var status = t.resolved_at ? 'Resolved' : 'Active';
|
||||||
|
var ticketCode = (t.ticket_code || '').toString();
|
||||||
html += '<div class="mb-2 border rounded p-2" data-alert-type="ticket" data-id="' + t.id + '">' +
|
html += '<div class="mb-2 border rounded p-2" data-alert-type="ticket" data-id="' + t.id + '">' +
|
||||||
'<div class="d-flex align-items-start justify-content-between gap-2">' +
|
'<div class="d-flex align-items-start justify-content-between gap-2">' +
|
||||||
'<div class="flex-grow-1 min-w-0">' +
|
'<div class="flex-grow-1 min-w-0">' +
|
||||||
'<div class="text-truncate">' +
|
'<div class="text-truncate">' +
|
||||||
'<span class="me-1" title="Ticket">🎫</span>' +
|
'<span class="me-1" title="Ticket">🎫</span>' +
|
||||||
'<span class="fw-semibold">' + escapeHtml(t.ticket_code || '') + '</span>' +
|
'<span class="fw-semibold">' + escapeHtml(ticketCode) + '</span>' +
|
||||||
|
'<button type="button" class="btn btn-sm btn-outline-secondary ms-2 py-0 px-1" title="Copy ticket number" data-action="copy-ticket" data-code="' + escapeHtml(ticketCode) + '">⧉</button>' +
|
||||||
'<span class="ms-2 badge ' + (t.resolved_at ? 'bg-secondary' : 'bg-warning text-dark') + '">' + status + '</span>' +
|
'<span class="ms-2 badge ' + (t.resolved_at ? 'bg-secondary' : 'bg-warning text-dark') + '">' + status + '</span>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
@ -709,7 +711,30 @@ table.addEventListener('change', function (e) {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
var action = btn.getAttribute('data-action');
|
var action = btn.getAttribute('data-action');
|
||||||
var id = btn.getAttribute('data-id');
|
var id = btn.getAttribute('data-id');
|
||||||
if (!action || !id) return;
|
if (!action) return;
|
||||||
|
|
||||||
|
if (action === 'copy-ticket') {
|
||||||
|
var code = btn.getAttribute('data-code') || '';
|
||||||
|
if (!code) return;
|
||||||
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||||
|
navigator.clipboard.writeText(code)
|
||||||
|
.then(function () {
|
||||||
|
var original = btn.textContent;
|
||||||
|
btn.textContent = '✓';
|
||||||
|
setTimeout(function () { btn.textContent = original; }, 800);
|
||||||
|
})
|
||||||
|
.catch(function () {
|
||||||
|
// Fallback: select/copy via prompt
|
||||||
|
window.prompt('Copy ticket number:', code);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
window.prompt('Copy ticket number:', code);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!id) return;
|
||||||
|
|
||||||
if (action === 'resolve-ticket') {
|
if (action === 'resolve-ticket') {
|
||||||
if (!confirm('Mark ticket as resolved?')) return;
|
if (!confirm('Mark ticket as resolved?')) return;
|
||||||
apiJson('/api/tickets/' + encodeURIComponent(id) + '/resolve', {method: 'POST', body: '{}'})
|
apiJson('/api/tickets/' + encodeURIComponent(id) + '/resolve', {method: 'POST', body: '{}'})
|
||||||
|
|||||||
@ -45,6 +45,14 @@
|
|||||||
- Inbox import: when the Graph body is effectively empty and an EML is stored, extract the first HTML attachment and store it as html_body.
|
- Inbox import: when the Graph body is effectively empty and an EML is stored, extract the first HTML attachment and store it as html_body.
|
||||||
- Inbox message detail: for already-stored messages with effectively empty bodies, dynamically fall back to extracting the HTML attachment from the stored EML so the Inbox popup shows the report without requiring a reset.
|
- Inbox message detail: for already-stored messages with effectively empty bodies, dynamically fall back to extracting the HTML attachment from the stored EML so the Inbox popup shows the report without requiring a reset.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v20260108-32-runchecks-ticket-copy-button
|
||||||
|
|
||||||
|
- Added a small copy icon next to the ticket number in the Run Checks popup.
|
||||||
|
- Implemented copy-to-clipboard functionality to copy only the ticket number.
|
||||||
|
- Prevented accidental selection of the appended status text (e.g. “Active”) when copying tickets.
|
||||||
|
|
||||||
================================================================================================================================================
|
================================================================================================================================================
|
||||||
## v0.1.18
|
## v0.1.18
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user