From 0ed90aadf1c65fe4973e0e629bf895093fe057da Mon Sep 17 00:00:00 2001
From: Patrick Segura
Date: Thu, 29 Feb 2024 13:31:50 -0600
Subject: [PATCH] Fixed previous names render to now render in bullet
---
.../__snapshots__/index.test.tsx.snap | 40 ++++++++++++++-----
.../__snapshots__/index.test.tsx.snap | 19 +++++++--
.../__snapshots__/index.test.tsx.snap | 19 +++++++--
.../_components/ReadOnlySection/index.tsx | 3 +-
.../_components/ReadOnlySection/util.tsx | 4 +-
5 files changed, 65 insertions(+), 20 deletions(-)
diff --git a/src/components/ShareExport/__snapshots__/index.test.tsx.snap b/src/components/ShareExport/__snapshots__/index.test.tsx.snap
index affa82e623..fcd044e5a6 100644
--- a/src/components/ShareExport/__snapshots__/index.test.tsx.snap
+++ b/src/components/ShareExport/__snapshots__/index.test.tsx.snap
@@ -207,11 +207,22 @@ exports[`ShareExportModal > matches the snapshot 1`] = `
>
Previous names
-
- First NameSecond Name
-
+
+ First Name
+
+
+
+ Second Name
+
+
+
matches the snapshot 2`] = `
>
Previous names
-
- First NameSecond Name
-
+
+ -
+ First Name
+
+
+ -
+ Second Name
+
+
+
matches snapshot 1`] = `
>
Previous names
-
- First NameSecond Name
-
+
+ First Name
+
+
+
+ Second Name
+
+
+
matches snapshot 1`] = `
>
Previous names
-
- First NameSecond Name
-
+
+ First Name
+
+
+
+ Second Name
+
+
+
;
}
diff --git a/src/views/ModelPlan/ReadOnly/_components/ReadOnlySection/util.tsx b/src/views/ModelPlan/ReadOnly/_components/ReadOnlySection/util.tsx
index 8c12cc2d4f..7a636efde8 100644
--- a/src/views/ModelPlan/ReadOnly/_components/ReadOnlySection/util.tsx
+++ b/src/views/ModelPlan/ReadOnly/_components/ReadOnlySection/util.tsx
@@ -28,9 +28,9 @@ export const formatListValues = <
| TranslationFieldPropertiesWithOptions, // Translation config
value: T[] | undefined // field value/enum array
): string[] => {
- if (!isTranslationFieldPropertiesWithOptions(config)) return [];
+ if (config.isArray || config.isModelLinks) return value as string[];
- if (config.isModelLinks) return value as string[];
+ if (!isTranslationFieldPropertiesWithOptions(config)) return [];
return getKeys(config.options)
.filter(option => Array.isArray(value) && value?.includes(option))