fix: deep audit — wire TDS v1.2 components, fix kanban/tabs/bulk/avatar
- ticket.js: fix showTab() early return preventing attachments/deps from loading - ticket.js: fix performStatusChange() overwriting lt-status-* classes - dashboard.js: fix updateSelectionCount() using is-visible instead of style.display - dashboard.js: fix populateKanbanCards() to use #kanban-col-* IDs (TDS v1.2) - dashboard.js: fix setViewMode() removing references to old non-TDS elements - dashboard.js: remove mobile-bottom-nav injection (no CSS existed for it) - dashboard.css: add full lt-kanban-card component styles with priority accents - dashboard.css: add mobile sidebar overlay, filter toggle, ticket preview popup CSS - DashboardView.php: replace priority badges with lt-chip component - TicketView.php: add lt-avatar with initials to comment author display - ApiKeysView.php: enhance API usage section with lt-code-block component + curl example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -423,7 +423,8 @@ include __DIR__ . '/layout_header.php';
|
||||
class="ticket-link"><?= htmlspecialchars($row['ticket_id']) ?></a>
|
||||
</td>
|
||||
<td data-label="Priority">
|
||||
<span class="lt-p<?= $pNum ?>">P<?= $pNum ?></span>
|
||||
<?php $chipClass = match($pNum) { 1 => 'lt-chip-critical', 2 => 'lt-chip-warn', 3 => 'lt-chip-info', default => 'lt-chip-ok' }; ?>
|
||||
<span class="lt-chip <?= $chipClass ?>">P<?= $pNum ?></span>
|
||||
</td>
|
||||
<td data-label="Title"><?= htmlspecialchars($row['title']) ?></td>
|
||||
<td data-label="Category" class="lt-text-muted lt-text-xs"><?= htmlspecialchars($row['category']) ?></td>
|
||||
|
||||
@@ -370,6 +370,11 @@ include __DIR__ . '/layout_header.php';
|
||||
$threadClass = $parentId ? 'comment-reply' : 'comment-root';
|
||||
$dateStr = date('M d, Y H:i', strtotime($comment['created_at']));
|
||||
$editedIndicator = !empty($comment['updated_at']) ? ' <span class="comment-edited lt-text-xs lt-text-muted">(edited)</span>' : '';
|
||||
// Avatar initials + color
|
||||
$words = array_filter(explode(' ', $displayName));
|
||||
$initials = strtoupper(implode('', array_map(fn($w) => $w[0], array_slice($words, 0, 2))));
|
||||
$avatarColors = ['lt-avatar--orange', 'lt-avatar--green', 'lt-avatar--purple', ''];
|
||||
$avatarColor = $avatarColors[abs(crc32($displayName)) % count($avatarColors)];
|
||||
?>
|
||||
<div class="comment <?= $depthClass ?> <?= $threadClass ?>"
|
||||
data-comment-id="<?= $commentId ?>"
|
||||
@@ -379,6 +384,7 @@ include __DIR__ . '/layout_header.php';
|
||||
<?php if ($parentId): ?><div class="thread-line" aria-hidden="true"></div><?php endif ?>
|
||||
<div class="comment-content">
|
||||
<div class="comment-header lt-flex lt-flex-gap-sm lt-flex-align-center">
|
||||
<div class="lt-avatar lt-avatar--xs <?= $avatarColor ?>" aria-hidden="true"><?= htmlspecialchars($initials) ?></div>
|
||||
<span class="comment-user lt-text-amber"><?= htmlspecialchars($displayName) ?></span>
|
||||
<span class="comment-date lt-text-xs lt-text-muted">
|
||||
<span class="ts-cell"
|
||||
|
||||
@@ -115,8 +115,26 @@ include __DIR__ . '/../../views/layout_header.php';
|
||||
<div class="lt-section-header">API Usage</div>
|
||||
<div class="lt-section-body">
|
||||
<p class="lt-text-sm lt-text-muted">Include the API key in your requests using the Authorization header:</p>
|
||||
<pre class="lt-text-xs lt-text-cyan" style="border:1px solid rgba(0,255,65,0.2);padding:0.5rem;overflow-x:auto"><code>Authorization: Bearer YOUR_API_KEY</code></pre>
|
||||
<p class="lt-text-xs lt-text-muted">API keys provide programmatic access to create and manage tickets. Keep keys secure and rotate them regularly.</p>
|
||||
<div class="lt-code-block">
|
||||
<div class="lt-code-header">
|
||||
<span class="lt-code-lang">HTTP HEADER</span>
|
||||
<button type="button" class="lt-code-copy lt-btn-sm"
|
||||
data-copy="Authorization: Bearer YOUR_API_KEY"
|
||||
data-copy-toast>COPY</button>
|
||||
</div>
|
||||
<pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
|
||||
</div>
|
||||
<p class="lt-text-xs lt-text-muted" style="margin-top:0.5rem">
|
||||
Example — create a ticket via cURL:<br>
|
||||
</p>
|
||||
<div class="lt-code-block">
|
||||
<div class="lt-code-header"><span class="lt-code-lang">CURL</span></div>
|
||||
<pre><code>curl -X POST https://your-instance/api/create_ticket.php \
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"title":"My ticket","category":"General","type":"Issue","priority":3}'</code></pre>
|
||||
</div>
|
||||
<p class="lt-text-xs lt-text-muted" style="margin-top:0.5rem">API keys provide programmatic access to create and manage tickets. Keep keys secure and rotate them regularly.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,8 +143,13 @@ document.addEventListener('click', function (e) {
|
||||
var target = e.target.closest('[data-action]');
|
||||
if (!target) return;
|
||||
switch (target.getAttribute('data-action')) {
|
||||
case 'copy-api-key': copyApiKey(); break;
|
||||
case 'revoke-key': revokeKey(target.getAttribute('data-id')); break;
|
||||
case 'copy-api-key': copyApiKey(); break;
|
||||
case 'revoke-key': revokeKey(target.getAttribute('data-id')); break;
|
||||
case 'copy-header-example':
|
||||
navigator.clipboard.writeText('Authorization: Bearer YOUR_API_KEY')
|
||||
.then(function() { lt.toast.success('Copied!'); })
|
||||
.catch(function() { lt.toast.error('Copy failed'); });
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user