@visns-studio/visns-components 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -116,9 +116,10 @@ function GenericDetail({ setting, urlParam, userProfile }) {
|
|
|
116
116
|
const stringValue = String(value ?? ''); // Convert value to a string
|
|
117
117
|
|
|
118
118
|
// Conditionally truncate the value if the 'truncate' key is present
|
|
119
|
-
const truncatedValue =
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
const truncatedValue =
|
|
120
|
+
truncateLength && truncateLength > 0
|
|
121
|
+
? truncate(stringValue, truncateLength)
|
|
122
|
+
: stringValue;
|
|
122
123
|
|
|
123
124
|
const formatDateValue = (date) => formatDate(date);
|
|
124
125
|
|
|
@@ -170,14 +171,12 @@ function GenericDetail({ setting, urlParam, userProfile }) {
|
|
|
170
171
|
);
|
|
171
172
|
};
|
|
172
173
|
|
|
173
|
-
const renderDate = () => formatDateValue(
|
|
174
|
+
const renderDate = () => formatDateValue(value);
|
|
174
175
|
|
|
175
176
|
const renderExist = () => (truncatedValue ? 'Yes' : 'No');
|
|
176
177
|
|
|
177
178
|
const renderJson = () =>
|
|
178
|
-
|
|
179
|
-
<pre>{JSON.stringify(JSON.parse(truncatedValue), null, 4)}</pre>
|
|
180
|
-
) : null;
|
|
179
|
+
value ? <pre>{JSON.stringify(value, null, 4)}</pre> : null;
|
|
181
180
|
|
|
182
181
|
const renderLatestNotes = () => formatNoteValue();
|
|
183
182
|
|
package/package.json
CHANGED