@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 = truncateLength
120
- ? truncate(stringValue, truncateLength)
121
- : stringValue;
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(truncatedValue);
174
+ const renderDate = () => formatDateValue(value);
174
175
 
175
176
  const renderExist = () => (truncatedValue ? 'Yes' : 'No');
176
177
 
177
178
  const renderJson = () =>
178
- truncatedValue ? (
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
@@ -44,7 +44,7 @@
44
44
  "react-dom": "^17.0.1"
45
45
  },
46
46
  "name": "@visns-studio/visns-components",
47
- "version": "2.6.1",
47
+ "version": "2.6.2",
48
48
  "description": "Various packages to assist in the development of our Custom Applications.",
49
49
  "main": "index.js",
50
50
  "scripts": {