feat: Add 9 new features for enhanced UX and security
Quick Wins: - Feature 1: Ticket linking in comments (#123456789 auto-links) - Feature 6: Checkbox click area fix (click anywhere in cell) - Feature 7: User groups display in settings modal UI Enhancements: - Feature 4: Collapsible sidebar with localStorage persistence - Feature 5: Inline ticket preview popup on hover (300ms delay) - Feature 2: Mobile responsive improvements (44px touch targets, iOS zoom fix) Major Features: - Feature 3: Kanban card view with status columns (toggle with localStorage) - Feature 9: API key generation admin panel (/admin/api-keys) - Feature 8: Ticket visibility levels (public/internal/confidential) New files: - views/admin/ApiKeysView.php - api/generate_api_key.php - api/revoke_api_key.php - migrations/008_ticket_visibility.sql Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1691,6 +1691,81 @@ input[type="checkbox"]:checked {
|
||||
box-shadow: var(--glow-amber);
|
||||
}
|
||||
|
||||
/* Collapsible Sidebar */
|
||||
.sidebar-toggle {
|
||||
position: absolute;
|
||||
right: -16px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 32px;
|
||||
height: 64px;
|
||||
background: var(--bg-secondary);
|
||||
border: 2px solid var(--terminal-green);
|
||||
border-left: none;
|
||||
color: var(--terminal-green);
|
||||
cursor: pointer;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s ease;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar-toggle::before,
|
||||
.sidebar-toggle::after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.sidebar-toggle:hover {
|
||||
background: rgba(0, 255, 65, 0.15);
|
||||
color: var(--terminal-amber);
|
||||
border-color: var(--terminal-amber);
|
||||
}
|
||||
|
||||
.toggle-arrow {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.dashboard-sidebar {
|
||||
position: relative;
|
||||
transition: width 0.3s ease, margin 0.3s ease;
|
||||
}
|
||||
|
||||
.sidebar-content {
|
||||
overflow: hidden;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.dashboard-sidebar.collapsed {
|
||||
width: 0;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.dashboard-sidebar.collapsed .sidebar-content {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.dashboard-sidebar.collapsed .sidebar-toggle {
|
||||
right: -48px;
|
||||
}
|
||||
|
||||
.dashboard-sidebar.collapsed .toggle-arrow {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.dashboard-layout.sidebar-collapsed {
|
||||
/* Adjust layout when sidebar is collapsed */
|
||||
}
|
||||
|
||||
/* Hide toggle on mobile */
|
||||
@media (max-width: 768px) {
|
||||
.sidebar-toggle {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -1973,6 +2048,17 @@ body.dark-mode .modal-body select {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
/* Checkbox cell - click anywhere to toggle */
|
||||
.checkbox-cell {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.checkbox-cell:hover {
|
||||
background-color: rgba(0, 255, 65, 0.15);
|
||||
}
|
||||
|
||||
/* Responsive bulk actions */
|
||||
@media (max-width: 768px) {
|
||||
.bulk-actions-toolbar {
|
||||
@@ -3243,3 +3329,519 @@ table td:nth-child(4) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* ===== TICKET LINK REFERENCES IN COMMENTS ===== */
|
||||
.ticket-link-ref {
|
||||
color: var(--terminal-cyan);
|
||||
text-decoration: none;
|
||||
font-family: var(--font-mono);
|
||||
padding: 0.1rem 0.3rem;
|
||||
border-radius: 0;
|
||||
background: rgba(0, 255, 255, 0.1);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.ticket-link-ref:hover {
|
||||
color: var(--terminal-amber);
|
||||
background: rgba(255, 176, 0, 0.15);
|
||||
text-shadow: var(--glow-amber);
|
||||
}
|
||||
|
||||
/* ===== USER GROUPS DISPLAY ===== */
|
||||
.user-groups-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.group-badge {
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.6rem;
|
||||
background: rgba(0, 255, 255, 0.1);
|
||||
border: 1px solid var(--terminal-cyan);
|
||||
color: var(--terminal-cyan);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.group-badge:hover {
|
||||
background: rgba(0, 255, 255, 0.2);
|
||||
text-shadow: 0 0 5px var(--terminal-cyan);
|
||||
}
|
||||
|
||||
/* ===== VISIBILITY SETTINGS ===== */
|
||||
.visibility-groups-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.visibility-groups-list label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.visibility-groups-list label:hover .group-badge {
|
||||
background: rgba(0, 255, 255, 0.2);
|
||||
text-shadow: 0 0 5px var(--terminal-cyan);
|
||||
}
|
||||
|
||||
.visibility-group-checkbox {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.visibility-group-checkbox:checked + .group-badge {
|
||||
background: var(--terminal-cyan);
|
||||
color: var(--bg-primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ticket-visibility-settings {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.visibility-groups-display {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
/* ===== INLINE TICKET PREVIEW POPUP ===== */
|
||||
.ticket-preview-popup {
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
width: 320px;
|
||||
background: var(--bg-primary);
|
||||
border: 2px solid var(--terminal-green);
|
||||
box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
|
||||
font-family: var(--font-mono);
|
||||
padding: 0;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ticket-preview-popup::before {
|
||||
content: '┌──────────────────────┐';
|
||||
display: block;
|
||||
color: var(--terminal-green);
|
||||
font-size: 0.7rem;
|
||||
text-align: center;
|
||||
padding: 0.25rem;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--terminal-green);
|
||||
}
|
||||
|
||||
.preview-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.75rem;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--terminal-green);
|
||||
}
|
||||
|
||||
.preview-id {
|
||||
color: var(--terminal-amber);
|
||||
font-weight: bold;
|
||||
text-shadow: var(--glow-amber);
|
||||
}
|
||||
|
||||
.preview-status {
|
||||
padding: 0.2rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.preview-title {
|
||||
padding: 0.75rem;
|
||||
color: var(--terminal-green);
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.4;
|
||||
border-bottom: 1px solid var(--terminal-green);
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.preview-meta {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
color: var(--terminal-green);
|
||||
}
|
||||
|
||||
.preview-meta strong {
|
||||
color: var(--terminal-cyan);
|
||||
}
|
||||
|
||||
.preview-footer {
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-secondary);
|
||||
border-top: 1px solid var(--terminal-green);
|
||||
}
|
||||
|
||||
/* ===== ENHANCED MOBILE RESPONSIVE STYLES ===== */
|
||||
|
||||
/* Table wrapper for horizontal scrolling */
|
||||
.table-wrapper {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
margin: 0 -0.5rem;
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
/* Prevent iOS zoom on input focus */
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="search"],
|
||||
input[type="password"],
|
||||
input[type="number"],
|
||||
select,
|
||||
textarea {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
/* Minimum touch target size (44px) */
|
||||
.btn,
|
||||
button,
|
||||
.tab-btn,
|
||||
.checkbox-cell,
|
||||
.quick-action-btn,
|
||||
input[type="checkbox"],
|
||||
select {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
}
|
||||
|
||||
/* Better button spacing */
|
||||
.btn {
|
||||
padding: 12px 16px;
|
||||
margin: 4px 2px;
|
||||
}
|
||||
|
||||
/* Stack toolbar elements */
|
||||
.dashboard-toolbar {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.toolbar-left,
|
||||
.toolbar-center,
|
||||
.toolbar-right {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.toolbar-search {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.toolbar-search input,
|
||||
.toolbar-search button {
|
||||
width: 100%;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 100% !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
/* Improve table readability */
|
||||
table {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 8px 6px;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
/* Hide less important columns on mobile */
|
||||
table th:nth-child(5),
|
||||
table td:nth-child(5),
|
||||
table th:nth-child(10),
|
||||
table td:nth-child(10),
|
||||
table th:nth-child(11),
|
||||
table td:nth-child(11) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Improve stats widgets */
|
||||
.stats-row {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
flex: 1 1 calc(50% - 0.5rem);
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
/* Improve filter groups */
|
||||
.filter-group label {
|
||||
min-height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.filter-group input[type="checkbox"] {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 0.75rem;
|
||||
}
|
||||
|
||||
/* Improve pagination */
|
||||
.pagination {
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination button {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
/* Better modal sizing */
|
||||
.modal-content,
|
||||
.settings-content {
|
||||
width: 95%;
|
||||
max-width: 95%;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* Hide preview on mobile (not useful with touch) */
|
||||
.ticket-preview-popup {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Improve quick actions */
|
||||
.quick-actions {
|
||||
flex-direction: row;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.quick-action-btn {
|
||||
padding: 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== VIEW TOGGLE BUTTONS ===== */
|
||||
.view-toggle {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
border: 2px solid var(--terminal-green);
|
||||
}
|
||||
|
||||
.view-btn {
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--bg-primary);
|
||||
color: var(--terminal-green);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1.2rem;
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.view-btn::before,
|
||||
.view-btn::after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.view-btn:hover {
|
||||
background: rgba(0, 255, 65, 0.15);
|
||||
}
|
||||
|
||||
.view-btn.active {
|
||||
background: var(--terminal-green);
|
||||
color: var(--bg-primary);
|
||||
}
|
||||
|
||||
/* ===== KANBAN BOARD STYLES ===== */
|
||||
.card-view-container {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.kanban-board {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 1rem;
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.kanban-column {
|
||||
background: var(--bg-secondary);
|
||||
border: 2px solid var(--terminal-green);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.kanban-column-header {
|
||||
padding: 1rem;
|
||||
border-bottom: 2px solid var(--terminal-green);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-family: var(--font-mono);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
.kanban-column-header.status-Open {
|
||||
background: rgba(40, 167, 69, 0.1);
|
||||
color: var(--status-open);
|
||||
border-color: var(--status-open);
|
||||
}
|
||||
|
||||
.kanban-column-header.status-Pending {
|
||||
background: rgba(156, 39, 176, 0.1);
|
||||
color: var(--status-pending);
|
||||
border-color: var(--status-pending);
|
||||
}
|
||||
|
||||
.kanban-column-header.status-In-Progress {
|
||||
background: rgba(255, 193, 7, 0.1);
|
||||
color: var(--status-in-progress);
|
||||
border-color: var(--status-in-progress);
|
||||
}
|
||||
|
||||
.kanban-column-header.status-Closed {
|
||||
background: rgba(220, 53, 69, 0.1);
|
||||
color: var(--status-closed);
|
||||
border-color: var(--status-closed);
|
||||
}
|
||||
|
||||
.column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.column-count {
|
||||
background: currentColor;
|
||||
color: var(--bg-primary);
|
||||
padding: 0.2rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.kanban-cards {
|
||||
flex: 1;
|
||||
padding: 0.5rem;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.kanban-card {
|
||||
background: var(--bg-primary);
|
||||
border: 1px solid var(--terminal-green);
|
||||
padding: 0.75rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.kanban-card:hover {
|
||||
border-color: var(--terminal-amber);
|
||||
transform: translateX(4px);
|
||||
box-shadow: -4px 0 0 var(--terminal-amber);
|
||||
}
|
||||
|
||||
.kanban-card.priority-1 { border-left: 4px solid var(--priority-1); }
|
||||
.kanban-card.priority-2 { border-left: 4px solid var(--priority-2); }
|
||||
.kanban-card.priority-3 { border-left: 4px solid var(--priority-3); }
|
||||
.kanban-card.priority-4 { border-left: 4px solid var(--priority-4); }
|
||||
.kanban-card.priority-5 { border-left: 4px solid var(--priority-5); }
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.card-id {
|
||||
color: var(--terminal-cyan);
|
||||
}
|
||||
|
||||
.card-priority {
|
||||
padding: 0.1rem 0.4rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.card-priority.p1 { background: var(--priority-1); color: white; }
|
||||
.card-priority.p2 { background: var(--priority-2); color: black; }
|
||||
.card-priority.p3 { background: var(--priority-3); color: white; }
|
||||
.card-priority.p4 { background: var(--priority-4); color: black; }
|
||||
.card-priority.p5 { background: var(--priority-5); color: white; }
|
||||
|
||||
.card-title {
|
||||
color: var(--terminal-green);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.3;
|
||||
margin-bottom: 0.5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.card-category {
|
||||
background: rgba(0, 255, 65, 0.1);
|
||||
padding: 0.1rem 0.4rem;
|
||||
}
|
||||
|
||||
.card-assignee {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background: var(--terminal-cyan);
|
||||
color: var(--bg-primary);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
/* Kanban responsive */
|
||||
@media (max-width: 1200px) {
|
||||
.kanban-board {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.kanban-board {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.kanban-column {
|
||||
min-height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1499,3 +1499,116 @@ body.dark-mode .editable {
|
||||
background: rgba(0, 255, 65, 0.1);
|
||||
color: var(--terminal-amber);
|
||||
}
|
||||
|
||||
/* ===== ENHANCED MOBILE RESPONSIVE - TICKET PAGE ===== */
|
||||
@media (max-width: 768px) {
|
||||
/* Prevent iOS zoom on input focus */
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="search"],
|
||||
textarea,
|
||||
select {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
/* Touch-friendly button sizes */
|
||||
.btn,
|
||||
button,
|
||||
.tab-btn {
|
||||
min-height: 44px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
/* Stack ticket metadata vertically */
|
||||
.ticket-metadata-fields {
|
||||
grid-template-columns: 1fr !important;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.metadata-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Stack header controls */
|
||||
.ticket-subheader {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.header-controls {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.status-priority-group {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.status-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Full width buttons */
|
||||
#editButton {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Improve comment form */
|
||||
.comment-form textarea {
|
||||
width: 100%;
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.comment-controls {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.markdown-toggles {
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
/* Improve assignment dropdown */
|
||||
.ticket-assignment {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.assignment-select {
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
/* Full width tabs with better spacing */
|
||||
.ticket-tabs {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
flex: 1 1 auto;
|
||||
text-align: center;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
/* Improve upload zone */
|
||||
.upload-zone {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.upload-zone-content p {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Improve timeline readability */
|
||||
.timeline-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.timeline-date {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,34 @@ function escapeHtml(text) {
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle sidebar visibility on desktop
|
||||
*/
|
||||
function toggleSidebar() {
|
||||
const sidebar = document.getElementById('dashboardSidebar');
|
||||
const layout = document.querySelector('.dashboard-layout');
|
||||
if (sidebar && layout) {
|
||||
sidebar.classList.toggle('collapsed');
|
||||
layout.classList.toggle('sidebar-collapsed');
|
||||
// Store state in localStorage
|
||||
const isCollapsed = sidebar.classList.contains('collapsed');
|
||||
localStorage.setItem('sidebarCollapsed', isCollapsed ? 'true' : 'false');
|
||||
}
|
||||
}
|
||||
|
||||
// Restore sidebar state on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const savedState = localStorage.getItem('sidebarCollapsed');
|
||||
if (savedState === 'true') {
|
||||
const sidebar = document.getElementById('dashboardSidebar');
|
||||
const layout = document.querySelector('.dashboard-layout');
|
||||
if (sidebar && layout) {
|
||||
sidebar.classList.add('collapsed');
|
||||
layout.classList.add('sidebar-collapsed');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Main initialization
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('DOM loaded, initializing dashboard...');
|
||||
@@ -480,6 +508,20 @@ function toggleSelectAll() {
|
||||
updateSelectionCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle checkbox when clicking anywhere in the checkbox cell
|
||||
*/
|
||||
function toggleRowCheckbox(event, cell) {
|
||||
// Prevent double-toggle if clicking directly on the checkbox
|
||||
if (event.target.type === 'checkbox') return;
|
||||
event.stopPropagation();
|
||||
const cb = cell.querySelector('.ticket-checkbox');
|
||||
if (cb) {
|
||||
cb.checked = !cb.checked;
|
||||
updateSelectionCount();
|
||||
}
|
||||
}
|
||||
|
||||
function updateSelectionCount() {
|
||||
const checkboxes = document.querySelectorAll('.ticket-checkbox:checked');
|
||||
const count = checkboxes.length;
|
||||
@@ -1355,6 +1397,231 @@ function performQuickAssign(ticketId) {
|
||||
});
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// KANBAN / CARD VIEW
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Set the view mode (table or card)
|
||||
*/
|
||||
function setViewMode(mode) {
|
||||
const tableView = document.querySelector('.ascii-frame-outer');
|
||||
const cardView = document.getElementById('cardView');
|
||||
const tableBtn = document.getElementById('tableViewBtn');
|
||||
const cardBtn = document.getElementById('cardViewBtn');
|
||||
|
||||
if (!tableView || !cardView) return;
|
||||
|
||||
if (mode === 'card') {
|
||||
tableView.style.display = 'none';
|
||||
cardView.style.display = 'block';
|
||||
tableBtn.classList.remove('active');
|
||||
cardBtn.classList.add('active');
|
||||
populateKanbanCards();
|
||||
} else {
|
||||
tableView.style.display = 'block';
|
||||
cardView.style.display = 'none';
|
||||
tableBtn.classList.add('active');
|
||||
cardBtn.classList.remove('active');
|
||||
}
|
||||
|
||||
// Store preference
|
||||
localStorage.setItem('ticketViewMode', mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate Kanban cards from table data
|
||||
*/
|
||||
function populateKanbanCards() {
|
||||
const rows = document.querySelectorAll('tbody tr');
|
||||
const columns = {
|
||||
'Open': document.querySelector('.kanban-column[data-status="Open"] .kanban-cards'),
|
||||
'Pending': document.querySelector('.kanban-column[data-status="Pending"] .kanban-cards'),
|
||||
'In Progress': document.querySelector('.kanban-column[data-status="In Progress"] .kanban-cards'),
|
||||
'Closed': document.querySelector('.kanban-column[data-status="Closed"] .kanban-cards')
|
||||
};
|
||||
|
||||
// Clear existing cards
|
||||
Object.values(columns).forEach(col => {
|
||||
if (col) col.innerHTML = '';
|
||||
});
|
||||
|
||||
const counts = { 'Open': 0, 'Pending': 0, 'In Progress': 0, 'Closed': 0 };
|
||||
const isAdmin = document.getElementById('selectAllCheckbox') !== null;
|
||||
const offset = isAdmin ? 1 : 0;
|
||||
|
||||
rows.forEach(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length < 6) return; // Skip empty rows
|
||||
|
||||
const ticketId = cells[0 + offset]?.querySelector('.ticket-link')?.textContent.trim() || '';
|
||||
const priority = cells[1 + offset]?.textContent.trim() || '';
|
||||
const title = cells[2 + offset]?.textContent.trim() || '';
|
||||
const category = cells[3 + offset]?.textContent.trim() || '';
|
||||
const status = cells[5 + offset]?.textContent.trim() || '';
|
||||
const assignedTo = cells[7 + offset]?.textContent.trim() || 'Unassigned';
|
||||
|
||||
// Get initials for assignee
|
||||
const initials = assignedTo === 'Unassigned' ? '?' :
|
||||
assignedTo.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2);
|
||||
|
||||
const column = columns[status];
|
||||
if (column) {
|
||||
counts[status]++;
|
||||
|
||||
const card = document.createElement('div');
|
||||
card.className = `kanban-card priority-${priority}`;
|
||||
card.onclick = () => window.location.href = `/ticket/${ticketId}`;
|
||||
card.innerHTML = `
|
||||
<div class="card-header">
|
||||
<span class="card-id">#${escapeHtml(ticketId)}</span>
|
||||
<span class="card-priority p${priority}">P${priority}</span>
|
||||
</div>
|
||||
<div class="card-title">${escapeHtml(title)}</div>
|
||||
<div class="card-footer">
|
||||
<span class="card-category">${escapeHtml(category)}</span>
|
||||
<span class="card-assignee" title="${escapeHtml(assignedTo)}">${escapeHtml(initials)}</span>
|
||||
</div>
|
||||
`;
|
||||
column.appendChild(card);
|
||||
}
|
||||
});
|
||||
|
||||
// Update column counts
|
||||
Object.keys(counts).forEach(status => {
|
||||
const header = document.querySelector(`.kanban-column[data-status="${status}"] .column-count`);
|
||||
if (header) header.textContent = counts[status];
|
||||
});
|
||||
}
|
||||
|
||||
// Restore view mode on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const savedMode = localStorage.getItem('ticketViewMode');
|
||||
if (savedMode === 'card') {
|
||||
// Delay to ensure DOM is ready
|
||||
setTimeout(() => setViewMode('card'), 100);
|
||||
}
|
||||
});
|
||||
|
||||
// ========================================
|
||||
// INLINE TICKET PREVIEW
|
||||
// ========================================
|
||||
|
||||
let previewTimeout = null;
|
||||
let currentPreview = null;
|
||||
|
||||
function initTicketPreview() {
|
||||
// Create preview element
|
||||
const preview = document.createElement('div');
|
||||
preview.id = 'ticketPreview';
|
||||
preview.className = 'ticket-preview-popup';
|
||||
preview.style.display = 'none';
|
||||
document.body.appendChild(preview);
|
||||
currentPreview = preview;
|
||||
|
||||
// Add event listeners to ticket links
|
||||
document.querySelectorAll('.ticket-link').forEach(link => {
|
||||
link.addEventListener('mouseenter', showTicketPreview);
|
||||
link.addEventListener('mouseleave', hideTicketPreview);
|
||||
});
|
||||
|
||||
// Keep preview visible when hovering over it
|
||||
preview.addEventListener('mouseenter', () => {
|
||||
if (previewTimeout) {
|
||||
clearTimeout(previewTimeout);
|
||||
previewTimeout = null;
|
||||
}
|
||||
});
|
||||
|
||||
preview.addEventListener('mouseleave', hideTicketPreview);
|
||||
}
|
||||
|
||||
function showTicketPreview(event) {
|
||||
const link = event.target.closest('.ticket-link');
|
||||
if (!link) return;
|
||||
|
||||
// Clear any pending hide
|
||||
if (previewTimeout) {
|
||||
clearTimeout(previewTimeout);
|
||||
}
|
||||
|
||||
// Delay before showing
|
||||
previewTimeout = setTimeout(() => {
|
||||
const row = link.closest('tr');
|
||||
if (!row) return;
|
||||
|
||||
// Extract data from the table row
|
||||
const cells = row.querySelectorAll('td');
|
||||
const isAdmin = document.getElementById('selectAllCheckbox') !== null;
|
||||
const offset = isAdmin ? 1 : 0;
|
||||
|
||||
const ticketId = link.textContent.trim();
|
||||
const priority = cells[1 + offset]?.textContent.trim() || '';
|
||||
const title = cells[2 + offset]?.textContent.trim() || '';
|
||||
const category = cells[3 + offset]?.textContent.trim() || '';
|
||||
const type = cells[4 + offset]?.textContent.trim() || '';
|
||||
const status = cells[5 + offset]?.textContent.trim() || '';
|
||||
const createdBy = cells[6 + offset]?.textContent.trim() || '';
|
||||
const assignedTo = cells[7 + offset]?.textContent.trim() || '';
|
||||
|
||||
// Build preview content
|
||||
currentPreview.innerHTML = `
|
||||
<div class="preview-header">
|
||||
<span class="preview-id">#${escapeHtml(ticketId)}</span>
|
||||
<span class="preview-status status-${status.replace(/\s+/g, '-')}">${escapeHtml(status)}</span>
|
||||
</div>
|
||||
<div class="preview-title">${escapeHtml(title)}</div>
|
||||
<div class="preview-meta">
|
||||
<div><strong>Priority:</strong> P${escapeHtml(priority)}</div>
|
||||
<div><strong>Category:</strong> ${escapeHtml(category)}</div>
|
||||
<div><strong>Type:</strong> ${escapeHtml(type)}</div>
|
||||
<div><strong>Assigned:</strong> ${escapeHtml(assignedTo)}</div>
|
||||
</div>
|
||||
<div class="preview-footer">Created by ${escapeHtml(createdBy)}</div>
|
||||
`;
|
||||
|
||||
// Position the preview
|
||||
const rect = link.getBoundingClientRect();
|
||||
const previewWidth = 320;
|
||||
const previewHeight = 200;
|
||||
|
||||
let left = rect.left + window.scrollX;
|
||||
let top = rect.bottom + window.scrollY + 5;
|
||||
|
||||
// Adjust if going off-screen
|
||||
if (left + previewWidth > window.innerWidth) {
|
||||
left = window.innerWidth - previewWidth - 20;
|
||||
}
|
||||
if (top + previewHeight > window.innerHeight + window.scrollY) {
|
||||
top = rect.top + window.scrollY - previewHeight - 5;
|
||||
}
|
||||
|
||||
currentPreview.style.left = left + 'px';
|
||||
currentPreview.style.top = top + 'px';
|
||||
currentPreview.style.display = 'block';
|
||||
}, 300);
|
||||
}
|
||||
|
||||
function hideTicketPreview() {
|
||||
if (previewTimeout) {
|
||||
clearTimeout(previewTimeout);
|
||||
}
|
||||
previewTimeout = setTimeout(() => {
|
||||
if (currentPreview) {
|
||||
currentPreview.style.display = 'none';
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
// Initialize preview on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const hasTable = document.querySelector('table');
|
||||
const isTicketPage = window.location.pathname.includes('/ticket/');
|
||||
if (hasTable && !isTicketPage) {
|
||||
initTicketPreview();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggle export dropdown menu
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,9 @@ function parseMarkdown(markdown) {
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
// Ticket references (#123456789) - convert to clickable links
|
||||
html = html.replace(/#(\d{9})\b/g, '<a href="/ticket/$1" class="ticket-link-ref">#$1</a>');
|
||||
|
||||
// Code blocks (```code```)
|
||||
html = html.replace(/```([\s\S]*?)```/g, '<pre class="code-block"><code>$1</code></pre>');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user