ui-soxo-bootstrap-core 2.4.25-dev.24 → 2.4.25-dev.26

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.
@@ -163,6 +163,10 @@ export default function SideMenu({ loading, modules = [], callback, appSettings,
163
163
  const onMenuClick = (menu, index) => {
164
164
  const key = menu.path || `menu-${menu.id || index}`;
165
165
 
166
+ if (menu.isRoot) {
167
+ setOpenKeys([]);
168
+ }
169
+
166
170
  setSelectedKeys([key]);
167
171
 
168
172
  if (menu.path) {
@@ -447,7 +451,7 @@ export default function SideMenu({ loading, modules = [], callback, appSettings,
447
451
  // }}
448
452
 
449
453
  onClick={() => {
450
- onMenuClick({ ...menu, parentKey: menu.path || menu.caption }, index);
454
+ onMenuClick({ ...menu, parentKey: menu.path || menu.caption, isRoot: true }, index);
451
455
  }}
452
456
  // key={`${menu.id}-${randomIndex}`}
453
457
  key={menu.path || menu.caption}
@@ -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
- parameters = JSON.parse(record.input_parameters);
172
+
173
+ parameters = record.input_parameters ? JSON.parse(record.input_parameters) : null;
164
174
 
165
175
  let formContent = {};
166
176
 
167
- parameters = await parameters.map((record) => {
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
 
@@ -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
  }
@@ -779,8 +800,7 @@ function GuestList({
779
800
  field: entry.field,
780
801
  title: entry.title,
781
802
  key: entry.field,
782
- width: entry.width || 160,
783
- ellipsis: true,
803
+ width: entry.width ? parseInt(entry.width) : undefined,
784
804
  fixed: entry.isFixedColumn ? entry.isFixedColumn : null, // Conditionally setting the 'fixed' key to 'left' if 'isColumnStatic' is true; otherwise, setting it to null.
785
805
  // Check if filtering is enabled and patients is an array
786
806
  filters:
@@ -1168,3 +1188,5 @@ function GuestList({
1168
1188
  // </Card>
1169
1189
  // );
1170
1190
  // }
1191
+ // );
1192
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.4.25-dev.24",
3
+ "version": "2.4.25-dev.26",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"