ui-soxo-bootstrap-core 2.4.25-dev.24 → 2.4.25-dev.25
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.
|
@@ -106,8 +106,17 @@ export default function ReportingDashboard({
|
|
|
106
106
|
setPatients([]);
|
|
107
107
|
const fetchId = idOverride || id;
|
|
108
108
|
await CoreScripts.getRecord({ id: fetchId, dbPtr }).then(async ({ result }) => {
|
|
109
|
+
// Check if display columns are provided from backend
|
|
110
|
+
if (result.display_columns) {
|
|
111
|
+
// Parse and set columns from stored JSON
|
|
112
|
+
|
|
113
|
+
setColumns(JSON.parse(result.display_columns));
|
|
114
|
+
} else {
|
|
115
|
+
// Reset columns if no display columns exist
|
|
116
|
+
|
|
117
|
+
setColumns([]);
|
|
118
|
+
}
|
|
109
119
|
await prepareInputParameters(result);
|
|
110
|
-
setColumns(JSON.parse(result.display_columns));
|
|
111
120
|
|
|
112
121
|
if (result.summary_columns) {
|
|
113
122
|
setSummaryColumns(JSON.parse(result.summary_columns));
|
|
@@ -160,11 +169,12 @@ export default function ReportingDashboard({
|
|
|
160
169
|
if (urlParams.script_id) scriptId.current = urlParams.script_id;
|
|
161
170
|
|
|
162
171
|
let otherDetails = record.other_details1 ? JSON.parse(record.other_details1) : null;
|
|
163
|
-
|
|
172
|
+
|
|
173
|
+
parameters = record.input_parameters ? JSON.parse(record.input_parameters) : null;
|
|
164
174
|
|
|
165
175
|
let formContent = {};
|
|
166
176
|
|
|
167
|
-
parameters = await parameters
|
|
177
|
+
parameters = await parameters?.map((record) => {
|
|
168
178
|
// Only if the url params does have a matching value ,
|
|
169
179
|
// we should not consider the default value
|
|
170
180
|
|
|
@@ -210,7 +220,7 @@ export default function ReportingDashboard({
|
|
|
210
220
|
if (['reference-select', 'reference-search', 'select'].indexOf(record.type) !== -1) {
|
|
211
221
|
// let model = "";
|
|
212
222
|
let model = CustomModels[record.modelName];
|
|
213
|
-
|
|
223
|
+
|
|
214
224
|
return {
|
|
215
225
|
...record,
|
|
216
226
|
model,
|
|
@@ -289,6 +299,17 @@ export default function ReportingDashboard({
|
|
|
289
299
|
}
|
|
290
300
|
// Update patients
|
|
291
301
|
setPatients(resultDetails || []);
|
|
302
|
+
// Check if columns are not yet defined
|
|
303
|
+
if (columns.length === 0 && resultDetails.length > 0) {
|
|
304
|
+
// Create columns dynamically from resultDetails keys
|
|
305
|
+
setColumns((prev) => {
|
|
306
|
+
if (prev.length > 0) return prev;
|
|
307
|
+
return Object.keys(resultDetails[0]).map((key) => ({
|
|
308
|
+
title: key,
|
|
309
|
+
field: key,
|
|
310
|
+
}));
|
|
311
|
+
});
|
|
312
|
+
}
|
|
292
313
|
|
|
293
314
|
if (result.length) {
|
|
294
315
|
// Set Pgination data into URL
|
|
@@ -739,7 +760,7 @@ function GuestList({
|
|
|
739
760
|
|
|
740
761
|
// If the column type is 'span', render the field inside a <span> with inline color style
|
|
741
762
|
} else if (entry.columnType === 'span') {
|
|
742
|
-
return <span style={{ color: record.color_code }}>{record[entry.field]}</span>;
|
|
763
|
+
return <span style={{ color: record.color_code, overflowWrap: 'break-word', WebkitLineClamp: 3 }}>{record[entry.field]}</span>;
|
|
743
764
|
}
|
|
744
765
|
} else {
|
|
745
766
|
/**
|
|
@@ -771,7 +792,7 @@ function GuestList({
|
|
|
771
792
|
}
|
|
772
793
|
} else {
|
|
773
794
|
//If the value is neither 'Y' nor 'N', return the actual field value
|
|
774
|
-
return <span style={{ color: textColor }}>{record[entry.field]}</span>;
|
|
795
|
+
return <span style={{ color: textColor, whiteSpace: 'pre-wrap', overflowWrap: 'break-word' }}>{record[entry.field]}</span>;
|
|
775
796
|
}
|
|
776
797
|
}
|
|
777
798
|
}
|
|
@@ -1168,3 +1189,5 @@ function GuestList({
|
|
|
1168
1189
|
// </Card>
|
|
1169
1190
|
// );
|
|
1170
1191
|
// }
|
|
1192
|
+
// );
|
|
1193
|
+
// }
|