fix: note temporanee che non funzionavano. feat: le note possono essere inviate ad otrs senza numero di ticket. style: rivisti alcuni nomi e colore per invio di una nota temporanea in otrs.
This commit is contained in:
1 parent
b828d60bb2
commit
f21be0abcb
9 files changed
+216
-70
No files matched your search
@@ -13,7 +13,16 @@ const TicketGroupsView = {
|
||||
const container = document.getElementById('view-container');
|
||||
container.innerHTML = `
|
||||
<div class="ticket-groups-container" style="display: flex; gap: var(--space-lg); min-height: calc(100vh - 120px); padding: var(--space-lg) 0;">
|
||||
<!-- Left Sidebar: Groups List -->
|
||||
<!-- Left Content: Group Details -->
|
||||
<div class="group-details-pane card" id="group-details-pane" style="flex: 1; padding: var(--space-lg); display: flex; flex-direction: column; max-height: calc(100vh - 120px); overflow-y: auto;">
|
||||
<div class="empty-state" style="margin: auto; text-align: center; color: var(--text-muted);">
|
||||
<div style="font-size: 3rem; margin-bottom: var(--space-sm);">📂</div>
|
||||
<h4>Nessun gruppo selezionato</h4>
|
||||
<p style="font-size: 0.85rem;">Seleziona un gruppo dall'elenco o creane uno nuovo per iniziare a gestire le relazioni master/slave.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Sidebar: Groups List -->
|
||||
<div class="groups-sidebar card" style="flex: 0 0 320px; display: flex; flex-direction: column; padding: var(--space-md); max-height: calc(100vh - 120px); overflow-y: auto;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md);">
|
||||
<h3 style="margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-primary);">🗂️ Gruppi Ticket</h3>
|
||||
@@ -25,15 +34,6 @@ const TicketGroupsView = {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Content: Group Details -->
|
||||
<div class="group-details-pane card" id="group-details-pane" style="flex: 1; padding: var(--space-lg); display: flex; flex-direction: column; max-height: calc(100vh - 120px); overflow-y: auto;">
|
||||
<div class="empty-state" style="margin: auto; text-align: center; color: var(--text-muted);">
|
||||
<div style="font-size: 3rem; margin-bottom: var(--space-sm);">📂</div>
|
||||
<h4>Nessun gruppo selezionato</h4>
|
||||
<p style="font-size: 0.85rem;">Seleziona un gruppo dalla barra laterale o creane uno nuovo per iniziare a gestire le relazioni master/slave.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Create/Edit Group Modal -->
|
||||
@@ -89,10 +89,31 @@ const TicketGroupsView = {
|
||||
masterInput.value = prefillMasterTn;
|
||||
}
|
||||
} else if (this.selectedGroupId) {
|
||||
this.selectGroup(this.selectedGroupId);
|
||||
const exists = this.groups.some(g => g.id === this.selectedGroupId);
|
||||
if (exists) {
|
||||
this.selectGroup(this.selectedGroupId);
|
||||
} else {
|
||||
this.selectedGroupId = null;
|
||||
localStorage.removeItem('otrs_selected_group_id');
|
||||
this.renderEmptyDetailsPane();
|
||||
}
|
||||
} else {
|
||||
this.renderEmptyDetailsPane();
|
||||
}
|
||||
},
|
||||
|
||||
renderEmptyDetailsPane() {
|
||||
const detailPane = document.getElementById('group-details-pane');
|
||||
if (!detailPane) return;
|
||||
detailPane.innerHTML = `
|
||||
<div class="empty-state" style="margin: auto; text-align: center; color: var(--text-muted);">
|
||||
<div style="font-size: 3rem; margin-bottom: var(--space-sm);">📂</div>
|
||||
<h4>Nessun gruppo selezionato</h4>
|
||||
<p style="font-size: 0.85rem;">Seleziona un gruppo dalla barra laterale o creane uno nuovo per iniziare a gestire le relazioni master/slave.</p>
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
|
||||
async loadGroups() {
|
||||
try {
|
||||
this.groups = await App.api('/api/groups');
|
||||
@@ -166,12 +187,11 @@ const TicketGroupsView = {
|
||||
this.selectedGroupData = await App.api(`/api/groups/${id}`);
|
||||
this.renderGroupDetails();
|
||||
} catch (err) {
|
||||
Toast.error('Errore nel caricamento del dettaglio gruppo: ' + err.message);
|
||||
detailPane.innerHTML = `
|
||||
<div style="color: var(--danger); text-align: center; padding: var(--space-xl);">
|
||||
Errore nel caricamento dei dati: ${err.message}
|
||||
</div>
|
||||
`;
|
||||
console.warn(`[TicketGroups] Failed to load group ${id}:`, err.message);
|
||||
this.selectedGroupId = null;
|
||||
localStorage.removeItem('otrs_selected_group_id');
|
||||
this.renderGroupsList();
|
||||
this.renderEmptyDetailsPane();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user