Compare commits

..

5 Commits

Author SHA1 Message Date
e7662f19e8 Merge branch '4_table-sorting' 2025-06-01 17:30:09 +03:00
69b78e0014 Update Project.vue 2025-06-01 17:28:43 +03:00
f71fe513d2 Update Project.vue 2025-06-01 17:24:35 +03:00
313b2c4895 Merge branch '4_table-sorting' 2025-06-01 17:18:54 +03:00
55248873c5 Fixed broken commit
Previous commit runs only in dev
2025-06-01 17:16:35 +03:00

View File

@@ -108,16 +108,29 @@ function getCellValue(userstory: Userstory, header: TableHeader): string | numbe
if (header.key === "status") { if (header.key === "status") {
return userstory.status_extra_info?.name || userstory.status.toString(); return userstory.status_extra_info?.name || userstory.status.toString();
} }
return userstory[header.key as keyof Userstory] ?? ""; const value = userstory[header.key as keyof Userstory];
if (value === null) return null;
if (typeof value === "string" || typeof value === "number") return value;
if (value === undefined) return "";
return String(value);
} else { } else {
if (header.attributeId === undefined) return "N/A (no attr ID)"; if (header.attributeId === undefined) return "N/A (no attr ID)";
const attributes = dataStore.userstoryAttributesMap.get(userstory.id); const attributes = dataStore.userstoryAttributesMap.get(userstory.id);
if (attributes) { if (attributes) {
// Ключи для кастомных полей приходят как строки const attrValue = attributes[header.attributeId.toString()];
return attributes[header.attributeId.toString()] ?? "";
if (attrValue === null) return null;
if (typeof attrValue === "string" || typeof attrValue === "number") return attrValue;
if (attrValue === undefined) return "";
return String(attrValue);
} }
return isLoadingAttributesForAnyStory.value ? "..." : "";
if (isLoadingAttributesForAnyStory.value && !dataStore.userstoryAttributesMap.has(userstory.id)) {
return "...";
}
return "";
} }
} }
</script> </script>
@@ -137,4 +150,7 @@ function getCellValue(userstory: Userstory, header: TableHeader): string | numbe
table thead tr th { table thead tr th {
font-weight: bold; font-weight: bold;
} }
table thead tr th:hover {
background-color: var(--vt-c-black-soft);
}
</style> </style>