ui-soxo-bootstrap-core 2.6.40-dev.13 → 2.6.40-dev.17
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.
|
@@ -354,9 +354,9 @@ const MenuLists = ({ model, match, relativeAdd = false, additional_queries = [],
|
|
|
354
354
|
<Search placeholder="Search menus & sub-menus…" allowClear style={{ width: 300, marginBottom: '0px' }} onChange={onSearch} />
|
|
355
355
|
|
|
356
356
|
<Space size="small">
|
|
357
|
-
<Button onClick={getRecords} size={'small'} type="default">
|
|
357
|
+
{/* <Button onClick={getRecords} size={'small'} type="default">
|
|
358
358
|
<ReloadOutlined />
|
|
359
|
-
</Button>
|
|
359
|
+
</Button> */}
|
|
360
360
|
|
|
361
361
|
<Switch checked={dragMode} onChange={toggleDragMode} checkedChildren="Order On" unCheckedChildren="Order Off" />
|
|
362
362
|
|
|
@@ -489,7 +489,7 @@ const MenuLists = ({ model, match, relativeAdd = false, additional_queries = [],
|
|
|
489
489
|
);
|
|
490
490
|
};
|
|
491
491
|
/* -----------------------------------------------------------------------
|
|
492
|
-
PANEL ACTIONS
|
|
492
|
+
PANEL ACTIONS
|
|
493
493
|
------------------------------------------------------------------------ */
|
|
494
494
|
function panelActions(item, model, setSelectedRecord, setDrawerTitle, setDrawerVisible, deleteRecord) {
|
|
495
495
|
return (
|
|
@@ -597,11 +597,7 @@ function NestedMenu({
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
return (
|
|
600
|
-
<Collapse
|
|
601
|
-
accordion={!searchActive}
|
|
602
|
-
activeKey={openKeys}
|
|
603
|
-
onChange={(keys) => setOpenKeys(Array.isArray(keys) ? keys : keys ? [keys] : [])}
|
|
604
|
-
>
|
|
600
|
+
<Collapse accordion={!searchActive} activeKey={openKeys} onChange={(keys) => setOpenKeys(Array.isArray(keys) ? keys : keys ? [keys] : [])}>
|
|
605
601
|
{localItems.map((child, index) => (
|
|
606
602
|
<Panel
|
|
607
603
|
key={child.id}
|
|
@@ -687,6 +687,29 @@ export default function ReportingDashboard({
|
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
689
|
|
|
690
|
+
/**
|
|
691
|
+
* Filters report records using the same search text that drives the table.
|
|
692
|
+
*
|
|
693
|
+
* @param {Array<Object>} records - Report rows.
|
|
694
|
+
* @param {string} searchText - Current table search text.
|
|
695
|
+
* @returns {Array<Object>} Rows matching the search text.
|
|
696
|
+
*/
|
|
697
|
+
function filterReportRecords(records, searchText) {
|
|
698
|
+
if (!Array.isArray(records)) return [];
|
|
699
|
+
|
|
700
|
+
const query = String(searchText || '').trim().toLowerCase();
|
|
701
|
+
|
|
702
|
+
if (!query) return records;
|
|
703
|
+
|
|
704
|
+
return records.filter((record) =>
|
|
705
|
+
Object.values(record).some((value) => {
|
|
706
|
+
if (value === undefined || value === null || typeof value === 'object') return false;
|
|
707
|
+
|
|
708
|
+
return String(value).toLowerCase().indexOf(query) !== -1;
|
|
709
|
+
})
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
690
713
|
/**
|
|
691
714
|
*
|
|
692
715
|
* @param root0
|
|
@@ -804,13 +827,13 @@ function GuestList({
|
|
|
804
827
|
return col;
|
|
805
828
|
});
|
|
806
829
|
const summaryCols = columns.filter((col) => col.enable_summary);
|
|
807
|
-
let dataToExport = [...patients];
|
|
830
|
+
let dataToExport = [...filterReportRecords(patients, query)];
|
|
808
831
|
|
|
809
832
|
if (summaryCols.length > 0) {
|
|
810
833
|
// Build one synthetic row for CSV export that mirrors the table layout:
|
|
811
834
|
// numeric summary cells are populated from `calculateSummaryValues`, while
|
|
812
835
|
// non-summary columns stay blank unless a configured caption should be shown.
|
|
813
|
-
const summaryValues = calculateSummaryValues(summaryCols,
|
|
836
|
+
const summaryValues = calculateSummaryValues(summaryCols, dataToExport);
|
|
814
837
|
const summaryRow = { isSummaryRow: true };
|
|
815
838
|
|
|
816
839
|
cols.forEach((col, index) => {
|
|
@@ -837,37 +860,15 @@ function GuestList({
|
|
|
837
860
|
}
|
|
838
861
|
let exportDatas = getExportData(dataToExport, exportCols);
|
|
839
862
|
|
|
840
|
-
if (exportDatas.
|
|
863
|
+
if (exportDatas.exportDataHeaders.length) {
|
|
841
864
|
setExportData({ exportDatas });
|
|
865
|
+
} else {
|
|
866
|
+
setExportData({});
|
|
842
867
|
}
|
|
843
868
|
}
|
|
844
|
-
}, [patients, columns]);
|
|
869
|
+
}, [patients, columns, query]);
|
|
845
870
|
|
|
846
|
-
let filtered;
|
|
847
|
-
|
|
848
|
-
if (patients) {
|
|
849
|
-
filtered = patients.filter((record) => {
|
|
850
|
-
if (query) {
|
|
851
|
-
// Keys
|
|
852
|
-
let keys = Object.keys(record);
|
|
853
|
-
|
|
854
|
-
let flag = false;
|
|
855
|
-
|
|
856
|
-
keys.forEach((key) => {
|
|
857
|
-
let ele = record[key];
|
|
858
|
-
|
|
859
|
-
if (ele && typeof ele === 'string' && ele.toLowerCase().indexOf(query.toLowerCase()) !== -1) {
|
|
860
|
-
flag = true;
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
/**Will return flag */
|
|
865
|
-
return flag;
|
|
866
|
-
} else {
|
|
867
|
-
return true;
|
|
868
|
-
}
|
|
869
|
-
});
|
|
870
|
-
}
|
|
871
|
+
let filtered = filterReportRecords(patients, query);
|
|
871
872
|
|
|
872
873
|
/**
|
|
873
874
|
* Checks for a match in the filtered patient list based on a scanned code,
|
|
@@ -1056,7 +1057,7 @@ function GuestList({
|
|
|
1056
1057
|
dataSource={filtered ? filtered : patients} // In case if there is no filtered values we can use patient data
|
|
1057
1058
|
columns={cols}
|
|
1058
1059
|
sticky
|
|
1059
|
-
pagination={
|
|
1060
|
+
pagination={true}
|
|
1060
1061
|
summary={(pageData) => {
|
|
1061
1062
|
const summaryCols = columns.filter((col) => col.enable_summary);
|
|
1062
1063
|
if (!summaryCols.length) return null;
|