ui-soxo-bootstrap-core 2.6.5 → 2.6.6
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.
- package/.babelrc +8 -8
- package/.github/workflows/npm-publish.yml +33 -33
- package/.husky/pre-commit +11 -11
- package/.prettierrc.json +10 -10
- package/babel.config.js +2 -2
- package/core/components/component-loader/component-loader.js +125 -125
- package/core/components/component-wrapper/component-wrapper.js +121 -121
- package/core/components/external-window/DEVELOPER_GUIDE.md +705 -705
- package/core/components/external-window/external-window.js +236 -236
- package/core/components/external-window/external-window.test.js +80 -80
- package/core/components/extra-info/extra-info-details.js +155 -155
- package/core/components/extra-info/extra-info-details.scss +26 -26
- package/core/components/extra-info/extra-info.js +134 -134
- package/core/components/index.js +20 -20
- package/core/components/landing-api/landing-api.js +492 -492
- package/core/components/landing-api/landing-api.scss +19 -19
- package/core/components/menu-template-api/menu-template-api.js +321 -321
- package/core/components/root-application-api/root-application-api.js +174 -174
- package/core/index.js +13 -13
- package/core/lib/Store.js +365 -365
- package/core/lib/components/application-bootstrap/application-bootstrap.js +115 -115
- package/core/lib/components/approval-form/approval-form.js +280 -280
- package/core/lib/components/approval-form/approval-form.scss +183 -183
- package/core/lib/components/approval-list/approval-list.js +143 -143
- package/core/lib/components/approval-list/approval-list.scss +2 -2
- package/core/lib/components/approval-list/components/request-card/request-card.js +42 -42
- package/core/lib/components/approval-list/components/request-card/request-card.scss +30 -30
- package/core/lib/components/camera/camera.js +230 -230
- package/core/lib/components/camera/camera.scss +86 -86
- package/core/lib/components/comment-block/comment-block.js +138 -138
- package/core/lib/components/comment-block/comment-block.scss +3 -3
- package/core/lib/components/confirm-modal/confirm-modal.js +82 -82
- package/core/lib/components/confirm-modal/confirm-modal.scss +2 -2
- package/core/lib/components/consent/consent.js +67 -67
- package/core/lib/components/consent/pdf-signature.js +299 -299
- package/core/lib/components/consent/signature-pad.js +90 -90
- package/core/lib/components/consent/signature-pad.scss +14 -14
- package/core/lib/components/file-upload/file-upload.js +133 -133
- package/core/lib/components/finger-print-reader/finger-print-reader.js +295 -295
- package/core/lib/components/finger-print-reader/finger-print-reader.scss +47 -47
- package/core/lib/components/finger-print-search/finger-print-search.js +200 -200
- package/core/lib/components/finger-print-search/finger-print-search.scss +47 -47
- package/core/lib/components/global-header/animations.js +18 -18
- package/core/lib/components/global-header/global-header.js +413 -413
- package/core/lib/components/global-header/global-header.scss +369 -369
- package/core/lib/components/header/generic-header.js +76 -76
- package/core/lib/components/header/generic-header.scss +99 -99
- package/core/lib/components/image-preview/image-preview.js +33 -33
- package/core/lib/components/image-wrapper/image-wrapper.js +108 -108
- package/core/lib/components/image-wrapper/image-wrapper.scss +12 -12
- package/core/lib/components/index.js +206 -206
- package/core/lib/components/landing/landing.js +403 -403
- package/core/lib/components/language-switcher/language-switcher.js +49 -49
- package/core/lib/components/menu-context/menu-context.js +69 -69
- package/core/lib/components/menu-template/menu-template.js +249 -249
- package/core/lib/components/menu-template/menu-template.scss +9 -9
- package/core/lib/components/modal-search/modal-search.js +153 -153
- package/core/lib/components/modal-search/modal-search.scss +78 -78
- package/core/lib/components/modal-wrapper/modal-manager.js +15 -15
- package/core/lib/components/modal-wrapper/modal-wrapper.js +108 -108
- package/core/lib/components/modal-wrapper/modal-wrapper.scss +13 -13
- package/core/lib/components/notice-board/notice-board.js +132 -132
- package/core/lib/components/notice-board/notice-board.scss +65 -65
- package/core/lib/components/page-container/page-container.js +55 -55
- package/core/lib/components/page-container/page-container.scss +8 -8
- package/core/lib/components/page-header/page-header.js +23 -23
- package/core/lib/components/page-header/page-header.scss +17 -17
- package/core/lib/components/pdf-viewer/pdf-viewer.js +56 -56
- package/core/lib/components/portlet-table/components/table-actions/table-actions.js +58 -58
- package/core/lib/components/portlet-table/components/table-actions/table-actions.scss +1 -1
- package/core/lib/components/portlet-table/components/table-data/table-data.js +106 -106
- package/core/lib/components/portlet-table/portlet-table.js +63 -63
- package/core/lib/components/portlet-table/portlet-table.scss +90 -90
- package/core/lib/components/progress-bar/progress-bar.js +58 -58
- package/core/lib/components/progress-bar/progress-bar.scss +15 -15
- package/core/lib/components/request-form/request-form.js +110 -110
- package/core/lib/components/root-application/root-application.js +70 -70
- package/core/lib/components/rupee/rupee.js +14 -14
- package/core/lib/components/script-input/script-input.js +169 -169
- package/core/lib/components/script-input/script-input.scss +8 -8
- package/core/lib/components/sidemenu/animations.js +51 -51
- package/core/lib/components/sidemenu/sidemenu.js +578 -578
- package/core/lib/components/sidemenu/sidemenu.scss +277 -277
- package/core/lib/components/spotlight-search/spotlight-search.component.js +635 -635
- package/core/lib/components/spotlight-search/spotlight-search.component.scss +78 -78
- package/core/lib/components/table-wrapper/table-wrapper.js +135 -135
- package/core/lib/components/table-wrapper/table-wrapper.scss +72 -72
- package/core/lib/components/ui_elements/Loader.js +12 -12
- package/core/lib/components/ui_elements/Notify.js +12 -12
- package/core/lib/components/ui_elements/PlaceHolder.js +33 -33
- package/core/lib/components/web-camera/web-camera.js +161 -161
- package/core/lib/components/web-camera/web-camera.scss +28 -28
- package/core/lib/core.md +9 -9
- package/core/lib/elements/Elements.md +2 -2
- package/core/lib/elements/basic/LoggedUserRedirect.js +21 -21
- package/core/lib/elements/basic/PrivateRoute.js +16 -16
- package/core/lib/elements/basic/button/Button.md +43 -43
- package/core/lib/elements/basic/button/button.js +170 -170
- package/core/lib/elements/basic/card/Card.md +15 -15
- package/core/lib/elements/basic/card/card.js +40 -40
- package/core/lib/elements/basic/card/card.scss +13 -13
- package/core/lib/elements/basic/checkbox/checkbox.js +23 -23
- package/core/lib/elements/basic/col/col.js +15 -15
- package/core/lib/elements/basic/copy-to-clipboard/Readme.md +40 -40
- package/core/lib/elements/basic/copy-to-clipboard/copy-to-clipboard.js +61 -61
- package/core/lib/elements/basic/country-phone-input/Readme.md +98 -98
- package/core/lib/elements/basic/country-phone-input/country-phone-input.js +106 -106
- package/core/lib/elements/basic/country-phone-input/phone-input.scss +61 -61
- package/core/lib/elements/basic/datepicker/datepicker.js +33 -33
- package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +136 -136
- package/core/lib/elements/basic/empty/empty.js +14 -14
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.js +118 -118
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.scss +10 -10
- package/core/lib/elements/basic/form/form.js +70 -70
- package/core/lib/elements/basic/form/form.scss +3 -3
- package/core/lib/elements/basic/image/image.js +45 -45
- package/core/lib/elements/basic/image/image.scss +17 -17
- package/core/lib/elements/basic/image/readme.md +26 -26
- package/core/lib/elements/basic/image-viewer/image-viewer.js +108 -108
- package/core/lib/elements/basic/image-viewer/image-viewer.scss +7 -7
- package/core/lib/elements/basic/input/input.js +81 -81
- package/core/lib/elements/basic/input/readme.md +77 -77
- package/core/lib/elements/basic/json-input/json-input.js +51 -51
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.js +216 -216
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.scss +28 -28
- package/core/lib/elements/basic/menu-tree/menu-tree.js +114 -114
- package/core/lib/elements/basic/modal/modal.js +64 -64
- package/core/lib/elements/basic/modal/readme.md +62 -62
- package/core/lib/elements/basic/popconfirm/popconfirm.js +17 -17
- package/core/lib/elements/basic/popover/popover.js +12 -12
- package/core/lib/elements/basic/radio/radio.js +18 -18
- package/core/lib/elements/basic/rangepicker/rangepicker.js +141 -141
- package/core/lib/elements/basic/rangepicker/rangepicker.scss +24 -24
- package/core/lib/elements/basic/rangepicker/readme.md +81 -81
- package/core/lib/elements/basic/reference-select/readme.md +18 -18
- package/core/lib/elements/basic/reference-select/reference-select.js +337 -337
- package/core/lib/elements/basic/row/row.js +15 -15
- package/core/lib/elements/basic/select/select.js +46 -46
- package/core/lib/elements/basic/select-box/readme.md +52 -52
- package/core/lib/elements/basic/select-box/select-box.js +63 -63
- package/core/lib/elements/basic/skeleton/readme.md +35 -35
- package/core/lib/elements/basic/skeleton/skeleton.js +35 -35
- package/core/lib/elements/basic/skeleton/skeleton.scss +53 -53
- package/core/lib/elements/basic/space/space.js +12 -12
- package/core/lib/elements/basic/switch/readme.md +29 -29
- package/core/lib/elements/basic/switch/switch.js +67 -67
- package/core/lib/elements/basic/tab/tab.js +14 -14
- package/core/lib/elements/basic/table/readme.md +8 -8
- package/core/lib/elements/basic/table/table.js +100 -100
- package/core/lib/elements/basic/tag/tag.js +63 -63
- package/core/lib/elements/basic/tag/tag.scss +2 -2
- package/core/lib/elements/basic/timeline/timeline.js +13 -13
- package/core/lib/elements/basic/title/readme.md +20 -20
- package/core/lib/elements/basic/title/title.js +37 -37
- package/core/lib/elements/basic/user-search/user-search.js +192 -192
- package/core/lib/elements/complex/barcode/barcode.js +27 -27
- package/core/lib/elements/complex/bargraph/bar-graph.js +262 -262
- package/core/lib/elements/complex/basic-table/basic-table.js +110 -110
- package/core/lib/elements/complex/basic-table/basic-table.scss +4 -4
- package/core/lib/elements/complex/date-display/date-display.js +37 -37
- package/core/lib/elements/complex/error-boundary/error-boundary.js +29 -29
- package/core/lib/elements/complex/google-location-input/map-container-library-load.js +92 -92
- package/core/lib/elements/complex/google-map/google-map.js +230 -230
- package/core/lib/elements/complex/google-map/google-map.scss +13 -13
- package/core/lib/elements/complex/line-graph/line-graph.js +108 -108
- package/core/lib/elements/complex/location-search-input/location-search-input.js +100 -100
- package/core/lib/elements/complex/pie-chart/pie-chart.js +202 -202
- package/core/lib/elements/complex/qr-code/qr-code.js +27 -27
- package/core/lib/elements/complex/qrscanner/qrscanner.js +57 -57
- package/core/lib/elements/complex/search-debounce/search-debounce.js +37 -37
- package/core/lib/elements/complex/statistic-card/dashboard-statistic-card.js +75 -75
- package/core/lib/elements/complex/statistic-card/statistic-card.js +28 -28
- package/core/lib/elements/index.js +226 -226
- package/core/lib/hooks/device-detect.js +25 -25
- package/core/lib/hooks/index.js +9 -9
- package/core/lib/hooks/use-location.js +33 -33
- package/core/lib/hooks/use-otp-timer.js +80 -80
- package/core/lib/hooks/use-window-size.js +34 -34
- package/core/lib/i18n.js +69 -69
- package/core/lib/index.js +106 -106
- package/core/lib/introduction.md +73 -73
- package/core/lib/js-styleguide.md +4112 -4112
- package/core/lib/models/actions/actions.js +127 -127
- package/core/lib/models/actions/components/action-detail/action-detail.js +190 -190
- package/core/lib/models/actions/components/custom-actions/custom-actions.js +185 -185
- package/core/lib/models/attachments/attachments.js +231 -231
- package/core/lib/models/base-loader.js +99 -99
- package/core/lib/models/base.js +716 -716
- package/core/lib/models/branches/branches.js +125 -125
- package/core/lib/models/checklists/checklists.js +114 -114
- package/core/lib/models/columns/columns.js +169 -169
- package/core/lib/models/columns/components/columns-add/columns-add.js +171 -171
- package/core/lib/models/comments/comments.js +213 -213
- package/core/lib/models/departments/departments.js +107 -107
- package/core/lib/models/financial-years/financial_years.js +127 -127
- package/core/lib/models/forms/components/form-creator/form-creator.js +624 -624
- package/core/lib/models/forms/components/form-creator/form-creator.scss +30 -29
- package/core/lib/models/forms/components/form-detail/form-detail.js +224 -224
- package/core/lib/models/forms/forms.js +121 -121
- package/core/lib/models/index.js +203 -203
- package/core/lib/models/invoice-numbers/invoice_numbers.js +204 -204
- package/core/lib/models/lookup-types/components/lookup-detail/lookup-detail.js +145 -145
- package/core/lib/models/lookup-types/lookup-types.js +113 -113
- package/core/lib/models/lookup-values/components/lookup-values-add/lookup-values-add.js +126 -126
- package/core/lib/models/lookup-values/lookup-values.js +107 -107
- package/core/lib/models/menu-roles/menu-roles.js +127 -127
- package/core/lib/models/menus/components/menu-add/menu-add.js +228 -228
- package/core/lib/models/menus/components/menu-detail/menu-detail.js +170 -170
- package/core/lib/models/menus/components/menu-list/menu-list.js +593 -593
- package/core/lib/models/menus/components/menu-list/menu-list.scss +5 -5
- package/core/lib/models/menus/components/menu-roles-add/menu-roles-add.js +183 -183
- package/core/lib/models/menus/menus.js +499 -499
- package/core/lib/models/models/components/model-detail/model-detail.js +137 -137
- package/core/lib/models/models/components/models.js +128 -128
- package/core/lib/models/modules/modules.js +204 -204
- package/core/lib/models/outbox/outbox.js +73 -73
- package/core/lib/models/pages/pages.js +107 -107
- package/core/lib/models/permissions/permissions.js +71 -71
- package/core/lib/models/process/components/process-add/process-add.js +181 -181
- package/core/lib/models/process/components/process-dashboard/process-dashboard.js +601 -601
- package/core/lib/models/process/components/process-dashboard/process-dashboard.scss +62 -62
- package/core/lib/models/process/components/process-detail/process-detail.js +140 -140
- package/core/lib/models/process/components/process-timeline/process-timeline.js +139 -139
- package/core/lib/models/process/components/task-detail/task-detail.js +240 -240
- package/core/lib/models/process/components/task-detail/task-detail.scss +27 -27
- package/core/lib/models/process/components/task-form/task-form.js +528 -528
- package/core/lib/models/process/components/task-form/task-form.scss +7 -7
- package/core/lib/models/process/components/task-list/task-list.js +221 -221
- package/core/lib/models/process/components/task-list/task-list.scss +14 -14
- package/core/lib/models/process/components/task-overview/task-overview.js +299 -299
- package/core/lib/models/process/components/task-overview-legacy/task-overview-legacy.js +192 -192
- package/core/lib/models/process/components/task-routes/task-routes.js +45 -45
- package/core/lib/models/process/components/task-status/task-status.js +175 -175
- package/core/lib/models/process/components/task-status/task-status.scss +11 -11
- package/core/lib/models/process/process.js +780 -780
- package/core/lib/models/process-transactions/process-transactions.js +123 -123
- package/core/lib/models/roles/roles.js +106 -106
- package/core/lib/models/scripts/scripts.js +111 -111
- package/core/lib/models/step-transactions/step-transcations.js +147 -147
- package/core/lib/models/steps/components/step-add/step-add.js +261 -261
- package/core/lib/models/steps/components/step-detail/step-detail.js +157 -157
- package/core/lib/models/steps/steps.js +356 -356
- package/core/lib/models/user-preferences/user-preferences.js +83 -83
- package/core/lib/models/users/components/user-add/user-add.js +226 -226
- package/core/lib/models/users/users.js +119 -119
- package/core/lib/modules/business/launch-page/launch-page.js +29 -29
- package/core/lib/modules/business/launch-page/launch-page.scss +5 -5
- package/core/lib/modules/business/slots/slots.js +231 -231
- package/core/lib/modules/business/slots/slots.scss +108 -108
- package/core/lib/modules/forms/components/field-customizer/field-customizer.js +138 -138
- package/core/lib/modules/forms/components/field-selector/field-selector.js +157 -157
- package/core/lib/modules/forms/components/field-selector/field-selector.scss +25 -25
- package/core/lib/modules/forms/components/form-display/form-display.js +203 -203
- package/core/lib/modules/forms/components/form-display/form-display.scss +9 -9
- package/core/lib/modules/forms/components/tab-customizer/tab-customizer.js +124 -124
- package/core/lib/modules/generic/generic-add/generic-add.js +213 -213
- package/core/lib/modules/generic/generic-detail/generic-detail.js +199 -199
- package/core/lib/modules/generic/generic-edit/generic-edit.js +120 -120
- package/core/lib/modules/generic/generic-list/ExportReactCSV.js +62 -62
- package/core/lib/modules/generic/generic-list/generic-list.js +705 -705
- package/core/lib/modules/generic/generic-list/generic-list.scss +34 -34
- package/core/lib/modules/generic/generic-upload/generic-upload.js +483 -483
- package/core/lib/modules/generic/table-settings/table-settings.js +226 -226
- package/core/lib/modules/generic/table-settings/table-settings.scss +37 -37
- package/core/lib/modules/index.js +52 -52
- package/core/lib/modules/modules-routes/module-routes.js +35 -35
- package/core/lib/pages/change-password/change-password.js +201 -201
- package/core/lib/pages/change-password/change-password.scss +73 -73
- package/core/lib/pages/homepage/homepage.js +53 -53
- package/core/lib/pages/index.js +19 -19
- package/core/lib/pages/login/commnication-mode-selection.js +46 -46
- package/core/lib/pages/login/communication-mode-selection.scss +60 -60
- package/core/lib/pages/login/login.js +864 -864
- package/core/lib/pages/login/login.scss +344 -344
- package/core/lib/pages/login/reset-password.js +125 -125
- package/core/lib/pages/login/reset-password.scss +22 -22
- package/core/lib/pages/manage-users/manage-users.js +429 -429
- package/core/lib/pages/manage-users/manage-users.scss +25 -25
- package/core/lib/pages/profile/profile.js +247 -247
- package/core/lib/pages/profile/profile.scss +107 -107
- package/core/lib/pages/profile/theme-config.js +18 -18
- package/core/lib/pages/profile/themes-backup.json +310 -310
- package/core/lib/pages/profile/themes.json +254 -254
- package/core/lib/pages/register/register.js +176 -176
- package/core/lib/pages/register/register.scss +128 -128
- package/core/lib/react-styleguide.md +756 -756
- package/core/lib/utils/api/api.utils.js +211 -211
- package/core/lib/utils/api/readme.md +426 -426
- package/core/lib/utils/async.js +35 -35
- package/core/lib/utils/common/common.utils.js +223 -223
- package/core/lib/utils/common/readme.md +30 -30
- package/core/lib/utils/date/date.utils.js +295 -295
- package/core/lib/utils/date/readme.md +2 -2
- package/core/lib/utils/firebase.support.utils.js +98 -98
- package/core/lib/utils/firebase.utils.js +808 -808
- package/core/lib/utils/form/form.utils.js +255 -255
- package/core/lib/utils/generic/generic.utils.js +69 -69
- package/core/lib/utils/http/auth.helper.js +95 -95
- package/core/lib/utils/http/http.utils.js +158 -158
- package/core/lib/utils/http/readme.md +14 -14
- package/core/lib/utils/index.js +40 -40
- package/core/lib/utils/location/location.utils.js +137 -137
- package/core/lib/utils/location/readme.md +18 -18
- package/core/lib/utils/modal.utils.js +15 -15
- package/core/lib/utils/notification.utils.js +34 -34
- package/core/lib/utils/pwa/pwa.utils.js +88 -88
- package/core/lib/utils/script.utils.js +235 -235
- package/core/lib/utils/setting.utils.js +68 -68
- package/core/lib/utils/upload.utils.js +29 -29
- package/core/models/Preference/Preferences.js +46 -46
- package/core/models/base/base.js +403 -403
- package/core/models/base-clone-loader.js +107 -107
- package/core/models/base-clone.js +187 -187
- package/core/models/base-loader.js +97 -97
- package/core/models/core-scripts/core-scripts.js +150 -150
- package/core/models/dashboard/dashboard.js +201 -201
- package/core/models/detail-loader.js +88 -88
- package/core/models/doctor/components/doctor-add/doctor-add.js +427 -427
- package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -32
- package/core/models/groups.js +82 -82
- package/core/models/index.js +100 -100
- package/core/models/lookup-types/components/lookup-detail/lookup-detail.js +129 -129
- package/core/models/lookup-types/lookup-types.js +96 -96
- package/core/models/lookup-values/components/lookup-values-modal/lookup-values-modal.js +95 -95
- package/core/models/lookup-values/lookup-values.js +92 -92
- package/core/models/menu-roles/components/menu-roles-add/menu-roles-add.js +153 -153
- package/core/models/menu-roles/menu-roles.js +158 -158
- package/core/models/menus/components/menu-add/menu-add.js +288 -288
- package/core/models/menus/components/menu-add/menu-add.scss +31 -31
- package/core/models/menus/components/menu-detail/menu-detail.js +263 -263
- package/core/models/menus/components/menu-list/menu-list.js +392 -392
- package/core/models/menus/components/menu-lists/menu-lists.js +585 -585
- package/core/models/menus/components/menu-lists/menu-lists.scss +46 -46
- package/core/models/menus/menus.js +310 -310
- package/core/models/model-columns.js +121 -121
- package/core/models/models/components/model-detail/model-add.js +120 -120
- package/core/models/models/components/model-detail/model-detail.js +133 -133
- package/core/models/models/models.js +154 -154
- package/core/models/pages/components/page-add/page-add.js +163 -163
- package/core/models/pages/components/page-add/page-add.scss +30 -30
- package/core/models/pages/components/page-details/page-details.js +209 -209
- package/core/models/pages/components/page-list/page-list.js +248 -248
- package/core/models/pages/pages.js +142 -142
- package/core/models/pages.js +142 -142
- package/core/models/roles/components/role-add/role-add.js +312 -312
- package/core/models/roles/components/role-add/role-add.scss +4 -4
- package/core/models/roles/components/role-list/role-list.js +386 -386
- package/core/models/roles/roles.js +196 -196
- package/core/models/staff/components/staff-add/staff-add.js +467 -467
- package/core/models/user-roles/components/user-roles-add/user-roles-add.js +149 -149
- package/core/models/user-roles/user-roles.js +113 -113
- package/core/models/users/components/assign-role/assign-role.js +406 -406
- package/core/models/users/components/assign-role/assign-role.scss +281 -281
- package/core/models/users/components/assign-role/avatar-props.js +45 -45
- package/core/models/users/components/user-add/user-add.js +856 -856
- package/core/models/users/components/user-add/user-edit.js +106 -106
- package/core/models/users/components/user-detail/user-detail.js +236 -236
- package/core/models/users/components/user-list/user-list.js +397 -397
- package/core/models/users/users.js +379 -379
- package/core/modules/Informations/change-info/change-info.js +618 -618
- package/core/modules/Informations/change-info/change-info.scss +134 -134
- package/core/modules/dashboard/components/dashboard-card/animations.js +64 -64
- package/core/modules/dashboard/components/dashboard-card/dashboard-card.js +197 -197
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.js +430 -430
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.scss +59 -59
- package/core/modules/dashboard/components/pop-query-dashboard/pop-query-dashboard.js +66 -66
- package/core/modules/generic/components/generic-add/generic-add.js +121 -121
- package/core/modules/generic/components/generic-add/generic-add.scss +13 -13
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.js +125 -125
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.scss +13 -13
- package/core/modules/generic/components/generic-detail/generic-detail.js +184 -184
- package/core/modules/generic/components/generic-detail/generic-detail.scss +25 -25
- package/core/modules/generic/components/generic-edit/generic-edit.js +123 -123
- package/core/modules/generic/components/generic-list/generic-list.js +335 -335
- package/core/modules/generic/components/generic-list/generic-list.scss +35 -35
- package/core/modules/index.js +42 -42
- package/core/modules/module-routes/module-routes.js +37 -37
- package/core/modules/reporting/components/index.js +6 -6
- package/core/modules/reporting/components/reporting-dashboard/README.md +316 -0
- package/core/modules/reporting/components/reporting-dashboard/display-columns/build-display-columns.js +74 -0
- package/core/modules/reporting/components/reporting-dashboard/display-columns/build-display-columns.test.js +74 -0
- package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.js +252 -0
- package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.test.js +126 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +880 -1206
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.scss +171 -171
- package/core/modules/steps/action-buttons.js +74 -76
- package/core/modules/steps/action-buttons.scss +44 -15
- package/core/modules/steps/steps.js +348 -346
- package/core/modules/steps/steps.scss +357 -159
- package/core/modules/steps/timeline.js +56 -54
- package/core/pages/homepage-api/homepage-api.js +106 -106
- package/core/pages/homepage-api/homepage-api.scss +233 -233
- package/core/pages/homepage-api/menu-dashboard.js +169 -169
- package/core/pages/homepage-api/menu-dashboard.scss +11 -11
- package/core/translation.json +53 -53
- package/core/translations.json +19 -19
- package/core/utils/script.utils.js +129 -129
- package/core/utils/settings.utils.js +25 -25
- package/eslint.config.mjs +79 -79
- package/index.js +35 -35
- package/jest.config.js +7 -7
- package/jest.setup.js +1 -1
- package/package.json +123 -123
- package/tsconfig.json +26 -26
- package/webpack.config.js +173 -173
|
@@ -1,1206 +1,880 @@
|
|
|
1
|
-
import React, { useState, useEffect, useContext, useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Table, Skeleton, Input,
|
|
4
|
-
|
|
5
|
-
import { QrcodeOutlined } from '@ant-design/icons';
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
import '
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} props -
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {
|
|
40
|
-
* @param {string} props.
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const [
|
|
62
|
-
|
|
63
|
-
const [
|
|
64
|
-
|
|
65
|
-
const [
|
|
66
|
-
|
|
67
|
-
const [
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const [
|
|
80
|
-
|
|
81
|
-
const [
|
|
82
|
-
|
|
83
|
-
const [
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
//
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
//
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
//
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
let
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
);
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
{
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
//
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
)
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
//
|
|
646
|
-
|
|
647
|
-
//
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
if (
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
];
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
*
|
|
885
|
-
* @param {*} result
|
|
886
|
-
*/
|
|
887
|
-
|
|
888
|
-
// function changeView(result) {
|
|
889
|
-
// setView(result);
|
|
890
|
-
// }
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
*
|
|
894
|
-
* @param {*} event
|
|
895
|
-
*/
|
|
896
|
-
|
|
897
|
-
function onSearch(event) {
|
|
898
|
-
setQuery(event.target.value);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
*
|
|
903
|
-
*/
|
|
904
|
-
|
|
905
|
-
useEffect(() => {
|
|
906
|
-
//Cheaking if there is patient data exists
|
|
907
|
-
if (patients) {
|
|
908
|
-
let data = patients?.map((entry) => {
|
|
909
|
-
entry.rowIndex = entry.opb_id;
|
|
910
|
-
|
|
911
|
-
entry.dispatch = dispatch;
|
|
912
|
-
|
|
913
|
-
return entry;
|
|
914
|
-
});
|
|
915
|
-
|
|
916
|
-
// setData(data);
|
|
917
|
-
|
|
918
|
-
// Define export data
|
|
919
|
-
// Sanitize cols for export to ensure titles are strings
|
|
920
|
-
const exportCols = cols.map((col) => {
|
|
921
|
-
if (col.title && typeof col.title === 'object' && col.title.props) {
|
|
922
|
-
return { ...col, title: col.title.props.title };
|
|
923
|
-
}
|
|
924
|
-
return col;
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
let exportDatas = getExportData(patients, exportCols);
|
|
928
|
-
|
|
929
|
-
if (exportDatas.exportDataColumns.length && exportDatas.exportDataHeaders.length) {
|
|
930
|
-
setExportData({ exportDatas });
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
}, [patients, columns]);
|
|
934
|
-
|
|
935
|
-
let filtered;
|
|
936
|
-
|
|
937
|
-
if (patients) {
|
|
938
|
-
filtered = patients.filter((record) => {
|
|
939
|
-
if (query) {
|
|
940
|
-
// Keys
|
|
941
|
-
let keys = Object.keys(record);
|
|
942
|
-
|
|
943
|
-
let flag = false;
|
|
944
|
-
|
|
945
|
-
keys.forEach((key) => {
|
|
946
|
-
let ele = record[key];
|
|
947
|
-
|
|
948
|
-
if (ele && typeof ele === 'string' && ele.toLowerCase().indexOf(query.toLowerCase()) !== -1) {
|
|
949
|
-
flag = true;
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
|
|
953
|
-
/**Will return flag */
|
|
954
|
-
return flag;
|
|
955
|
-
} else {
|
|
956
|
-
return true;
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* Checks for a match in the filtered patient list based on a scanned code,
|
|
963
|
-
* updates the relevant state if a match is found, and redirects to the
|
|
964
|
-
* patient's detail page. Displays a warning if no match is found.
|
|
965
|
-
*
|
|
966
|
-
* @param {string} code - The scanned code to match against a specific field of each patient.
|
|
967
|
-
*/
|
|
968
|
-
|
|
969
|
-
const handleScanSuccess = (code) => {
|
|
970
|
-
// Filters patients based on the scanned code and the selected barcode key(using attributes 'barcodeFilterKey')
|
|
971
|
-
const matched = filtered.filter((patient) => patient[barcodeFilterKey] === code);
|
|
972
|
-
|
|
973
|
-
if (matched.length) {
|
|
974
|
-
const patient = matched[0];
|
|
975
|
-
setFilteredPatients(matched);
|
|
976
|
-
setRedirectPatient(matched);
|
|
977
|
-
message.success(`Match found for ${code}, redirecting...`);
|
|
978
|
-
|
|
979
|
-
const actionColumn = columns.find((col) => col.field === 'action');
|
|
980
|
-
if (actionColumn) {
|
|
981
|
-
const redirectLink = getRedirectLink(actionColumn, patient);
|
|
982
|
-
// history.push(redirectLink);
|
|
983
|
-
window.location.href = redirectLink;
|
|
984
|
-
}
|
|
985
|
-
} else {
|
|
986
|
-
Modal.warning({
|
|
987
|
-
title: 'No matching records.',
|
|
988
|
-
content: `No match for scanned code: ${code}`,
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
};
|
|
992
|
-
|
|
993
|
-
//open the edit modal
|
|
994
|
-
const handleOpenEdit = (button) => {
|
|
995
|
-
const componentName = button.component;
|
|
996
|
-
const ComponentToRender = ReportingDashboardComp[componentName];
|
|
997
|
-
|
|
998
|
-
if (!ComponentToRender) {
|
|
999
|
-
console.error(`Component ${componentName} not found!`);
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
setSingle({});
|
|
1004
|
-
setActiveComponent(() => ComponentToRender);
|
|
1005
|
-
setVisible(true);
|
|
1006
|
-
};
|
|
1007
|
-
|
|
1008
|
-
// close the edit modal
|
|
1009
|
-
const handleCloseEdit = () => {
|
|
1010
|
-
setShowEdit(false);
|
|
1011
|
-
};
|
|
1012
|
-
return (
|
|
1013
|
-
<>
|
|
1014
|
-
<div className="table-header">
|
|
1015
|
-
<div className="table-left">
|
|
1016
|
-
{/* shwoing caption is not correct so this commented */}
|
|
1017
|
-
{/* <span className="menu-caption">{config.caption}</span> */}
|
|
1018
|
-
<Search placeholder="Enter Search Value" allowClear onChange={onSearch} />
|
|
1019
|
-
{/* <p className="size-hint">{patients.length} records.</p> */}
|
|
1020
|
-
</div>
|
|
1021
|
-
|
|
1022
|
-
<div className="table-right">
|
|
1023
|
-
{/* QR Scan start */}
|
|
1024
|
-
{showScanner ? (
|
|
1025
|
-
<Button size="small" type="primary" icon={<QrcodeOutlined />} onClick={() => setScannerVisible(true)}>
|
|
1026
|
-
Scan QR
|
|
1027
|
-
</Button>
|
|
1028
|
-
) : null}
|
|
1029
|
-
{/** Add User button */}
|
|
1030
|
-
{Array.isArray(buttonAttributes) &&
|
|
1031
|
-
buttonAttributes.map((btn, index) => (
|
|
1032
|
-
<Button key={index} size="small" type="primary" style={{ marginLeft: 8 }} onClick={() => handleOpenEdit(btn)}>
|
|
1033
|
-
{btn.title}
|
|
1034
|
-
</Button>
|
|
1035
|
-
))}
|
|
1036
|
-
|
|
1037
|
-
<Modal open={visible} onCancel={() => setVisible(false)} footer={null} destroyOnClose width={950} style={{ top: 10 }}>
|
|
1038
|
-
{ActiveComponent && (
|
|
1039
|
-
<ActiveComponent
|
|
1040
|
-
formContent={single}
|
|
1041
|
-
callback={() => {
|
|
1042
|
-
setVisible(false);
|
|
1043
|
-
refresh();
|
|
1044
|
-
setVisible(false);
|
|
1045
|
-
fetchReportData();
|
|
1046
|
-
}}
|
|
1047
|
-
// {...dynamicProps}
|
|
1048
|
-
/>
|
|
1049
|
-
)}
|
|
1050
|
-
</Modal>
|
|
1051
|
-
|
|
1052
|
-
<Modal open={isScannerVisible} title="Scan QR Code" footer={null} onCancel={() => setScannerVisible(false)} destroyOnClose>
|
|
1053
|
-
<QrScanner onScanSuccess={handleScanSuccess} onClose={() => setScannerVisible(false)} />
|
|
1054
|
-
</Modal>
|
|
1055
|
-
|
|
1056
|
-
<div>
|
|
1057
|
-
{/* QR Scan End */}
|
|
1058
|
-
{/*table data export to csc component*/}
|
|
1059
|
-
{exportData.exportDatas && (
|
|
1060
|
-
<ExportReactCSV
|
|
1061
|
-
title={config.caption}
|
|
1062
|
-
headers={exportData.exportDatas.exportDataHeaders}
|
|
1063
|
-
csvData={exportData.exportDatas.exportDataColumns}
|
|
1064
|
-
/>
|
|
1065
|
-
)}
|
|
1066
|
-
</div>
|
|
1067
|
-
</div>
|
|
1068
|
-
</div>
|
|
1069
|
-
|
|
1070
|
-
<div>
|
|
1071
|
-
{/* {view ? (
|
|
1072
|
-
<>
|
|
1073
|
-
<CardList dataSource={data} columns={columns} />
|
|
1074
|
-
</>
|
|
1075
|
-
) : (
|
|
1076
|
-
<> */}
|
|
1077
|
-
<Card>
|
|
1078
|
-
{loading ? (
|
|
1079
|
-
<>
|
|
1080
|
-
<Skeleton active paragraph={{ rows: 6 }} />
|
|
1081
|
-
</>
|
|
1082
|
-
) : (
|
|
1083
|
-
<TableComponent
|
|
1084
|
-
size="small"
|
|
1085
|
-
scroll={{ x: 'max-content' }}
|
|
1086
|
-
rowKey={(record) => record.OpNo}
|
|
1087
|
-
dataSource={filtered ? filtered : patients} // In case if there is no filtered values we can use patient data
|
|
1088
|
-
columns={cols}
|
|
1089
|
-
pagination={false}
|
|
1090
|
-
// title={config.caption}
|
|
1091
|
-
summary={(pageData) => {
|
|
1092
|
-
// Variable to save the summary data
|
|
1093
|
-
let summary = {};
|
|
1094
|
-
|
|
1095
|
-
let summaryColumns = [
|
|
1096
|
-
{ field: 'opb_amt', title: 'Amount' },
|
|
1097
|
-
{ field: 'opb_netamt', title: 'Net Amount' },
|
|
1098
|
-
];
|
|
1099
|
-
|
|
1100
|
-
let tableColumns = cols;
|
|
1101
|
-
|
|
1102
|
-
// Creating a copy of columns to append the summary configuration that is needed to set
|
|
1103
|
-
tableColumns.forEach((record, index) => {
|
|
1104
|
-
summaryColumns.forEach((inner) => {
|
|
1105
|
-
if (record.field === inner.field) {
|
|
1106
|
-
tableColumns[index].summary = inner;
|
|
1107
|
-
}
|
|
1108
|
-
});
|
|
1109
|
-
});
|
|
1110
|
-
|
|
1111
|
-
// Initialize
|
|
1112
|
-
summaryColumns.map((item) => {
|
|
1113
|
-
return (summary[item.field] = 0);
|
|
1114
|
-
});
|
|
1115
|
-
|
|
1116
|
-
// Find the total
|
|
1117
|
-
summaryColumns.map((item) => {
|
|
1118
|
-
pageData.forEach((entry) => {
|
|
1119
|
-
return (summary[item.field] = summary[item.field] + entry[item.field]);
|
|
1120
|
-
});
|
|
1121
|
-
});
|
|
1122
|
-
|
|
1123
|
-
return (
|
|
1124
|
-
<>
|
|
1125
|
-
<Table.Summary.Row>
|
|
1126
|
-
{tableColumns.map((column, key) => {
|
|
1127
|
-
return <Table.Summary.Cell key={key}>{column.summary ? <>{summary[column.summary.field]}</> : null}</Table.Summary.Cell>;
|
|
1128
|
-
})}
|
|
1129
|
-
</Table.Summary.Row>
|
|
1130
|
-
</>
|
|
1131
|
-
);
|
|
1132
|
-
}}
|
|
1133
|
-
/>
|
|
1134
|
-
)}
|
|
1135
|
-
|
|
1136
|
-
{/* Pagination aligned to the right */}
|
|
1137
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 8 }}>
|
|
1138
|
-
<Pagination
|
|
1139
|
-
showSizeChanger
|
|
1140
|
-
current={pagination.current}
|
|
1141
|
-
pageSize={pagination.pageSize}
|
|
1142
|
-
total={pagination.total}
|
|
1143
|
-
pageSizeOptions={[20, 30, 50, 100]}
|
|
1144
|
-
onChange={(page, pageSize) => handlePagination({ current: page, pageSize })}
|
|
1145
|
-
/>
|
|
1146
|
-
</div>
|
|
1147
|
-
|
|
1148
|
-
{/*If patient data exists show the number else to 0 */}
|
|
1149
|
-
<p className="size-hint">{patients ? patients.length : 0} records. </p>
|
|
1150
|
-
</Card>
|
|
1151
|
-
{/* </> */}
|
|
1152
|
-
{/* )} */}
|
|
1153
|
-
</div>
|
|
1154
|
-
</>
|
|
1155
|
-
);
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
// //Mobile view card Section
|
|
1159
|
-
// function CardList({ dataSource, url }) {
|
|
1160
|
-
// const { user = {}, dispatch } = useContext(GlobalContext);
|
|
1161
|
-
|
|
1162
|
-
// function onClick(item) {
|
|
1163
|
-
// Location.navigate({
|
|
1164
|
-
// url: `/lab-detail/${item.BillID}`,
|
|
1165
|
-
// });
|
|
1166
|
-
|
|
1167
|
-
// dispatch({ type: 'index', payload: item.rowIndex });
|
|
1168
|
-
// }
|
|
1169
|
-
|
|
1170
|
-
// return dataSource.map((item, index) => {
|
|
1171
|
-
// // to={`/lab-detail/${item.BillID}`}
|
|
1172
|
-
// return (
|
|
1173
|
-
// <div
|
|
1174
|
-
// key={index}
|
|
1175
|
-
// className="report-item"
|
|
1176
|
-
// onClick={() => {
|
|
1177
|
-
// onClick(item);
|
|
1178
|
-
// }}
|
|
1179
|
-
// >
|
|
1180
|
-
// <GuestCard record={item} />
|
|
1181
|
-
// </div>
|
|
1182
|
-
// );
|
|
1183
|
-
// });
|
|
1184
|
-
// }
|
|
1185
|
-
|
|
1186
|
-
// function GuestCard({ record }) {
|
|
1187
|
-
// return (
|
|
1188
|
-
// <Card className="card vehicle-card">
|
|
1189
|
-
// <div className="card">
|
|
1190
|
-
// <h2 className="title">{record.PName}</h2>
|
|
1191
|
-
|
|
1192
|
-
// <h4 className="values">{record.OpNo}</h4>
|
|
1193
|
-
|
|
1194
|
-
// <h3 className="values">{record.Test}</h3>
|
|
1195
|
-
|
|
1196
|
-
// <h3 className="values">Primary Result : {record.PrimaryResult || 'Pending'}</h3>
|
|
1197
|
-
|
|
1198
|
-
// <Text type="secondary">{record.Mobile}</Text>
|
|
1199
|
-
|
|
1200
|
-
// <h4 className="values">{record.Date}</h4>
|
|
1201
|
-
// </div>
|
|
1202
|
-
// </Card>
|
|
1203
|
-
// );
|
|
1204
|
-
// }
|
|
1205
|
-
// );
|
|
1206
|
-
// }
|
|
1
|
+
import React, { useState, useEffect, useContext, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Table, Skeleton, Input, Modal, message, Pagination } from 'antd';
|
|
4
|
+
|
|
5
|
+
import { QrcodeOutlined } from '@ant-design/icons';
|
|
6
|
+
|
|
7
|
+
import { Location, FormCreator, GlobalContext, ExportReactCSV, getExportData, Card, TableComponent, QrScanner } from './../../../../lib/';
|
|
8
|
+
|
|
9
|
+
import { CoreScripts } from './../../../../models/';
|
|
10
|
+
|
|
11
|
+
import moment from 'moment-timezone';
|
|
12
|
+
|
|
13
|
+
import Button from '../../../../lib/elements/basic/button/button';
|
|
14
|
+
|
|
15
|
+
import './reporting-dashboard.scss';
|
|
16
|
+
|
|
17
|
+
// import MenuDashBoard from '../../../../pages/homepage-api/menu-dashboard';
|
|
18
|
+
import MenuDashBoardComponent from '../../../../lib/elements/basic/menu-dashboard/menu-dashboard';
|
|
19
|
+
import { useHistory } from 'react-router-dom';
|
|
20
|
+
|
|
21
|
+
import * as ReportingDashboardComp from '../index';
|
|
22
|
+
import buildDisplayColumns from './display-columns/build-display-columns';
|
|
23
|
+
import { getRedirectLink } from './display-columns/display-cell-renderer';
|
|
24
|
+
|
|
25
|
+
// import { isPdfFile } from 'pdfjs-dist';
|
|
26
|
+
|
|
27
|
+
var genericComponents = require('./../../../../lib');
|
|
28
|
+
|
|
29
|
+
const { Search } = Input;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ReportingDashboard component renders the dashboard and handles patient details,
|
|
33
|
+
* configuration, and form layout for generating reports.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} props - The component's props.
|
|
36
|
+
* @param {Object} props.match - The match object containing the URL parameters.
|
|
37
|
+
* @param {Object} props.CustomComponents - Custom components for rendering.
|
|
38
|
+
* @param {string} props.reportId - The report ID.
|
|
39
|
+
* @param {boolean} props.isFixedIndex - Determines if the index is fixed.
|
|
40
|
+
* @param {Array<string>} props.dashBoardIds - The list of dashboard IDs.
|
|
41
|
+
*
|
|
42
|
+
* @returns {JSX.Element} The rendered ReportingDashboard component.
|
|
43
|
+
*/
|
|
44
|
+
export default function ReportingDashboard({
|
|
45
|
+
match,
|
|
46
|
+
scope,
|
|
47
|
+
CustomComponents,
|
|
48
|
+
reportId,
|
|
49
|
+
isFixedIndex,
|
|
50
|
+
dashBoardIds,
|
|
51
|
+
barcodeFilterKey,
|
|
52
|
+
showScanner,
|
|
53
|
+
dbPtr,
|
|
54
|
+
attributes,
|
|
55
|
+
}) {
|
|
56
|
+
const [config, setConfig] = useState({});
|
|
57
|
+
|
|
58
|
+
// State to manage the layout of the form
|
|
59
|
+
const [formLayout, setFormLayout] = useState('inline');
|
|
60
|
+
|
|
61
|
+
const [loading, setLoading] = useState(true);
|
|
62
|
+
|
|
63
|
+
const [cardLoading, setCardLoading] = useState(true);
|
|
64
|
+
|
|
65
|
+
const [dashboardVisible, setDashBoardVisible] = useState(false);
|
|
66
|
+
|
|
67
|
+
const [formContents, setformContents] = useState({});
|
|
68
|
+
|
|
69
|
+
const scriptId = useRef(null);
|
|
70
|
+
|
|
71
|
+
//In case of reports from core_script , there will be id from params
|
|
72
|
+
// In case of normal menu we need to take id from props
|
|
73
|
+
let id = reportId ? reportId : match.params.id;
|
|
74
|
+
|
|
75
|
+
const { CustomModels = {} } = useContext(GlobalContext);
|
|
76
|
+
|
|
77
|
+
const [details, setDetails] = useState([]);
|
|
78
|
+
|
|
79
|
+
const [columns, setColumns] = useState([]); // To set columns
|
|
80
|
+
|
|
81
|
+
const [summaryColumns, setSummaryColumns] = useState([]);
|
|
82
|
+
|
|
83
|
+
const [patients, setPatients] = useState([]); //Patients list array
|
|
84
|
+
|
|
85
|
+
const urlParams = Location.search();
|
|
86
|
+
|
|
87
|
+
// Pagination
|
|
88
|
+
const [pagination, setPagination] = useState({
|
|
89
|
+
current: 1,
|
|
90
|
+
pageSize: 20,
|
|
91
|
+
total: 0,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Settings db pointer
|
|
95
|
+
if (!dbPtr) dbPtr = localStorage.db_ptr;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Fetches patient details from the server and updates the relevant state.
|
|
99
|
+
* This includes input parameters, columns, summary columns, and configuration.
|
|
100
|
+
*
|
|
101
|
+
* @returns {Promise<void>} A promise that resolves when the patient details have been fetched and the state has been updated.
|
|
102
|
+
*/
|
|
103
|
+
async function getPatientDetails(idOverride) {
|
|
104
|
+
setPatients([]);
|
|
105
|
+
const fetchId = idOverride || id;
|
|
106
|
+
await CoreScripts.getRecord({ id: fetchId, dbPtr }).then(async ({ result }) => {
|
|
107
|
+
// Check if display columns are provided from backend
|
|
108
|
+
if (result.display_columns) {
|
|
109
|
+
// Parse and set columns from stored JSON
|
|
110
|
+
|
|
111
|
+
setColumns(JSON.parse(result.display_columns));
|
|
112
|
+
} else {
|
|
113
|
+
// Reset columns if no display columns exist
|
|
114
|
+
|
|
115
|
+
setColumns([]);
|
|
116
|
+
}
|
|
117
|
+
await prepareInputParameters(result);
|
|
118
|
+
|
|
119
|
+
if (result.summary_columns) {
|
|
120
|
+
setSummaryColumns(JSON.parse(result.summary_columns));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
setConfig({ ...result });
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// useEffect(() => {
|
|
128
|
+
// if (!dashboardVisible) {
|
|
129
|
+
// refresh(false);
|
|
130
|
+
// }
|
|
131
|
+
// }, [dashboardVisible]);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
*
|
|
136
|
+
* Manage initial render
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
getPatientDetails();
|
|
141
|
+
}, []);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Effect hook that triggers the `getPatientDetails` function
|
|
145
|
+
* whenever the `match.params.id` value changes.
|
|
146
|
+
*
|
|
147
|
+
* @returns {void} This hook does not return anything.
|
|
148
|
+
*/
|
|
149
|
+
// useEffect(() => {
|
|
150
|
+
// getPatientDetails();
|
|
151
|
+
// }, [match.params.id]);
|
|
152
|
+
|
|
153
|
+
let parameters;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Some parameters would need binding with the model
|
|
157
|
+
*
|
|
158
|
+
* @param {*} inputParameters Input parameters from the report configuration.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
//Prepare input parameters by mapping default values and binding models if needed
|
|
162
|
+
async function prepareInputParameters(record) {
|
|
163
|
+
setLoading(true);
|
|
164
|
+
let urlParams = Location.search();
|
|
165
|
+
|
|
166
|
+
// If script id exist set into variable
|
|
167
|
+
if (urlParams.script_id) scriptId.current = urlParams.script_id;
|
|
168
|
+
|
|
169
|
+
let otherDetails = record.other_details1 ? JSON.parse(record.other_details1) : null;
|
|
170
|
+
|
|
171
|
+
parameters = record.input_parameters ? JSON.parse(record.input_parameters) : null;
|
|
172
|
+
|
|
173
|
+
let formContent = {};
|
|
174
|
+
|
|
175
|
+
parameters = await parameters?.map((record) => {
|
|
176
|
+
// Only if the url params does have a matching value ,
|
|
177
|
+
// we should not consider the default value
|
|
178
|
+
|
|
179
|
+
if (urlParams[record.field]) {
|
|
180
|
+
if (record.type === 'date') {
|
|
181
|
+
formContent[record.field] = moment.utc(urlParams[record.field]);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// return formContent;
|
|
185
|
+
} else {
|
|
186
|
+
// let StartDate, EndDate;
|
|
187
|
+
switch (record.default) {
|
|
188
|
+
case 'startOfDay':
|
|
189
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE).startOf('day');
|
|
190
|
+
break;
|
|
191
|
+
|
|
192
|
+
case 'endOfDay':
|
|
193
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE).endOf('day');
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case 'startOfWeek':
|
|
197
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE).startOf('week');
|
|
198
|
+
break;
|
|
199
|
+
|
|
200
|
+
case 'endOfWeek':
|
|
201
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE).endOf('week');
|
|
202
|
+
break;
|
|
203
|
+
|
|
204
|
+
case 'currentDate':
|
|
205
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE);
|
|
206
|
+
break;
|
|
207
|
+
|
|
208
|
+
default:
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// If it is a date field and still no value, set it to today's date
|
|
214
|
+
if (record.type === 'date' && !formContent[record.field]) {
|
|
215
|
+
formContent[record.field] = moment().tz(process.env.REACT_APP_TIMEZONE);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (['reference-select', 'reference-search', 'select'].indexOf(record.type) !== -1) {
|
|
219
|
+
// let model = "";
|
|
220
|
+
let model = CustomModels[record.modelName];
|
|
221
|
+
|
|
222
|
+
return {
|
|
223
|
+
...record,
|
|
224
|
+
model,
|
|
225
|
+
required: record.required,
|
|
226
|
+
};
|
|
227
|
+
} else {
|
|
228
|
+
return {
|
|
229
|
+
...record,
|
|
230
|
+
required: true,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
// Update form content state
|
|
235
|
+
setformContents(formContent);
|
|
236
|
+
|
|
237
|
+
// Trigger form submission
|
|
238
|
+
onFinish(formContent, null, record.input_parameters);
|
|
239
|
+
|
|
240
|
+
setLoading(false);
|
|
241
|
+
|
|
242
|
+
// Check if input parameters are enabled or disabled in otherDetails
|
|
243
|
+
if (otherDetails?.isDisableInputParameters) {
|
|
244
|
+
// If enabled, clear the details array
|
|
245
|
+
setDetails([]);
|
|
246
|
+
} else {
|
|
247
|
+
//// Filter the array "parameters" and keep only elements where "type" is present (truthy)
|
|
248
|
+
//Keep only parameters that have a "type" → used for UI display
|
|
249
|
+
let filter = parameters.filter((ele) => ele.type);
|
|
250
|
+
// Update the "details" state with the filtered results
|
|
251
|
+
|
|
252
|
+
setDetails([...filter]);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Refresh patient details.
|
|
257
|
+
|
|
258
|
+
function refresh() {
|
|
259
|
+
getPatientDetails();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const fetchReportData = async (id, values, dbPtr, pagination) => {
|
|
263
|
+
const { current, pageSize } = pagination || {};
|
|
264
|
+
// If card script id is exist load that id otherwise load id
|
|
265
|
+
const coreScriptId = scriptId.current ? scriptId.current : id;
|
|
266
|
+
|
|
267
|
+
setLoading(true);
|
|
268
|
+
try {
|
|
269
|
+
// Prepare payload for backend: format only here
|
|
270
|
+
const formattedValues = {};
|
|
271
|
+
Object.keys(values).forEach((key) => {
|
|
272
|
+
const val = values[key];
|
|
273
|
+
formattedValues[key] = moment.isMoment(val) ? val.format('YYYY-MM-DD') : val;
|
|
274
|
+
});
|
|
275
|
+
// Pagination Data
|
|
276
|
+
const paginationData = {
|
|
277
|
+
page: pagination.current || 1,
|
|
278
|
+
limit: pagination.pageSize || 10,
|
|
279
|
+
};
|
|
280
|
+
// Combine form data + pagination
|
|
281
|
+
let formBody = {
|
|
282
|
+
body: {
|
|
283
|
+
...formattedValues,
|
|
284
|
+
...paginationData,
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
// Optional override if `scope` exists
|
|
288
|
+
if (scope) {
|
|
289
|
+
formBody = { body: { ...scope, ...paginationData } };
|
|
290
|
+
}
|
|
291
|
+
// Fetch result
|
|
292
|
+
const result = await CoreScripts.getReportingLisitng(coreScriptId, formBody, dbPtr);
|
|
293
|
+
|
|
294
|
+
const apiData = Array.isArray(result) ? result : Array.isArray(result?.result) ? result.result : [];
|
|
295
|
+
|
|
296
|
+
// Handle both result formats
|
|
297
|
+
let resultDetails = apiData[0] || [];
|
|
298
|
+
if (result?.result && result?.result[0]) {
|
|
299
|
+
resultDetails = result.result[0];
|
|
300
|
+
}
|
|
301
|
+
// Update patients
|
|
302
|
+
setPatients(resultDetails || []);
|
|
303
|
+
// Check if columns are not yet defined
|
|
304
|
+
if (columns.length === 0 && resultDetails.length > 0) {
|
|
305
|
+
// Create columns dynamically from resultDetails keys
|
|
306
|
+
setColumns((prev) => {
|
|
307
|
+
if (prev.length > 0) return prev;
|
|
308
|
+
return Object.keys(resultDetails[0]).map((key) => ({
|
|
309
|
+
title: key,
|
|
310
|
+
field: key,
|
|
311
|
+
}));
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (result.length) {
|
|
316
|
+
// Set Pgination data into URL
|
|
317
|
+
Location.search({ ...Location.search(), current, pageSize });
|
|
318
|
+
|
|
319
|
+
setPagination((prev) => ({
|
|
320
|
+
...prev,
|
|
321
|
+
current: pagination.current,
|
|
322
|
+
pageSize: pagination.pageSize,
|
|
323
|
+
total: resultDetails?.[0]?.TotalCount ?? pagination?.total,
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
326
|
+
} catch (error) {
|
|
327
|
+
console.error('Error fetching report data:', error);
|
|
328
|
+
} finally {
|
|
329
|
+
// Always runs, success or error
|
|
330
|
+
setLoading(false);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
// Handle Submit
|
|
335
|
+
const handleSubmit = (values) => {
|
|
336
|
+
const { pageSize } = pagination;
|
|
337
|
+
const resetPage = 1;
|
|
338
|
+
|
|
339
|
+
// Reset script id on Submit
|
|
340
|
+
scriptId.current = null;
|
|
341
|
+
|
|
342
|
+
// Get current query params
|
|
343
|
+
const currentUrlParams = Location.search();
|
|
344
|
+
const { script_id, selected_card, ...cleanParams } = currentUrlParams;
|
|
345
|
+
|
|
346
|
+
// Construct new query string
|
|
347
|
+
const newParams = new URLSearchParams({
|
|
348
|
+
...cleanParams,
|
|
349
|
+
current: resetPage,
|
|
350
|
+
pageSize,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// Replace URL
|
|
354
|
+
const newUrl = `${window.location.pathname}?${newParams.toString()}`;
|
|
355
|
+
window.history.replaceState({}, '', newUrl);
|
|
356
|
+
|
|
357
|
+
// Trigger submit handler
|
|
358
|
+
onFinish(values, resetPage);
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
*
|
|
363
|
+
* @param {*} values
|
|
364
|
+
*/
|
|
365
|
+
|
|
366
|
+
const onFinish = async (values, resetPage, inputParamsString) => {
|
|
367
|
+
setLoading(true);
|
|
368
|
+
setCardLoading(true);
|
|
369
|
+
// // Check if the dashboard is visible and both start and end values are provided
|
|
370
|
+
// If true, proceed with hiding the dashboard by setting dashboardVisible to false
|
|
371
|
+
if (dashboardVisible && values.start && values.end) {
|
|
372
|
+
setDashBoardVisible((prev) => {
|
|
373
|
+
if (!prev) return prev; // Prevent unnecessary updates
|
|
374
|
+
|
|
375
|
+
return false;
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
const paramsString = inputParamsString || (config.input_parameters ? config.input_parameters : null);
|
|
379
|
+
// Cheacking if there is data and making the data url friendly, ie, if there is date in url
|
|
380
|
+
if (paramsString) {
|
|
381
|
+
let urlsToUpdate = {};
|
|
382
|
+
|
|
383
|
+
let parameterValue = JSON.parse(paramsString);
|
|
384
|
+
|
|
385
|
+
// Variable to store/update the form initial Values
|
|
386
|
+
|
|
387
|
+
let formContent = {};
|
|
388
|
+
|
|
389
|
+
parameters = parameterValue.map((parameter) => {
|
|
390
|
+
//Getting url friendly value by matching the url values and input_parameter values
|
|
391
|
+
let value = values[parameter.field];
|
|
392
|
+
|
|
393
|
+
// Keep Moment object in state for picker
|
|
394
|
+
if (parameter.type === 'date' && value) {
|
|
395
|
+
formContent[parameter.field] = value.isValid ? value : moment(value); // ensure Moment
|
|
396
|
+
// Format for URL
|
|
397
|
+
urlsToUpdate[parameter.field] = moment(value).format('YYYY-MM-DD');
|
|
398
|
+
} else {
|
|
399
|
+
formContent[parameter.field] = value;
|
|
400
|
+
if (parameter.type) {
|
|
401
|
+
urlsToUpdate[parameter.field] = value;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return parameter;
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
// Remove keys with undefined, null, or empty string values
|
|
409
|
+
const filteredParams = Object.fromEntries(
|
|
410
|
+
Object.entries(urlsToUpdate).filter(([_, value]) => value !== undefined && value !== null && value !== '')
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
setformContents(formContent);
|
|
414
|
+
Location.search({ ...Location.search(), ...filteredParams });
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Reset Pagination Data
|
|
418
|
+
const latestUrlParams = Location.search();
|
|
419
|
+
const paginationData = {
|
|
420
|
+
current: resetPage || Number(latestUrlParams.current) || 1,
|
|
421
|
+
pageSize: Number(latestUrlParams.pageSize) || pagination.pageSize,
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
// Call API
|
|
425
|
+
try {
|
|
426
|
+
await fetchReportData(id, values, dbPtr, paginationData);
|
|
427
|
+
} finally {
|
|
428
|
+
setLoading(false);
|
|
429
|
+
setCardLoading(false);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
// Pagination Handler
|
|
434
|
+
const handlePagination = async (newPagination) => {
|
|
435
|
+
try {
|
|
436
|
+
await fetchReportData(id, formContents, dbPtr, newPagination);
|
|
437
|
+
} finally {
|
|
438
|
+
setLoading(false);
|
|
439
|
+
setCardLoading(false);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
let model = {
|
|
444
|
+
fields: details,
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
return (
|
|
448
|
+
<Card className="reporting-dashboard card card-shadow">
|
|
449
|
+
{/** If dashBoardIds exist and contain elements, render MenuDashBoard*/}
|
|
450
|
+
|
|
451
|
+
{dashBoardIds?.length > 0 ? (
|
|
452
|
+
<MenuDashBoardComponent
|
|
453
|
+
dashBoardIds={dashBoardIds} //Pass the available dashboard IDs to the componen
|
|
454
|
+
activeId={Number(urlParams?.selected_card || 0)}
|
|
455
|
+
callback={(record) => {
|
|
456
|
+
const selectedCard = record?.id;
|
|
457
|
+
if (record.other_details) {
|
|
458
|
+
// Convert the other_details string to a JSON object
|
|
459
|
+
let json = JSON.parse(record.other_details);
|
|
460
|
+
const newScriptId = json.script_id;
|
|
461
|
+
|
|
462
|
+
scriptId.current = newScriptId;
|
|
463
|
+
|
|
464
|
+
// Reset Pagination on card click
|
|
465
|
+
setPagination((prev) => ({
|
|
466
|
+
...prev,
|
|
467
|
+
current: 1,
|
|
468
|
+
total: 0,
|
|
469
|
+
}));
|
|
470
|
+
|
|
471
|
+
//Update URL
|
|
472
|
+
Location.search({
|
|
473
|
+
...Location.search(),
|
|
474
|
+
current: 1,
|
|
475
|
+
pageSize: pagination.pageSize,
|
|
476
|
+
script_id: newScriptId,
|
|
477
|
+
selected_card: selectedCard,
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
// menudashBoardVisible = true;
|
|
481
|
+
// Show the dashboard component
|
|
482
|
+
setDashBoardVisible(true);
|
|
483
|
+
// Fetch and update patient details based on the selected item
|
|
484
|
+
getPatientDetails(newScriptId);
|
|
485
|
+
// setDashBoard(true);
|
|
486
|
+
}
|
|
487
|
+
}}
|
|
488
|
+
></MenuDashBoardComponent>
|
|
489
|
+
) : null}
|
|
490
|
+
|
|
491
|
+
{/* Content Below */}
|
|
492
|
+
{loading ? (
|
|
493
|
+
<>
|
|
494
|
+
<Skeleton active />
|
|
495
|
+
</>
|
|
496
|
+
) : (
|
|
497
|
+
<>
|
|
498
|
+
<div>
|
|
499
|
+
{/* <Card className="form-card" style={{ padding: '10px 10px' }}> */}
|
|
500
|
+
{details && details[0] && !loading ? (
|
|
501
|
+
<FormCreator
|
|
502
|
+
{...formLayout}
|
|
503
|
+
layout={formLayout}
|
|
504
|
+
initialValues={{
|
|
505
|
+
layout: formLayout,
|
|
506
|
+
}}
|
|
507
|
+
styles={{ paddingRight: '15px', alignItems: 'center' }}
|
|
508
|
+
fields={details}
|
|
509
|
+
formContent={formContents}
|
|
510
|
+
// formContent={{ [model]: {} }}
|
|
511
|
+
modelIndex="requestId"
|
|
512
|
+
model={model}
|
|
513
|
+
onSubmit={handleSubmit}
|
|
514
|
+
callback={() => {
|
|
515
|
+
// history.goBack();
|
|
516
|
+
}}
|
|
517
|
+
/>
|
|
518
|
+
) : null}
|
|
519
|
+
{/* </Card> */}
|
|
520
|
+
</div>
|
|
521
|
+
|
|
522
|
+
{/** GuestList component start*/}
|
|
523
|
+
<GuestList
|
|
524
|
+
patients={patients}
|
|
525
|
+
columns={columns}
|
|
526
|
+
summaryColumns={summaryColumns}
|
|
527
|
+
isFixedIndex={isFixedIndex}
|
|
528
|
+
showScanner={showScanner}
|
|
529
|
+
barcodeFilterKey={barcodeFilterKey}
|
|
530
|
+
CustomComponents={{ ...CustomComponents, ...genericComponents, ...ReportingDashboardComp }}
|
|
531
|
+
refresh={refresh}
|
|
532
|
+
config={config}
|
|
533
|
+
loading={cardLoading}
|
|
534
|
+
pagination={pagination}
|
|
535
|
+
handlePagination={handlePagination}
|
|
536
|
+
attributes={attributes}
|
|
537
|
+
fetchReportData={(paginationUpdate) => fetchReportData(id, formContents, dbPtr, paginationUpdate || pagination)}
|
|
538
|
+
/>
|
|
539
|
+
{/** GuestList component end*/}
|
|
540
|
+
</>
|
|
541
|
+
)}
|
|
542
|
+
</Card>
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
*
|
|
548
|
+
* @param root0
|
|
549
|
+
* @param root0.patients
|
|
550
|
+
* @param root0.CustomComponents
|
|
551
|
+
* @param root0.summaryColumns
|
|
552
|
+
* @param root0.refresh
|
|
553
|
+
* @param root0.isFixedIndex
|
|
554
|
+
* @returns {*}
|
|
555
|
+
*/
|
|
556
|
+
//Renders a table displaying a list of patients with dynamic columns
|
|
557
|
+
function GuestList({
|
|
558
|
+
patients,
|
|
559
|
+
columns,
|
|
560
|
+
loading,
|
|
561
|
+
CustomComponents,
|
|
562
|
+
refresh,
|
|
563
|
+
isFixedIndex,
|
|
564
|
+
barcodeFilterKey,
|
|
565
|
+
showScanner,
|
|
566
|
+
config,
|
|
567
|
+
pagination,
|
|
568
|
+
handlePagination,
|
|
569
|
+
attributes,
|
|
570
|
+
fetchReportData,
|
|
571
|
+
}) {
|
|
572
|
+
/**
|
|
573
|
+
* @param {*} propValues
|
|
574
|
+
*/
|
|
575
|
+
const propValues = (attributes && JSON.parse(attributes)) || {};
|
|
576
|
+
|
|
577
|
+
const { buttonAttributes = [] } = propValues;
|
|
578
|
+
|
|
579
|
+
var [query, setQuery] = useState('');
|
|
580
|
+
|
|
581
|
+
const [exportData, setExportData] = useState({});
|
|
582
|
+
|
|
583
|
+
// const [data, setData] = useState([]);
|
|
584
|
+
|
|
585
|
+
//visibility of the QR scanner modal.
|
|
586
|
+
const [isScannerVisible, setScannerVisible] = useState(false);
|
|
587
|
+
|
|
588
|
+
// Stores the patients filtered specifically by QR scan match.
|
|
589
|
+
const [filteredPatients, setFilteredPatients] = useState([]); // Show all initially
|
|
590
|
+
|
|
591
|
+
// patient object to redirect to upon successful QR scan.
|
|
592
|
+
const [redirectPatient, setRedirectPatient] = useState(null);
|
|
593
|
+
|
|
594
|
+
const [visible, setVisible] = useState(false);
|
|
595
|
+
|
|
596
|
+
const [ActiveComponent, setActiveComponent] = useState(null);
|
|
597
|
+
|
|
598
|
+
let history = useHistory();
|
|
599
|
+
|
|
600
|
+
const { isMobile, dispatch } = useContext(GlobalContext);
|
|
601
|
+
const [single, setSingle] = useState({});
|
|
602
|
+
|
|
603
|
+
// const [view, setView] = useState(isMobile ? true : false); //Need to check this condition
|
|
604
|
+
const cols = buildDisplayColumns({
|
|
605
|
+
columns,
|
|
606
|
+
patients,
|
|
607
|
+
isFixedIndex,
|
|
608
|
+
CustomComponents,
|
|
609
|
+
refresh,
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
*
|
|
614
|
+
* @param {*} result
|
|
615
|
+
*/
|
|
616
|
+
|
|
617
|
+
// function changeView(result) {
|
|
618
|
+
// setView(result);
|
|
619
|
+
// }
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
*
|
|
623
|
+
* @param {*} event
|
|
624
|
+
*/
|
|
625
|
+
|
|
626
|
+
function onSearch(event) {
|
|
627
|
+
setQuery(event.target.value);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
*
|
|
632
|
+
*/
|
|
633
|
+
|
|
634
|
+
useEffect(() => {
|
|
635
|
+
//Cheaking if there is patient data exists
|
|
636
|
+
if (patients) {
|
|
637
|
+
let data = patients?.map((entry) => {
|
|
638
|
+
entry.rowIndex = entry.opb_id;
|
|
639
|
+
|
|
640
|
+
entry.dispatch = dispatch;
|
|
641
|
+
|
|
642
|
+
return entry;
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
// setData(data);
|
|
646
|
+
|
|
647
|
+
// Define export data
|
|
648
|
+
// Sanitize cols for export to ensure titles are strings
|
|
649
|
+
const exportCols = cols.map((col) => {
|
|
650
|
+
if (col.title && typeof col.title === 'object' && col.title.props) {
|
|
651
|
+
return { ...col, title: col.title.props.title };
|
|
652
|
+
}
|
|
653
|
+
return col;
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
let exportDatas = getExportData(patients, exportCols);
|
|
657
|
+
|
|
658
|
+
if (exportDatas.exportDataColumns.length && exportDatas.exportDataHeaders.length) {
|
|
659
|
+
setExportData({ exportDatas });
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}, [patients, columns]);
|
|
663
|
+
|
|
664
|
+
let filtered;
|
|
665
|
+
|
|
666
|
+
if (patients) {
|
|
667
|
+
filtered = patients.filter((record) => {
|
|
668
|
+
if (query) {
|
|
669
|
+
// Keys
|
|
670
|
+
let keys = Object.keys(record);
|
|
671
|
+
|
|
672
|
+
let flag = false;
|
|
673
|
+
|
|
674
|
+
keys.forEach((key) => {
|
|
675
|
+
let ele = record[key];
|
|
676
|
+
|
|
677
|
+
if (ele && typeof ele === 'string' && ele.toLowerCase().indexOf(query.toLowerCase()) !== -1) {
|
|
678
|
+
flag = true;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
/**Will return flag */
|
|
683
|
+
return flag;
|
|
684
|
+
} else {
|
|
685
|
+
return true;
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Checks for a match in the filtered patient list based on a scanned code,
|
|
692
|
+
* updates the relevant state if a match is found, and redirects to the
|
|
693
|
+
* patient's detail page. Displays a warning if no match is found.
|
|
694
|
+
*
|
|
695
|
+
* @param {string} code - The scanned code to match against a specific field of each patient.
|
|
696
|
+
*/
|
|
697
|
+
|
|
698
|
+
const handleScanSuccess = (code) => {
|
|
699
|
+
// Filters patients based on the scanned code and the selected barcode key(using attributes 'barcodeFilterKey')
|
|
700
|
+
const matched = filtered.filter((patient) => patient[barcodeFilterKey] === code);
|
|
701
|
+
|
|
702
|
+
if (matched.length) {
|
|
703
|
+
const patient = matched[0];
|
|
704
|
+
setFilteredPatients(matched);
|
|
705
|
+
setRedirectPatient(matched);
|
|
706
|
+
message.success(`Match found for ${code}, redirecting...`);
|
|
707
|
+
|
|
708
|
+
const actionColumn = columns.find((col) => col.field === 'action') || columns.find((col) => col.type === 'action');
|
|
709
|
+
if (actionColumn) {
|
|
710
|
+
const redirectLink = getRedirectLink(actionColumn, patient);
|
|
711
|
+
// history.push(redirectLink);
|
|
712
|
+
window.location.href = redirectLink;
|
|
713
|
+
}
|
|
714
|
+
} else {
|
|
715
|
+
Modal.warning({
|
|
716
|
+
title: 'No matching records.',
|
|
717
|
+
content: `No match for scanned code: ${code}`,
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
//open the edit modal
|
|
723
|
+
const handleOpenEdit = (button) => {
|
|
724
|
+
const componentName = button.component;
|
|
725
|
+
const ComponentToRender = ReportingDashboardComp[componentName];
|
|
726
|
+
|
|
727
|
+
if (!ComponentToRender) {
|
|
728
|
+
console.error(`Component ${componentName} not found!`);
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
setSingle({});
|
|
733
|
+
setActiveComponent(() => ComponentToRender);
|
|
734
|
+
setVisible(true);
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
// close the edit modal
|
|
738
|
+
const handleCloseEdit = () => {
|
|
739
|
+
setShowEdit(false);
|
|
740
|
+
};
|
|
741
|
+
return (
|
|
742
|
+
<>
|
|
743
|
+
<div className="table-header">
|
|
744
|
+
<div className="table-left">
|
|
745
|
+
{/* shwoing caption is not correct so this commented */}
|
|
746
|
+
{/* <span className="menu-caption">{config.caption}</span> */}
|
|
747
|
+
<Search placeholder="Enter Search Value" allowClear onChange={onSearch} />
|
|
748
|
+
{/* <p className="size-hint">{patients.length} records.</p> */}
|
|
749
|
+
</div>
|
|
750
|
+
|
|
751
|
+
<div className="table-right">
|
|
752
|
+
{/* QR Scan start */}
|
|
753
|
+
{showScanner ? (
|
|
754
|
+
<Button size="small" type="primary" icon={<QrcodeOutlined />} onClick={() => setScannerVisible(true)}>
|
|
755
|
+
Scan QR
|
|
756
|
+
</Button>
|
|
757
|
+
) : null}
|
|
758
|
+
{/** Add User button */}
|
|
759
|
+
{Array.isArray(buttonAttributes) &&
|
|
760
|
+
buttonAttributes.map((btn, index) => (
|
|
761
|
+
<Button key={index} size="small" type="primary" style={{ marginLeft: 8 }} onClick={() => handleOpenEdit(btn)}>
|
|
762
|
+
{btn.title}
|
|
763
|
+
</Button>
|
|
764
|
+
))}
|
|
765
|
+
|
|
766
|
+
<Modal open={visible} onCancel={() => setVisible(false)} footer={null} destroyOnClose width={950} style={{ top: 10 }}>
|
|
767
|
+
{ActiveComponent && (
|
|
768
|
+
<ActiveComponent
|
|
769
|
+
formContent={single}
|
|
770
|
+
callback={() => {
|
|
771
|
+
setVisible(false);
|
|
772
|
+
refresh();
|
|
773
|
+
setVisible(false);
|
|
774
|
+
fetchReportData();
|
|
775
|
+
}}
|
|
776
|
+
// {...dynamicProps}
|
|
777
|
+
/>
|
|
778
|
+
)}
|
|
779
|
+
</Modal>
|
|
780
|
+
|
|
781
|
+
<Modal open={isScannerVisible} title="Scan QR Code" footer={null} onCancel={() => setScannerVisible(false)} destroyOnClose>
|
|
782
|
+
<QrScanner onScanSuccess={handleScanSuccess} onClose={() => setScannerVisible(false)} />
|
|
783
|
+
</Modal>
|
|
784
|
+
|
|
785
|
+
<div>
|
|
786
|
+
{/* QR Scan End */}
|
|
787
|
+
{/*table data export to csc component*/}
|
|
788
|
+
{exportData.exportDatas && (
|
|
789
|
+
<ExportReactCSV
|
|
790
|
+
title={config.caption}
|
|
791
|
+
headers={exportData.exportDatas.exportDataHeaders}
|
|
792
|
+
csvData={exportData.exportDatas.exportDataColumns}
|
|
793
|
+
/>
|
|
794
|
+
)}
|
|
795
|
+
</div>
|
|
796
|
+
</div>
|
|
797
|
+
</div>
|
|
798
|
+
|
|
799
|
+
<div>
|
|
800
|
+
|
|
801
|
+
<Card>
|
|
802
|
+
{loading ? (
|
|
803
|
+
<>
|
|
804
|
+
<Skeleton active paragraph={{ rows: 6 }} />
|
|
805
|
+
</>
|
|
806
|
+
) : (
|
|
807
|
+
<TableComponent
|
|
808
|
+
size="small"
|
|
809
|
+
scroll={{ x: 'max-content' }}
|
|
810
|
+
rowKey={(record) => record.OpNo}
|
|
811
|
+
dataSource={filtered ? filtered : patients} // In case if there is no filtered values we can use patient data
|
|
812
|
+
columns={cols}
|
|
813
|
+
pagination={false}
|
|
814
|
+
// title={config.caption}
|
|
815
|
+
summary={(pageData) => {
|
|
816
|
+
// Variable to save the summary data
|
|
817
|
+
let summary = {};
|
|
818
|
+
|
|
819
|
+
let summaryColumns = [
|
|
820
|
+
{ field: 'opb_amt', title: 'Amount' },
|
|
821
|
+
{ field: 'opb_netamt', title: 'Net Amount' },
|
|
822
|
+
];
|
|
823
|
+
|
|
824
|
+
let tableColumns = cols;
|
|
825
|
+
|
|
826
|
+
// Creating a copy of columns to append the summary configuration that is needed to set
|
|
827
|
+
tableColumns.forEach((record, index) => {
|
|
828
|
+
summaryColumns.forEach((inner) => {
|
|
829
|
+
if (record.field === inner.field) {
|
|
830
|
+
tableColumns[index].summary = inner;
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
});
|
|
834
|
+
|
|
835
|
+
// Initialize
|
|
836
|
+
summaryColumns.map((item) => {
|
|
837
|
+
return (summary[item.field] = 0);
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
// Find the total
|
|
841
|
+
summaryColumns.map((item) => {
|
|
842
|
+
pageData.forEach((entry) => {
|
|
843
|
+
return (summary[item.field] = summary[item.field] + entry[item.field]);
|
|
844
|
+
});
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
return (
|
|
848
|
+
<>
|
|
849
|
+
<Table.Summary.Row>
|
|
850
|
+
{tableColumns.map((column, key) => {
|
|
851
|
+
return <Table.Summary.Cell key={key}>{column.summary ? <>{summary[column.summary.field]}</> : null}</Table.Summary.Cell>;
|
|
852
|
+
})}
|
|
853
|
+
</Table.Summary.Row>
|
|
854
|
+
</>
|
|
855
|
+
);
|
|
856
|
+
}}
|
|
857
|
+
/>
|
|
858
|
+
)}
|
|
859
|
+
|
|
860
|
+
{/* Pagination aligned to the right */}
|
|
861
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 8 }}>
|
|
862
|
+
<Pagination
|
|
863
|
+
showSizeChanger
|
|
864
|
+
current={pagination.current}
|
|
865
|
+
pageSize={pagination.pageSize}
|
|
866
|
+
total={pagination.total}
|
|
867
|
+
pageSizeOptions={[20, 30, 50, 100]}
|
|
868
|
+
onChange={(page, pageSize) => handlePagination({ current: page, pageSize })}
|
|
869
|
+
/>
|
|
870
|
+
</div>
|
|
871
|
+
|
|
872
|
+
{/*If patient data exists show the number else to 0 */}
|
|
873
|
+
<p className="size-hint">{patients ? patients.length : 0} records. </p>
|
|
874
|
+
</Card>
|
|
875
|
+
{/* </> */}
|
|
876
|
+
{/* )} */}
|
|
877
|
+
</div>
|
|
878
|
+
</>
|
|
879
|
+
);
|
|
880
|
+
}
|