From 33f42e10bd07ce961863d5e0b10562e6d005e998 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 25 Sep 2024 14:20:52 +0200 Subject: [PATCH] Typings --- .../src/components/grid/stores/rows.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/rows.js b/packages/frontend-core/src/components/grid/stores/rows.js index 3ebf610a29..11bddc3a58 100644 --- a/packages/frontend-core/src/components/grid/stores/rows.js +++ b/packages/frontend-core/src/components/grid/stores/rows.js @@ -42,36 +42,27 @@ export const createStores = () => { } function getRelatedTableValues(row, field, isSingle) { - let result = "Not rendable" + let result = "" try { if (isSingle) { result = row[field.related.field]?.[0]?.[field.related.subField] } else { - // TODO: check all types result = Array.from( new Set( row[field.related.field].flatMap(r => r[field.related.subField]) ) ) - switch (field.type) { case FieldType.STRING: case FieldType.NUMBER: case FieldType.BIGINT: + case FieldType.BARCODEQR: result = result.join(", ") break - - case FieldType.JSON: - case FieldType.ATTACHMENTS: - case FieldType.SIGNATURE_SINGLE: - result = result.map(JSON.parse) - break - - case FieldType.LINK: - console.error(`${field.type} type is not rendable`) } } } catch (e) { + result = "Not rendable" console.error(e.message) }