ui-soxo-bootstrap-core 2.4.24 → 2.4.25-dev.11

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.
Files changed (37) hide show
  1. package/.github/workflows/npm-publish.yml +37 -15
  2. package/core/components/extra-info/extra-info-details.js +109 -126
  3. package/core/components/landing-api/landing-api.js +22 -30
  4. package/core/lib/Store.js +20 -18
  5. package/core/lib/components/index.js +4 -1
  6. package/core/lib/components/sidemenu/sidemenu.js +153 -256
  7. package/core/lib/components/sidemenu/sidemenu.scss +39 -26
  8. package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +119 -42
  9. package/core/lib/elements/basic/rangepicker/rangepicker.js +118 -29
  10. package/core/lib/elements/basic/switch/switch.js +35 -25
  11. package/core/lib/hooks/index.js +2 -12
  12. package/core/lib/hooks/use-otp-timer.js +99 -0
  13. package/core/lib/pages/login/login.js +255 -139
  14. package/core/lib/pages/login/login.scss +140 -32
  15. package/core/models/dashboard/dashboard.js +14 -0
  16. package/core/models/doctor/components/doctor-add/doctor-add.js +403 -0
  17. package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -0
  18. package/core/models/menus/components/menu-add/menu-add.js +220 -267
  19. package/core/models/menus/components/menu-lists/menu-lists.js +366 -211
  20. package/core/models/menus/components/menu-lists/menu-lists.scss +6 -2
  21. package/core/models/menus/menus.js +256 -267
  22. package/core/models/roles/components/role-add/role-add.js +265 -228
  23. package/core/models/roles/components/role-list/role-list.js +326 -348
  24. package/core/models/roles/roles.js +191 -174
  25. package/core/models/staff/components/staff-add/staff-add.js +352 -0
  26. package/core/models/staff/components/staff-add/staff-add.scss +0 -0
  27. package/core/models/users/components/user-add/user-add.js +723 -367
  28. package/core/models/users/components/user-add/user-edit.js +90 -0
  29. package/core/models/users/users.js +318 -165
  30. package/core/modules/index.js +5 -8
  31. package/core/modules/reporting/components/index.js +5 -0
  32. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +65 -2
  33. package/core/modules/steps/action-buttons.js +79 -0
  34. package/core/modules/steps/steps.js +553 -0
  35. package/core/modules/steps/steps.scss +158 -0
  36. package/core/modules/steps/timeline.js +49 -0
  37. package/package.json +2 -2
@@ -21,6 +21,9 @@ import './reporting-dashboard.scss';
21
21
  // import MenuDashBoard from '../../../../pages/homepage-api/menu-dashboard';
22
22
  import MenuDashBoardComponent from '../../../../lib/elements/basic/menu-dashboard/menu-dashboard';
23
23
  import { useHistory } from 'react-router-dom';
24
+
25
+ import * as ReportingDashboardComp from '../index';
26
+
24
27
  // import { isPdfFile } from 'pdfjs-dist';
25
28
 
26
29
  var genericComponents = require('./../../../../lib');
@@ -50,6 +53,7 @@ export default function ReportingDashboard({
50
53
  barcodeFilterKey,
51
54
  showScanner,
52
55
  dbPtr,
56
+ attributes,
53
57
  }) {
54
58
  const [config, setConfig] = useState({});
55
59
 
@@ -283,7 +287,6 @@ export default function ReportingDashboard({
283
287
  if (result?.result && result?.result[0]) {
284
288
  resultDetails = result.result[0];
285
289
  }
286
-
287
290
  // Update patients
288
291
  setPatients(resultDetails || []);
289
292
 
@@ -300,6 +303,7 @@ export default function ReportingDashboard({
300
303
  }
301
304
  } catch (error) {
302
305
  console.error('Error fetching report data:', error);
306
+ message.warn('Please try again');
303
307
  } finally {
304
308
  // Always runs, success or error
305
309
  setLoading(false);
@@ -519,12 +523,14 @@ export default function ReportingDashboard({
519
523
  isFixedIndex={isFixedIndex}
520
524
  showScanner={showScanner}
521
525
  barcodeFilterKey={barcodeFilterKey}
522
- CustomComponents={{ ...CustomComponents, ...genericComponents }}
526
+ CustomComponents={{ ...CustomComponents, ...genericComponents, ...ReportingDashboardComp }}
523
527
  refresh={refresh}
524
528
  config={config}
525
529
  loading={cardLoading}
526
530
  pagination={pagination}
527
531
  handlePagination={handlePagination}
532
+ attributes={attributes}
533
+ fetchReportData={(paginationUpdate) => fetchReportData(id, formContents, dbPtr, paginationUpdate || pagination)}
528
534
  />
529
535
  {/** GuestList component end*/}
530
536
  </>
@@ -556,8 +562,19 @@ function GuestList({
556
562
  config,
557
563
  pagination,
558
564
  handlePagination,
565
+ attributes,
566
+ fetchReportData,
559
567
  }) {
568
+
569
+ /**
570
+ * @param {*} propValues
571
+ */
572
+ const propValues = (attributes && JSON.parse(attributes)) || {};
573
+
574
+ const { buttonAttributes = [] } = propValues;
575
+
560
576
  var [query, setQuery] = useState('');
577
+
561
578
  const [exportData, setExportData] = useState({});
562
579
 
563
580
  // const [data, setData] = useState([]);
@@ -571,9 +588,14 @@ function GuestList({
571
588
  // patient object to redirect to upon successful QR scan.
572
589
  const [redirectPatient, setRedirectPatient] = useState(null);
573
590
 
591
+ const [visible, setVisible] = useState(false);
592
+
593
+ const [ActiveComponent, setActiveComponent] = useState(null);
594
+
574
595
  let history = useHistory();
575
596
 
576
597
  const { isMobile, dispatch } = useContext(GlobalContext);
598
+ const [single, setSingle] = useState({});
577
599
 
578
600
  const getRedirectLink = (entry, record) => {
579
601
  let redirectLink = entry.redirect_link;
@@ -928,6 +950,25 @@ function GuestList({
928
950
  }
929
951
  };
930
952
 
953
+ //open the edit modal
954
+ const handleOpenEdit = (button) => {
955
+ const componentName = button.component;
956
+ const ComponentToRender = ReportingDashboardComp[componentName];
957
+
958
+ if (!ComponentToRender) {
959
+ console.error(`Component ${componentName} not found!`);
960
+ return;
961
+ }
962
+
963
+ setSingle({});
964
+ setActiveComponent(() => ComponentToRender);
965
+ setVisible(true);
966
+ };
967
+
968
+ // close the edit modal
969
+ const handleCloseEdit = () => {
970
+ setShowEdit(false);
971
+ };
931
972
  return (
932
973
  <>
933
974
  <div className="table-header">
@@ -945,6 +986,28 @@ function GuestList({
945
986
  Scan QR
946
987
  </Button>
947
988
  ) : null}
989
+ {/** Add User button */}
990
+ {Array.isArray(buttonAttributes) &&
991
+ buttonAttributes.map((btn, index) => (
992
+ <Button key={index} size="small" type="primary" style={{ marginLeft: 8 }} onClick={() => handleOpenEdit(btn)}>
993
+ {btn.title}
994
+ </Button>
995
+ ))}
996
+
997
+ <Modal open={visible} onCancel={() => setVisible(false)} footer={null} destroyOnClose width={950} style={{ top: 10 }}>
998
+ {ActiveComponent && (
999
+ <ActiveComponent
1000
+ formContent={single}
1001
+ callback={() => {
1002
+ setVisible(false);
1003
+ refresh();
1004
+ setVisible(false);
1005
+ fetchReportData();
1006
+ }}
1007
+ // {...dynamicProps}
1008
+ />
1009
+ )}
1010
+ </Modal>
948
1011
 
949
1012
  <Modal open={isScannerVisible} title="Scan QR Code" footer={null} onCancel={() => setScannerVisible(false)} destroyOnClose>
950
1013
  <QrScanner onScanSuccess={handleScanSuccess} onClose={() => setScannerVisible(false)} />
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import { Card, Skeleton } from 'antd';
3
+ import { Button } from '../../lib';
4
+
5
+ export default function ActionButtons({
6
+ loading,
7
+ steps,
8
+ activeStep,
9
+ isStepCompleted,
10
+ renderDynamicComponent,
11
+ handlePrevious,
12
+ handleNext,
13
+ handleSkip,
14
+ handleFinish,
15
+ handleStartNextProcess,
16
+ nextProcessId,
17
+ timelineCollapsed,
18
+ }) {
19
+ return (
20
+ <>
21
+ <div style={{ minHeight: 300 }}>
22
+ {loading ? <Skeleton active /> : renderDynamicComponent()}
23
+
24
+ </div>
25
+ <>
26
+ <div style={{ marginTop: 20, display: 'flex', justifyContent: 'flex-start', gap: '10px' }}>
27
+ {/* Back button */}
28
+ <Button disabled={activeStep === 0} onClick={handlePrevious} style={{ marginRight: 8 ,borderRadius: 4, }}>
29
+ Back
30
+ </Button>
31
+
32
+ {/* Skip button */}
33
+ {steps.length > 0 && steps[activeStep]?.allow_skip === 'Y' && (
34
+ <Button type="default" onClick={handleSkip}
35
+ style={{
36
+ borderRadius: 4,
37
+ }}
38
+ disabled={activeStep === steps.length - 1}>
39
+ Skip
40
+ </Button>
41
+ )}
42
+
43
+ {/* Next / Finish / Start Next */}
44
+ {steps[activeStep]?.order_seqtype === 'E' ? (
45
+ nextProcessId?.next_process_id ? (
46
+ <Button type="primary"
47
+ style={{
48
+ borderRadius: 4,
49
+ }}
50
+ onClick={handleStartNextProcess}>
51
+ Start Next {nextProcessId.next_process_name}
52
+ </Button>
53
+ ) : (
54
+ <Button type="primary"
55
+ style={{
56
+ borderRadius: 4,
57
+ }}
58
+ onClick={handleFinish}>
59
+ Finish
60
+ </Button>
61
+ )
62
+ ) : (
63
+ <Button
64
+ type="primary"
65
+ // shape="round"
66
+ style={{
67
+ borderRadius: 4,
68
+ }}
69
+ disabled={activeStep === steps.length - 1 || !isStepCompleted}
70
+ onClick={handleNext}
71
+ >
72
+ Next →
73
+ </Button>
74
+ )}
75
+ </div>
76
+ </>
77
+ </>
78
+ );
79
+ }