Skip to content

Commit 44420b8

Browse files
lkostrowskiclaude
andcommitted
fix: filter null names in multi-choice attributes and use loading spinner cell
- Filter out null/empty names in AssignedMultiChoiceAttribute before joining to avoid leading/trailing separators - Replace text placeholder "..." with proper loadingCell() spinner for attribute columns while data is being fetched Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7230c7d commit 44420b8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/attributes/utils/assignedAttributes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export function getDisplayValueFromAssignedAttribute(attr: AssignedAttributeItem
99
case "AssignedSingleChoiceAttribute":
1010
return attr.singleChoiceValue?.name ?? "";
1111
case "AssignedMultiChoiceAttribute":
12-
return attr.multiChoiceValue.map((v: { name: string | null }) => v.name).join(", ");
12+
return attr.multiChoiceValue
13+
.map((v: { name: string | null }) => v.name?.trim())
14+
.filter((name): name is string => !!name)
15+
.join(", ");
1316
case "AssignedNumericAttribute":
1417
return attr.numericValue != null ? String(attr.numericValue) : "";
1518
case "AssignedPlainTextAttribute":

src/products/components/ProductListDatagrid/datagrid.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import { type ColumnCategory } from "@dashboard/components/Datagrid/ColumnPicker/useColumns";
1010
import {
1111
dateCell,
12+
loadingCell,
1213
moneyCell,
1314
pillCell,
1415
readonlyTextCell,
@@ -390,7 +391,7 @@ function getAttributeCellContent(
390391
attributesLoading?: boolean,
391392
) {
392393
if (attributesLoading) {
393-
return readonlyTextCell("...", true, "faded");
394+
return loadingCell();
394395
}
395396

396397
if (!productId || !getAssignedAttribute) {

0 commit comments

Comments
 (0)