fix: Admin-Inventarliste zeigt GUID wenn kein Name gesetzt
This commit is contained in:
parent
117d5c7af0
commit
66a5a7d7a5
3 changed files with 9 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ internal data class UpdatePasswordRequest(val password: String)
|
|||
@Serializable
|
||||
internal data class InventoryWithUsersDto(
|
||||
val inventoryId: String,
|
||||
val inventoryName: String,
|
||||
val users: List<UserDto>
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ internal class InventoryRepository {
|
|||
inventoryId = invId
|
||||
)
|
||||
}
|
||||
InventoryWithUsersDto(inventoryId = invId, users = users)
|
||||
InventoryWithUsersDto(inventoryId = invId, inventoryName = invRow[Inventories.name], users = users)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -480,15 +480,19 @@
|
|||
} else {
|
||||
page.forEach(inv => {
|
||||
const tr = document.createElement('tr');
|
||||
const name = inv.inventoryName ? inv.inventoryName : '—';
|
||||
const hasName = inv.inventoryName && inv.inventoryName.trim();
|
||||
const lastUpdFmt = inv.lastUpdated ? new Date(inv.lastUpdated).toLocaleDateString('de-DE') : '–';
|
||||
|
||||
const tdName = document.createElement('td');
|
||||
tdName.textContent = name;
|
||||
if (inv.inventoryName) {
|
||||
if (hasName) {
|
||||
tdName.textContent = inv.inventoryName;
|
||||
const badge = document.createElement('span'); badge.className = 'inv-badge'; badge.title = inv.inventoryId;
|
||||
badge.textContent = inv.inventoryId.slice(0, 8) + '…'; badge.style.marginLeft = '6px';
|
||||
tdName.appendChild(badge);
|
||||
} else {
|
||||
const badge = document.createElement('span'); badge.className = 'inv-badge'; badge.title = inv.inventoryId;
|
||||
badge.textContent = inv.inventoryId;
|
||||
tdName.appendChild(badge);
|
||||
}
|
||||
|
||||
const tds = [tdName];
|
||||
|
|
|
|||
Loading…
Reference in a new issue