ui-soxo-bootstrap-core 2.4.24
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 +9 -0
- package/.github/workflows/npm-publish.yml +33 -0
- package/.husky/pre-commit +12 -0
- package/.prettierrc.json +11 -0
- package/babel.config.js +3 -0
- package/core/assets/images/vector.png +0 -0
- package/core/components/component-loader/component-loader.js +125 -0
- package/core/components/component-wrapper/component-wrapper.js +122 -0
- package/core/components/extra-info/extra-info-details.js +172 -0
- package/core/components/extra-info/extra-info-details.scss +27 -0
- package/core/components/extra-info/extra-info.js +134 -0
- package/core/components/index.js +18 -0
- package/core/components/landing-api/landing-api.js +492 -0
- package/core/components/landing-api/landing-api.scss +19 -0
- package/core/components/menu-template-api/menu-template-api.js +321 -0
- package/core/components/root-application-api/root-application-api.js +174 -0
- package/core/components/root-application-api/root-application.api.scss +0 -0
- package/core/index.js +14 -0
- package/core/lib/Store.js +363 -0
- package/core/lib/assets/Tick-icon.png +0 -0
- package/core/lib/assets/blue-slate-theme.png +0 -0
- package/core/lib/assets/dark-theme.png +0 -0
- package/core/lib/assets/deep-purple-theme.png +0 -0
- package/core/lib/assets/light-theme.png +0 -0
- package/core/lib/assets/nura-theme.png +0 -0
- package/core/lib/assets/plant.png +0 -0
- package/core/lib/assets/welcome-image.png +0 -0
- package/core/lib/assets/white-haze-theme.png +0 -0
- package/core/lib/components/application-bootstrap/application-bootstrap.js +115 -0
- package/core/lib/components/application-bootstrap/application-bootstrap.scss +0 -0
- package/core/lib/components/approval-form/approval-form.js +280 -0
- package/core/lib/components/approval-form/approval-form.scss +184 -0
- package/core/lib/components/approval-list/approval-list.js +143 -0
- package/core/lib/components/approval-list/approval-list.scss +3 -0
- package/core/lib/components/approval-list/components/request-card/request-card.js +43 -0
- package/core/lib/components/approval-list/components/request-card/request-card.scss +31 -0
- package/core/lib/components/camera/camera.js +231 -0
- package/core/lib/components/camera/camera.scss +86 -0
- package/core/lib/components/comment-block/comment-block.js +139 -0
- package/core/lib/components/comment-block/comment-block.scss +3 -0
- package/core/lib/components/confirm-modal/confirm-modal.js +82 -0
- package/core/lib/components/confirm-modal/confirm-modal.scss +3 -0
- package/core/lib/components/consent/consent.js +67 -0
- package/core/lib/components/consent/consent.scss +0 -0
- package/core/lib/components/consent/pdf-signature.js +299 -0
- package/core/lib/components/consent/signature-pad.js +90 -0
- package/core/lib/components/consent/signature-pad.scss +14 -0
- package/core/lib/components/file-upload/file-upload.js +133 -0
- package/core/lib/components/finger-print-reader/finger-print-reader.js +296 -0
- package/core/lib/components/finger-print-reader/finger-print-reader.scss +47 -0
- package/core/lib/components/finger-print-search/finger-print-search.js +200 -0
- package/core/lib/components/finger-print-search/finger-print-search.scss +47 -0
- package/core/lib/components/global-header/animations.js +18 -0
- package/core/lib/components/global-header/global-header.js +413 -0
- package/core/lib/components/global-header/global-header.scss +369 -0
- package/core/lib/components/header/generic-header.js +76 -0
- package/core/lib/components/header/generic-header.scss +99 -0
- package/core/lib/components/image-preview/image-preview.js +33 -0
- package/core/lib/components/image-wrapper/image-wrapper.js +108 -0
- package/core/lib/components/image-wrapper/image-wrapper.scss +13 -0
- package/core/lib/components/index.js +203 -0
- package/core/lib/components/landing/landing.js +404 -0
- package/core/lib/components/landing/landing.scss +0 -0
- package/core/lib/components/language-switcher/language-switcher.js +50 -0
- package/core/lib/components/menu-context/menu-context.js +70 -0
- package/core/lib/components/menu-template/menu-template.js +250 -0
- package/core/lib/components/menu-template/menu-template.scss +9 -0
- package/core/lib/components/modal-search/modal-search.js +153 -0
- package/core/lib/components/modal-search/modal-search.scss +79 -0
- package/core/lib/components/modal-wrapper/modal-manager.js +16 -0
- package/core/lib/components/modal-wrapper/modal-wrapper.js +108 -0
- package/core/lib/components/modal-wrapper/modal-wrapper.scss +14 -0
- package/core/lib/components/notice-board/notice-board.js +132 -0
- package/core/lib/components/notice-board/notice-board.scss +65 -0
- package/core/lib/components/page-container/page-container.js +55 -0
- package/core/lib/components/page-container/page-container.scss +8 -0
- package/core/lib/components/page-header/page-header.js +23 -0
- package/core/lib/components/page-header/page-header.scss +18 -0
- package/core/lib/components/pdf-viewer/pdf-viewer.js +56 -0
- package/core/lib/components/portlet-table/components/table-actions/table-actions.js +58 -0
- package/core/lib/components/portlet-table/components/table-actions/table-actions.scss +1 -0
- package/core/lib/components/portlet-table/components/table-data/table-data.js +107 -0
- package/core/lib/components/portlet-table/components/table-data/table-data.scss +0 -0
- package/core/lib/components/portlet-table/portlet-table.js +63 -0
- package/core/lib/components/portlet-table/portlet-table.scss +90 -0
- package/core/lib/components/progress-bar/progress-bar.js +58 -0
- package/core/lib/components/progress-bar/progress-bar.scss +15 -0
- package/core/lib/components/request-form/request-form.js +110 -0
- package/core/lib/components/request-form/request-form.scss +0 -0
- package/core/lib/components/root-application/root-application.js +70 -0
- package/core/lib/components/rupee/rupee.js +14 -0
- package/core/lib/components/script-input/script-input.js +169 -0
- package/core/lib/components/script-input/script-input.scss +8 -0
- package/core/lib/components/sidemenu/animations.js +52 -0
- package/core/lib/components/sidemenu/sidemenu.js +617 -0
- package/core/lib/components/sidemenu/sidemenu.scss +264 -0
- package/core/lib/components/spotlight-search/spotlight-search.component.js +636 -0
- package/core/lib/components/spotlight-search/spotlight-search.component.scss +78 -0
- package/core/lib/components/table-wrapper/table-wrapper.js +136 -0
- package/core/lib/components/table-wrapper/table-wrapper.scss +72 -0
- package/core/lib/components/ui_elements/Loader.js +13 -0
- package/core/lib/components/ui_elements/Notify.js +13 -0
- package/core/lib/components/ui_elements/PlaceHolder.js +34 -0
- package/core/lib/components/web-camera/web-camera.js +162 -0
- package/core/lib/components/web-camera/web-camera.scss +28 -0
- package/core/lib/core.md +9 -0
- package/core/lib/elements/Elements.md +3 -0
- package/core/lib/elements/basic/LoggedUserRedirect.js +21 -0
- package/core/lib/elements/basic/PrivateRoute.js +16 -0
- package/core/lib/elements/basic/button/Button.md +43 -0
- package/core/lib/elements/basic/button/button.js +170 -0
- package/core/lib/elements/basic/button/button.scss +0 -0
- package/core/lib/elements/basic/card/Card.md +15 -0
- package/core/lib/elements/basic/card/card.js +40 -0
- package/core/lib/elements/basic/card/card.scss +14 -0
- package/core/lib/elements/basic/checkbox/checkbox.js +23 -0
- package/core/lib/elements/basic/col/col.js +16 -0
- package/core/lib/elements/basic/copy-to-clipboard/Readme.md +40 -0
- package/core/lib/elements/basic/copy-to-clipboard/copy-to-clipboard.js +62 -0
- package/core/lib/elements/basic/country-phone-input/Readme.md +98 -0
- package/core/lib/elements/basic/country-phone-input/country-phone-input.js +107 -0
- package/core/lib/elements/basic/country-phone-input/phone-input.scss +62 -0
- package/core/lib/elements/basic/datepicker/datepicker.js +33 -0
- package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +61 -0
- package/core/lib/elements/basic/empty/empty.js +15 -0
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.js +118 -0
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.scss +10 -0
- package/core/lib/elements/basic/form/Readme.md +0 -0
- package/core/lib/elements/basic/form/form.js +70 -0
- package/core/lib/elements/basic/form/form.scss +4 -0
- package/core/lib/elements/basic/image/image.js +45 -0
- package/core/lib/elements/basic/image/image.scss +17 -0
- package/core/lib/elements/basic/image/readme.md +26 -0
- package/core/lib/elements/basic/image-viewer/image-viewer.js +109 -0
- package/core/lib/elements/basic/image-viewer/image-viewer.scss +8 -0
- package/core/lib/elements/basic/input/input.js +81 -0
- package/core/lib/elements/basic/input/readme.md +77 -0
- package/core/lib/elements/basic/json-input/json-input.js +51 -0
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.js +216 -0
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.scss +28 -0
- package/core/lib/elements/basic/modal/modal.js +64 -0
- package/core/lib/elements/basic/modal/readme.md +62 -0
- package/core/lib/elements/basic/popconfirm/popconfirm.js +18 -0
- package/core/lib/elements/basic/popover/popover.js +13 -0
- package/core/lib/elements/basic/radio/radio.js +18 -0
- package/core/lib/elements/basic/rangepicker/rangepicker.js +51 -0
- package/core/lib/elements/basic/rangepicker/rangepicker.scss +18 -0
- package/core/lib/elements/basic/rangepicker/readme.md +82 -0
- package/core/lib/elements/basic/reference-select/readme.md +19 -0
- package/core/lib/elements/basic/reference-select/reference-select.js +337 -0
- package/core/lib/elements/basic/row/row.js +16 -0
- package/core/lib/elements/basic/select/select.js +47 -0
- package/core/lib/elements/basic/select-box/readme.md +53 -0
- package/core/lib/elements/basic/select-box/select-box.js +63 -0
- package/core/lib/elements/basic/skeleton/readme.md +35 -0
- package/core/lib/elements/basic/skeleton/skeleton.js +36 -0
- package/core/lib/elements/basic/skeleton/skeleton.scss +53 -0
- package/core/lib/elements/basic/space/space.js +13 -0
- package/core/lib/elements/basic/switch/readme.md +29 -0
- package/core/lib/elements/basic/switch/switch.js +58 -0
- package/core/lib/elements/basic/tab/tab.js +15 -0
- package/core/lib/elements/basic/table/readme.md +9 -0
- package/core/lib/elements/basic/table/table.js +100 -0
- package/core/lib/elements/basic/table/table.scss +0 -0
- package/core/lib/elements/basic/tag/tag.js +63 -0
- package/core/lib/elements/basic/tag/tag.scss +3 -0
- package/core/lib/elements/basic/timeline/timeline.js +14 -0
- package/core/lib/elements/basic/title/readme.md +20 -0
- package/core/lib/elements/basic/title/title.js +38 -0
- package/core/lib/elements/basic/title/title.scss +0 -0
- package/core/lib/elements/basic/user-search/user-search.js +192 -0
- package/core/lib/elements/complex/barcode/barcode.js +27 -0
- package/core/lib/elements/complex/bargraph/bar-graph.js +262 -0
- package/core/lib/elements/complex/basic-table/basic-table.js +111 -0
- package/core/lib/elements/complex/basic-table/basic-table.scss +4 -0
- package/core/lib/elements/complex/date-display/date-display.js +37 -0
- package/core/lib/elements/complex/error-boundary/error-boundary.js +29 -0
- package/core/lib/elements/complex/google-location-input/map-container-library-load.js +93 -0
- package/core/lib/elements/complex/google-map/google-map.js +230 -0
- package/core/lib/elements/complex/google-map/google-map.scss +13 -0
- package/core/lib/elements/complex/line-graph/line-graph.js +108 -0
- package/core/lib/elements/complex/location-search-input/location-search-input.js +100 -0
- package/core/lib/elements/complex/maps/maps.js +0 -0
- package/core/lib/elements/complex/pie-chart/pie-chart.js +203 -0
- package/core/lib/elements/complex/qr-code/qr-code.js +27 -0
- package/core/lib/elements/complex/qrscanner/qrscanner.js +57 -0
- package/core/lib/elements/complex/search-debounce/search-debounce.js +37 -0
- package/core/lib/elements/complex/statistic-card/dashboard-statistic-card.js +76 -0
- package/core/lib/elements/complex/statistic-card/statistic-card.js +28 -0
- package/core/lib/elements/index.js +226 -0
- package/core/lib/hooks/device-detect.js +26 -0
- package/core/lib/hooks/index.js +19 -0
- package/core/lib/hooks/use-location.js +33 -0
- package/core/lib/hooks/use-window-size.js +34 -0
- package/core/lib/i18n.js +70 -0
- package/core/lib/index.js +106 -0
- package/core/lib/introduction.md +74 -0
- package/core/lib/js-styleguide.md +4112 -0
- package/core/lib/models/actions/actions.js +128 -0
- package/core/lib/models/actions/components/action-detail/action-detail.js +190 -0
- package/core/lib/models/actions/components/action-detail/action-detail.scss +0 -0
- package/core/lib/models/actions/components/custom-actions/custom-actions.js +186 -0
- package/core/lib/models/actions/components/custom-actions/custom-actions.scss +0 -0
- package/core/lib/models/attachments/attachments.js +231 -0
- package/core/lib/models/base-loader.js +99 -0
- package/core/lib/models/base.js +716 -0
- package/core/lib/models/branches/branches.js +125 -0
- package/core/lib/models/checklists/checklists.js +115 -0
- package/core/lib/models/columns/columns.js +169 -0
- package/core/lib/models/columns/components/columns-add/columns-add.js +172 -0
- package/core/lib/models/columns/components/columns-add/columns-add.scss +0 -0
- package/core/lib/models/comments/comments.js +213 -0
- package/core/lib/models/departments/departments.js +107 -0
- package/core/lib/models/financial-years/financial_years.js +127 -0
- package/core/lib/models/forms/components/form-creator/form-creator.js +624 -0
- package/core/lib/models/forms/components/form-creator/form-creator.scss +30 -0
- package/core/lib/models/forms/components/form-detail/form-detail.js +224 -0
- package/core/lib/models/forms/components/form-detail/form-detail.scss +0 -0
- package/core/lib/models/forms/forms.js +122 -0
- package/core/lib/models/index.js +203 -0
- package/core/lib/models/invoice-numbers/invoice_numbers.js +204 -0
- package/core/lib/models/lookup-types/components/lookup-detail/lookup-detail.js +145 -0
- package/core/lib/models/lookup-types/components/lookup-detail/lookup-detail.scss +0 -0
- package/core/lib/models/lookup-types/lookup-types.js +113 -0
- package/core/lib/models/lookup-values/components/lookup-values-add/lookup-values-add.js +126 -0
- package/core/lib/models/lookup-values/components/lookup-values-add/lookup-values-add.scss +0 -0
- package/core/lib/models/lookup-values/lookup-values.js +107 -0
- package/core/lib/models/menu-roles/menu-roles.js +127 -0
- package/core/lib/models/menus/components/menu-add/menu-add.js +228 -0
- package/core/lib/models/menus/components/menu-add/menu-add.scss +0 -0
- package/core/lib/models/menus/components/menu-detail/menu-detail.js +170 -0
- package/core/lib/models/menus/components/menu-detail/menu-detail.scss +0 -0
- package/core/lib/models/menus/components/menu-list/menu-list.js +593 -0
- package/core/lib/models/menus/components/menu-list/menu-list.scss +6 -0
- package/core/lib/models/menus/components/menu-roles-add/menu-roles-add.js +183 -0
- package/core/lib/models/menus/components/menu-roles-add/menu-roles-add.scss +0 -0
- package/core/lib/models/menus/menus.js +499 -0
- package/core/lib/models/models/components/model-detail/model-detail.js +137 -0
- package/core/lib/models/models/components/model-detail/model-detail.scss +0 -0
- package/core/lib/models/models/components/models.js +128 -0
- package/core/lib/models/modules/modules.js +204 -0
- package/core/lib/models/outbox/outbox.js +73 -0
- package/core/lib/models/pages/pages.js +107 -0
- package/core/lib/models/permissions/permissions.js +71 -0
- package/core/lib/models/process/components/process-add/process-add.js +181 -0
- package/core/lib/models/process/components/process-add/process-add.scss +0 -0
- package/core/lib/models/process/components/process-dashboard/process-dashboard.js +602 -0
- package/core/lib/models/process/components/process-dashboard/process-dashboard.scss +62 -0
- package/core/lib/models/process/components/process-detail/process-detail.js +140 -0
- package/core/lib/models/process/components/process-detail/process-detail.scss +0 -0
- package/core/lib/models/process/components/process-timeline/process-timeline.js +140 -0
- package/core/lib/models/process/components/task-detail/task-detail.js +240 -0
- package/core/lib/models/process/components/task-detail/task-detail.scss +27 -0
- package/core/lib/models/process/components/task-form/task-form.js +529 -0
- package/core/lib/models/process/components/task-form/task-form.scss +7 -0
- package/core/lib/models/process/components/task-list/task-list.js +221 -0
- package/core/lib/models/process/components/task-list/task-list.scss +14 -0
- package/core/lib/models/process/components/task-overview/task-overview.js +300 -0
- package/core/lib/models/process/components/task-overview/task-overview.scss +0 -0
- package/core/lib/models/process/components/task-overview-legacy/task-overview-legacy.js +192 -0
- package/core/lib/models/process/components/task-overview-legacy/task-overview.scss +0 -0
- package/core/lib/models/process/components/task-routes/task-routes.js +45 -0
- package/core/lib/models/process/components/task-status/task-status.js +176 -0
- package/core/lib/models/process/components/task-status/task-status.scss +11 -0
- package/core/lib/models/process/process.js +781 -0
- package/core/lib/models/process-transactions/process-transactions.js +124 -0
- package/core/lib/models/roles/roles.js +106 -0
- package/core/lib/models/scripts/scripts.js +111 -0
- package/core/lib/models/step-transactions/step-transcations.js +148 -0
- package/core/lib/models/steps/components/step-add/step-add.js +261 -0
- package/core/lib/models/steps/components/step-add/step-add.scss +0 -0
- package/core/lib/models/steps/components/step-detail/step-detail.js +157 -0
- package/core/lib/models/steps/components/step-detail/step-detail.scss +0 -0
- package/core/lib/models/steps/steps.js +357 -0
- package/core/lib/models/user-preferences/user-preferences.js +83 -0
- package/core/lib/models/users/components/user-add/user-add.js +226 -0
- package/core/lib/models/users/components/user-add/user-add.scss +0 -0
- package/core/lib/models/users/users.js +120 -0
- package/core/lib/modules/business/launch-page/launch-page.js +29 -0
- package/core/lib/modules/business/launch-page/launch-page.scss +6 -0
- package/core/lib/modules/business/slots/slots.js +231 -0
- package/core/lib/modules/business/slots/slots.scss +108 -0
- package/core/lib/modules/forms/components/field-customizer/field-customizer.js +139 -0
- package/core/lib/modules/forms/components/field-customizer/field-customizer.scss +0 -0
- package/core/lib/modules/forms/components/field-selector/field-selector.js +157 -0
- package/core/lib/modules/forms/components/field-selector/field-selector.scss +25 -0
- package/core/lib/modules/forms/components/form-display/form-display.js +203 -0
- package/core/lib/modules/forms/components/form-display/form-display.scss +9 -0
- package/core/lib/modules/forms/components/tab-customizer/tab-customizer.js +125 -0
- package/core/lib/modules/forms/components/tab-customizer/tab-customizer.scss +0 -0
- package/core/lib/modules/generic/generic-add/generic-add.js +213 -0
- package/core/lib/modules/generic/generic-add/generic-add.scss +0 -0
- package/core/lib/modules/generic/generic-detail/generic-detail.js +199 -0
- package/core/lib/modules/generic/generic-detail/generic-detail.scss +0 -0
- package/core/lib/modules/generic/generic-edit/generic-edit.js +120 -0
- package/core/lib/modules/generic/generic-edit/generic-edit.scss +0 -0
- package/core/lib/modules/generic/generic-list/ExportReactCSV.js +62 -0
- package/core/lib/modules/generic/generic-list/generic-list.js +705 -0
- package/core/lib/modules/generic/generic-list/generic-list.scss +34 -0
- package/core/lib/modules/generic/generic-upload/generic-upload.js +484 -0
- package/core/lib/modules/generic/generic-upload/generic-upload.scss +0 -0
- package/core/lib/modules/generic/table-settings/table-settings.js +226 -0
- package/core/lib/modules/generic/table-settings/table-settings.scss +37 -0
- package/core/lib/modules/index.js +52 -0
- package/core/lib/modules/modules-routes/module-routes.js +35 -0
- package/core/lib/modules/modules-routes/module-routes.scss +0 -0
- package/core/lib/pages/change-password/change-password.js +211 -0
- package/core/lib/pages/change-password/change-password.scss +76 -0
- package/core/lib/pages/homepage/homepage.js +53 -0
- package/core/lib/pages/index.js +20 -0
- package/core/lib/pages/login/login.js +617 -0
- package/core/lib/pages/login/login.scss +346 -0
- package/core/lib/pages/manage-users/manage-users.js +429 -0
- package/core/lib/pages/manage-users/manage-users.scss +26 -0
- package/core/lib/pages/profile/profile.js +247 -0
- package/core/lib/pages/profile/profile.scss +107 -0
- package/core/lib/pages/profile/theme-config.js +18 -0
- package/core/lib/pages/profile/themes-backup.json +311 -0
- package/core/lib/pages/profile/themes.json +254 -0
- package/core/lib/pages/register/register.js +177 -0
- package/core/lib/pages/register/register.scss +128 -0
- package/core/lib/react-styleguide.md +757 -0
- package/core/lib/utils/api/api.utils.js +188 -0
- package/core/lib/utils/api/readme.md +426 -0
- package/core/lib/utils/async.js +36 -0
- package/core/lib/utils/common/common.utils.js +123 -0
- package/core/lib/utils/common/readme.md +30 -0
- package/core/lib/utils/date/date.utils.js +295 -0
- package/core/lib/utils/date/readme.md +2 -0
- package/core/lib/utils/firebase.support.utils.js +99 -0
- package/core/lib/utils/firebase.utils.js +808 -0
- package/core/lib/utils/form/Form.md +0 -0
- package/core/lib/utils/form/form.utils.js +256 -0
- package/core/lib/utils/generic/generic.utils.js +69 -0
- package/core/lib/utils/http/auth.helper.js +95 -0
- package/core/lib/utils/http/http.utils.js +157 -0
- package/core/lib/utils/http/readme.md +14 -0
- package/core/lib/utils/index.js +46 -0
- package/core/lib/utils/location/location.utils.js +137 -0
- package/core/lib/utils/location/readme.md +18 -0
- package/core/lib/utils/modal.utils.js +16 -0
- package/core/lib/utils/notification.utils.js +35 -0
- package/core/lib/utils/pwa/pwa.utils.js +88 -0
- package/core/lib/utils/script.utils.js +235 -0
- package/core/lib/utils/setting.utils.js +69 -0
- package/core/lib/utils/upload.utils.js +30 -0
- package/core/models/Preference/Preferences.js +46 -0
- package/core/models/base/base.js +399 -0
- package/core/models/base-clone-loader.js +107 -0
- package/core/models/base-clone.js +187 -0
- package/core/models/base-loader.js +97 -0
- package/core/models/core-scripts/core-scripts.js +150 -0
- package/core/models/dashboard/dashboard.js +187 -0
- package/core/models/detail-loader.js +88 -0
- package/core/models/groups.js +82 -0
- package/core/models/index.js +94 -0
- package/core/models/lookup-types/components/lookup-detail/lookup-detail.js +129 -0
- package/core/models/lookup-types/lookup-types.js +96 -0
- package/core/models/lookup-values/components/lookup-values-modal/lookup-values-modal.js +95 -0
- package/core/models/lookup-values/components/lookup-values-modal/lookup-values-modal.scss +0 -0
- package/core/models/lookup-values/lookup-values.js +92 -0
- package/core/models/menu-roles/components/menu-roles-add/menu-roles-add.js +153 -0
- package/core/models/menu-roles/components/menu-roles-add/menu-roles-add.scss +0 -0
- package/core/models/menu-roles/menu-roles.js +158 -0
- package/core/models/menus/components/menu-add/menu-add.js +325 -0
- package/core/models/menus/components/menu-add/menu-add.scss +31 -0
- package/core/models/menus/components/menu-detail/menu-detail.js +263 -0
- package/core/models/menus/components/menu-list/menu-list.js +392 -0
- package/core/models/menus/components/menu-lists/menu-lists.js +429 -0
- package/core/models/menus/components/menu-lists/menu-lists.scss +41 -0
- package/core/models/menus/menus.js +291 -0
- package/core/models/model-columns.js +121 -0
- package/core/models/models/components/model-detail/model-add.js +120 -0
- package/core/models/models/components/model-detail/model-detail.js +133 -0
- package/core/models/models/components/model-detail/model-detail.scss +0 -0
- package/core/models/models/models.js +154 -0
- package/core/models/pages/components/page-add/page-add.js +163 -0
- package/core/models/pages/components/page-add/page-add.scss +31 -0
- package/core/models/pages/components/page-details/page-details.js +210 -0
- package/core/models/pages/components/page-list/page-list.js +248 -0
- package/core/models/pages/pages.js +142 -0
- package/core/models/pages/pages.scss +0 -0
- package/core/models/pages.js +142 -0
- package/core/models/roles/components/role-add/role-add.js +248 -0
- package/core/models/roles/components/role-list/role-list.js +408 -0
- package/core/models/roles/roles.js +188 -0
- package/core/models/user-roles/components/user-roles-add/user-roles-add.js +149 -0
- package/core/models/user-roles/components/user-roles-add/user-roles-add.scss +0 -0
- package/core/models/user-roles/user-roles.js +99 -0
- package/core/models/users/components/user-add/user-add.js +458 -0
- package/core/models/users/components/user-detail/user-detail.js +236 -0
- package/core/models/users/components/user-detail/user-detail.scss +0 -0
- package/core/models/users/components/user-list/user-list.js +397 -0
- package/core/models/users/users.js +185 -0
- package/core/modules/Informations/change-info/change-info.js +618 -0
- package/core/modules/Informations/change-info/change-info.scss +135 -0
- package/core/modules/dashboard/components/dashboard-card/animations.js +65 -0
- package/core/modules/dashboard/components/dashboard-card/dashboard-card.js +197 -0
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.js +430 -0
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.scss +60 -0
- package/core/modules/dashboard/components/pop-query-dashboard/pop-query-dashboard.js +66 -0
- package/core/modules/generic/components/generic-add/generic-add.js +121 -0
- package/core/modules/generic/components/generic-add/generic-add.scss +13 -0
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.js +125 -0
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.scss +13 -0
- package/core/modules/generic/components/generic-detail/generic-detail.js +184 -0
- package/core/modules/generic/components/generic-detail/generic-detail.scss +25 -0
- package/core/modules/generic/components/generic-edit/generic-edit.js +123 -0
- package/core/modules/generic/components/generic-edit/generic-edit.scss +0 -0
- package/core/modules/generic/components/generic-list/generic-list.js +335 -0
- package/core/modules/generic/components/generic-list/generic-list.scss +35 -0
- package/core/modules/index.js +54 -0
- package/core/modules/module-routes/module-routes.js +37 -0
- package/core/modules/module-routes/module-routes.scss +0 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +1101 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.scss +171 -0
- package/core/pages/homepage-api/homepage-api.js +106 -0
- package/core/pages/homepage-api/homepage-api.scss +234 -0
- package/core/pages/homepage-api/menu-dashboard.js +169 -0
- package/core/pages/homepage-api/menu-dashboard.scss +12 -0
- package/core/translation.json +54 -0
- package/core/translations.json +20 -0
- package/core/utils/script.utils.js +130 -0
- package/core/utils/settings.utils.js +26 -0
- package/eslint.config.mjs +79 -0
- package/index.js +36 -0
- package/package.json +118 -0
- package/tsconfig.json +27 -0
- package/webpack.config.js +174 -0
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema required for implementing process
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
import Base from './../base';
|
|
8
|
+
|
|
9
|
+
import { Link } from 'react-router-dom'
|
|
10
|
+
|
|
11
|
+
import { Tag } from 'antd'
|
|
12
|
+
|
|
13
|
+
import ProcessDetail from './components/process-detail/process-detail';
|
|
14
|
+
|
|
15
|
+
import { Steps, ProcessTransactions, StepTransactions, Roles, Checklists } from './../';
|
|
16
|
+
|
|
17
|
+
import DateUtils from '../../utils/date/date.utils';
|
|
18
|
+
|
|
19
|
+
import ProcessDashboard from './components/process-dashboard/process-dashboard';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Process extends Base {
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
|
|
26
|
+
super()
|
|
27
|
+
|
|
28
|
+
this.fields = [{
|
|
29
|
+
field: 'name',
|
|
30
|
+
caption: 'Name'
|
|
31
|
+
}, {
|
|
32
|
+
field: 'description',
|
|
33
|
+
caption: 'Description'
|
|
34
|
+
}, {
|
|
35
|
+
field: 'identifier',
|
|
36
|
+
caption: 'Identifier'
|
|
37
|
+
}, {
|
|
38
|
+
field: 'active',
|
|
39
|
+
type: 'radio',
|
|
40
|
+
options: [true, false],
|
|
41
|
+
caption: 'Active'
|
|
42
|
+
}, {
|
|
43
|
+
field: 'order',
|
|
44
|
+
type: 'number',
|
|
45
|
+
caption: 'Order'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
// this.columns = [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get getEndpoint() {
|
|
53
|
+
return 'process'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get path() {
|
|
57
|
+
return `process`
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get getName() {
|
|
61
|
+
return `process`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Overriding get to stress for orderBy
|
|
67
|
+
*/
|
|
68
|
+
async get(queries) {
|
|
69
|
+
|
|
70
|
+
return this.getMethod(queries, { orderBy: 'order' })
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Start the process with a batch
|
|
76
|
+
*/
|
|
77
|
+
startProcessBatch(batch, identifier, body) {
|
|
78
|
+
|
|
79
|
+
// Starting a process is creating a process transaction record
|
|
80
|
+
// and starting the first step of that process
|
|
81
|
+
// This involves first completing any sub step
|
|
82
|
+
// it might have (any level of) and
|
|
83
|
+
|
|
84
|
+
var queries = [{
|
|
85
|
+
field: 'identifier',
|
|
86
|
+
value: identifier
|
|
87
|
+
}]
|
|
88
|
+
|
|
89
|
+
return this.get(queries).then(async (result) => {
|
|
90
|
+
|
|
91
|
+
var process = result.process[0];
|
|
92
|
+
|
|
93
|
+
// Trigger the process and its first sub process
|
|
94
|
+
return await this.triggerProcessBatch(batch, process.id, body);
|
|
95
|
+
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Move the process transaction to the next step
|
|
101
|
+
*
|
|
102
|
+
* @param {*} process_transaction_id
|
|
103
|
+
*/
|
|
104
|
+
async proceedNextStep({ id, process_transaction_id }) {
|
|
105
|
+
|
|
106
|
+
// Get the firestore app
|
|
107
|
+
const app = this.getFireStoreApp();
|
|
108
|
+
|
|
109
|
+
// Starting a batched write
|
|
110
|
+
let batch = app.batch();
|
|
111
|
+
|
|
112
|
+
const transactions = await ProcessTransactions.getRecord(process_transaction_id)
|
|
113
|
+
|
|
114
|
+
// console.log(transactions);
|
|
115
|
+
|
|
116
|
+
const step = await Steps.getRecord(transactions.step_id);
|
|
117
|
+
|
|
118
|
+
// const steps = await this.prepareStepData(id, step, transactions)
|
|
119
|
+
|
|
120
|
+
// console.log(step, steps);
|
|
121
|
+
|
|
122
|
+
return await this.onStepCompletion({ batch, step, process_transaction_id, record_id: id });
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Actions to be taken care on completion of a step
|
|
128
|
+
*/
|
|
129
|
+
async onStepCompletion({ batch, step, process_transaction_id, record_id, callback }) {
|
|
130
|
+
|
|
131
|
+
if (step.trigger_sub_process_ids === null) {
|
|
132
|
+
step.trigger_sub_process_ids = []
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (step.trigger_process_ids === null) {
|
|
136
|
+
step.trigger_process_ids = []
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// The first Step transaction
|
|
140
|
+
let step_transaction = step.step_transactions[0];
|
|
141
|
+
|
|
142
|
+
// We have to forward the process transaction to the next sub process
|
|
143
|
+
//
|
|
144
|
+
// await triggerSubProcess(step, process_transaction_id)
|
|
145
|
+
|
|
146
|
+
console.log("Triggering Subprocesses", step.trigger_sub_process_ids.map((record) => record.id));
|
|
147
|
+
|
|
148
|
+
// Trigger the sub process
|
|
149
|
+
await Promise.all(step.trigger_sub_process_ids.map(async (step_id) => {
|
|
150
|
+
|
|
151
|
+
let params = {
|
|
152
|
+
step_id: step_id
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
console.log("Updating Process Transaction started");
|
|
156
|
+
|
|
157
|
+
// Reference for process transaction
|
|
158
|
+
var processTransactionReference = ProcessTransactions.getRecordReference(process_transaction_id)
|
|
159
|
+
|
|
160
|
+
// Move the process transaction to next step
|
|
161
|
+
await batch.update(processTransactionReference, this.appendDefaultValues(params));
|
|
162
|
+
|
|
163
|
+
console.log("Updating Process Transaction ended");
|
|
164
|
+
|
|
165
|
+
// If there is a step transaction record ,
|
|
166
|
+
// We have to update that its completed
|
|
167
|
+
|
|
168
|
+
// We have to record a step transaction record for every event
|
|
169
|
+
let body = {
|
|
170
|
+
step_id: step_id,
|
|
171
|
+
process_id: step.process_id,
|
|
172
|
+
process_transaction_id: process_transaction_id,
|
|
173
|
+
record_id: record_id
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Record the Step Transaction
|
|
177
|
+
var stepTransactionReference = StepTransactions.getRecordReference()
|
|
178
|
+
|
|
179
|
+
console.log("Step Transaction Add started");
|
|
180
|
+
|
|
181
|
+
return await batch.set(stepTransactionReference, this.appendDefaultValues(body));
|
|
182
|
+
|
|
183
|
+
console.log("Step Transaction Add Completed");
|
|
184
|
+
|
|
185
|
+
}));
|
|
186
|
+
|
|
187
|
+
console.log("Triggering Process started", step.trigger_process_ids && step.trigger_process_ids.map((record) => record.id));
|
|
188
|
+
|
|
189
|
+
// We also have to trigger any process that this step would trigger
|
|
190
|
+
await Promise.all(step.trigger_process_ids && step.trigger_process_ids.map((process_id) => {
|
|
191
|
+
|
|
192
|
+
let body = {
|
|
193
|
+
record_id: record_id,
|
|
194
|
+
model_identifier: 'Candidates'
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
console.log("Trigger Process Started");
|
|
198
|
+
|
|
199
|
+
return this.triggerProcessBatch(batch, process_id, body, process_transaction_id).catch((error) => {
|
|
200
|
+
|
|
201
|
+
console.log(error, "Trigger process failed");
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
}));
|
|
205
|
+
|
|
206
|
+
console.log("Step Transaction Update Started");
|
|
207
|
+
|
|
208
|
+
if (step_transaction) {
|
|
209
|
+
|
|
210
|
+
console.log("Found Step Transaction to Update");
|
|
211
|
+
|
|
212
|
+
// We have to record a step transaction record for every event
|
|
213
|
+
let body = {
|
|
214
|
+
end_time: DateUtils.getTime(),
|
|
215
|
+
completed: true,
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Record the Step Transaction
|
|
219
|
+
let stepTransactionReference = StepTransactions.getRecordReference(step_transaction.id);
|
|
220
|
+
|
|
221
|
+
await batch.update(stepTransactionReference, this.appendDefaultValues(body));
|
|
222
|
+
|
|
223
|
+
// Commit the batch
|
|
224
|
+
return batch.commit();
|
|
225
|
+
|
|
226
|
+
} else {
|
|
227
|
+
|
|
228
|
+
// Commit the batch
|
|
229
|
+
return batch.commit();
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
*
|
|
237
|
+
* Start the step
|
|
238
|
+
* After identifying the step , we have
|
|
239
|
+
* to check if this step has any sub steps
|
|
240
|
+
* If present we have to start the first step of that step
|
|
241
|
+
*
|
|
242
|
+
* @param {*} param0
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
async startStepBatch({ batch, step, body }) {
|
|
246
|
+
|
|
247
|
+
// Find all the steps in the process
|
|
248
|
+
// After finding the steps we have to find all
|
|
249
|
+
// the sub steps of the step , use a recursive apporach to make
|
|
250
|
+
// sure
|
|
251
|
+
let stepParams = {
|
|
252
|
+
...body,
|
|
253
|
+
|
|
254
|
+
step_id: step.id,
|
|
255
|
+
process_id: step.process_id,
|
|
256
|
+
|
|
257
|
+
start_time: new Date(),
|
|
258
|
+
end_time: null,
|
|
259
|
+
completed: false
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const stepTransactionReference = StepTransactions.getRecordReference();
|
|
263
|
+
|
|
264
|
+
console.log(stepTransactionReference.id);
|
|
265
|
+
|
|
266
|
+
// Find the sub steps and start the loop
|
|
267
|
+
var queries = [{
|
|
268
|
+
field: 'header_id',
|
|
269
|
+
value: step.id
|
|
270
|
+
}, {
|
|
271
|
+
field: 'active',
|
|
272
|
+
value: true
|
|
273
|
+
}]
|
|
274
|
+
|
|
275
|
+
// Find the first step of child
|
|
276
|
+
const { steps } = await Steps.get(queries, {
|
|
277
|
+
orderBy: 'order'
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
if (steps.length) {
|
|
281
|
+
|
|
282
|
+
await batch.set(stepTransactionReference, StepTransactions.appendDefaultValues(stepParams))
|
|
283
|
+
|
|
284
|
+
// Start the step
|
|
285
|
+
await this.startStepBatch({ batch, step: steps[0], body });
|
|
286
|
+
|
|
287
|
+
} else {
|
|
288
|
+
|
|
289
|
+
stepParams = {
|
|
290
|
+
...stepParams,
|
|
291
|
+
end_time: new Date(),
|
|
292
|
+
completed: true
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return await batch.set(stepTransactionReference, StepTransactions.appendDefaultValues(stepParams))
|
|
296
|
+
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Stop the step
|
|
302
|
+
*/
|
|
303
|
+
async stopStepBatch({ batch, step }) {
|
|
304
|
+
|
|
305
|
+
// Complete the step
|
|
306
|
+
// If another step needs to be started , start that step
|
|
307
|
+
// Else thats it
|
|
308
|
+
console.log(step);
|
|
309
|
+
|
|
310
|
+
if (step.step_transactions.length) {
|
|
311
|
+
|
|
312
|
+
// Get the reference
|
|
313
|
+
let stepTransactionReference = StepTransactions.getRecordReference(step.step_transactions[0].id)
|
|
314
|
+
|
|
315
|
+
await batch.update(stepTransactionReference, {
|
|
316
|
+
end_time: new Date(),
|
|
317
|
+
completed: true
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
// Further triggering of other steps
|
|
321
|
+
return await batch.commit()
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* To Start the process
|
|
327
|
+
*
|
|
328
|
+
* @param {*} batch
|
|
329
|
+
* @param {*} process_id
|
|
330
|
+
* @param {*} body
|
|
331
|
+
* @param {*} process_transaction_id
|
|
332
|
+
* @returns
|
|
333
|
+
*/
|
|
334
|
+
async triggerProcessBatch(batch, process_id, body, process_transaction_id) {
|
|
335
|
+
|
|
336
|
+
var queries = [{
|
|
337
|
+
field: 'process_id',
|
|
338
|
+
value: process_id
|
|
339
|
+
}, {
|
|
340
|
+
field: 'active',
|
|
341
|
+
value: true
|
|
342
|
+
}]
|
|
343
|
+
// Find all the steps in the process
|
|
344
|
+
// After finding the steps we have to find all
|
|
345
|
+
// the sub steps of the step , use a recursive apporach to make
|
|
346
|
+
// sure each of the first step is started
|
|
347
|
+
|
|
348
|
+
// When the process starts the first step every nested steps is also started
|
|
349
|
+
const { steps = [] } = await Steps.get(queries);
|
|
350
|
+
|
|
351
|
+
// From the ordered data ,
|
|
352
|
+
var step = this.orderArray(steps, 'order')[0];
|
|
353
|
+
|
|
354
|
+
// Create the step transactions record for each step
|
|
355
|
+
// and its sub steps
|
|
356
|
+
await this.startStepBatch({ batch, step, body });
|
|
357
|
+
|
|
358
|
+
// body = {
|
|
359
|
+
// ...body,
|
|
360
|
+
// step_id: step.id,
|
|
361
|
+
// process_id: process_id,
|
|
362
|
+
// start_time: DateUtils.getTime(),
|
|
363
|
+
// end_time: null
|
|
364
|
+
// }
|
|
365
|
+
|
|
366
|
+
// if (body.duration === 0) {
|
|
367
|
+
|
|
368
|
+
// body = {
|
|
369
|
+
// ...body,
|
|
370
|
+
// duration: 0,
|
|
371
|
+
// end_time: DateUtils.getTime(),
|
|
372
|
+
// }
|
|
373
|
+
// }
|
|
374
|
+
|
|
375
|
+
// If there is already an existing process transaction
|
|
376
|
+
// We have to move it to a new step according to the master
|
|
377
|
+
if (process_transaction_id) {
|
|
378
|
+
|
|
379
|
+
let params = {
|
|
380
|
+
...body,
|
|
381
|
+
end_time: new Date(),
|
|
382
|
+
|
|
383
|
+
// Other fields required for duration
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Get the reference to update
|
|
387
|
+
const processTransactionReference = ProcessTransactions.getRecordReference(process_transaction_id);
|
|
388
|
+
|
|
389
|
+
await batch.update(processTransactionReference, this.appendDefaultValues(params));
|
|
390
|
+
|
|
391
|
+
return {
|
|
392
|
+
process_transaction_id,
|
|
393
|
+
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
} else {
|
|
397
|
+
|
|
398
|
+
// Get the reference to update
|
|
399
|
+
const processTransactionReference = ProcessTransactions.getRecordReference();
|
|
400
|
+
|
|
401
|
+
// Process transaction would record the start of the
|
|
402
|
+
// process and other fields releated to record ,
|
|
403
|
+
// we can keep
|
|
404
|
+
let processTransactionParams = {
|
|
405
|
+
start_time: new Date(),
|
|
406
|
+
end_time: null,
|
|
407
|
+
...body
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Note : Have to recheck how the data
|
|
411
|
+
// is flow
|
|
412
|
+
// Should we also consider
|
|
413
|
+
//
|
|
414
|
+
if (body.completed) {
|
|
415
|
+
processTransactionParams.end_time = new Date();
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// #Note Below looks buggy
|
|
419
|
+
await batch.set(processTransactionReference, this.appendDefaultValues(processTransactionParams));
|
|
420
|
+
|
|
421
|
+
return {
|
|
422
|
+
process_transaction_id: processTransactionReference.id,
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
// pre_requisites = [{
|
|
430
|
+
// type: 'process/step',
|
|
431
|
+
// // Process/ Step
|
|
432
|
+
// type_id: '',
|
|
433
|
+
// // model: 'process/step',
|
|
434
|
+
// condition: 'start||end',
|
|
435
|
+
// hirarchy:''
|
|
436
|
+
// // Operators has to be considered
|
|
437
|
+
// //
|
|
438
|
+
// }, {
|
|
439
|
+
// condition: 'end',
|
|
440
|
+
// step_id: '2',
|
|
441
|
+
// process_id: ''
|
|
442
|
+
// }]
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
// pre_requisites = [{
|
|
446
|
+
// type: 'process/step',
|
|
447
|
+
// // Process/ Step
|
|
448
|
+
// type_id: '',
|
|
449
|
+
// // model: 'process/step',
|
|
450
|
+
// condition: 'start||end',
|
|
451
|
+
// hirarchy:''
|
|
452
|
+
// // Operators has to be considered
|
|
453
|
+
// //
|
|
454
|
+
// }, {
|
|
455
|
+
// condition: 'end',
|
|
456
|
+
// step_id: '2',
|
|
457
|
+
// process_id: ''
|
|
458
|
+
// }]
|
|
459
|
+
|
|
460
|
+
// var pre_requisites = "(type=process&type_id=1&condition=start)&&(type=process&type_id=1&condition=start)"
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Get Config data for the timeline
|
|
465
|
+
*/
|
|
466
|
+
getProcessTimeline({ identifier, id }) {
|
|
467
|
+
|
|
468
|
+
var processQueries = [{
|
|
469
|
+
field: 'identifier',
|
|
470
|
+
value: identifier
|
|
471
|
+
}]
|
|
472
|
+
|
|
473
|
+
// Note , The process transaction cannot be linked with a record
|
|
474
|
+
var queries = [{ field: 'record_id', value: id }];
|
|
475
|
+
|
|
476
|
+
return ProcessTransactions.get(queries).then(({ process_transactions }) => {
|
|
477
|
+
|
|
478
|
+
console.log(process_transactions);
|
|
479
|
+
|
|
480
|
+
// We load the process by the identifier in a sorted manner
|
|
481
|
+
return this.get(processQueries, {
|
|
482
|
+
orderBy: 'order'
|
|
483
|
+
}).then((result) => {
|
|
484
|
+
|
|
485
|
+
// For each of the process , we have to load the steps
|
|
486
|
+
return Promise.all(this.orderArray(result.process, 'order').map((process) => this.getSteps(process, process_transactions, id)));
|
|
487
|
+
})
|
|
488
|
+
})
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Get the process timeline for step
|
|
494
|
+
*
|
|
495
|
+
*/
|
|
496
|
+
getProcessTimelineForStep = async (id, step_id, process_transaction_id) => {
|
|
497
|
+
|
|
498
|
+
const process_trnsaction = await ProcessTransactions.getRecord(process_transaction_id);
|
|
499
|
+
|
|
500
|
+
const step = await Steps.getDetail(step_id);
|
|
501
|
+
|
|
502
|
+
// const finalData = await this.loadStepDetail(step, id, process_trnsaction);
|
|
503
|
+
|
|
504
|
+
return await this.loadStepDetail(step, id, process_trnsaction);
|
|
505
|
+
|
|
506
|
+
// return await this.prepareStepData(id, finalData, [process_trnsaction])
|
|
507
|
+
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Get all the steps of that process
|
|
513
|
+
*/
|
|
514
|
+
getSteps(process, process_transactions = [], id) {
|
|
515
|
+
|
|
516
|
+
var queries = [{
|
|
517
|
+
field: 'process_id',
|
|
518
|
+
value: process.id
|
|
519
|
+
}, {
|
|
520
|
+
field: 'active',
|
|
521
|
+
value: true
|
|
522
|
+
}]
|
|
523
|
+
|
|
524
|
+
return Steps.get(queries, [], {
|
|
525
|
+
orderBy: 'order'
|
|
526
|
+
}).then((result) => {
|
|
527
|
+
|
|
528
|
+
// We have to consider the transaction and step transaction for the process dashboard
|
|
529
|
+
// #todo roles should be considered to decide
|
|
530
|
+
// What needs to be shown
|
|
531
|
+
return Promise.all(this.orderArray(result.steps, 'order').map(async (step) => {
|
|
532
|
+
|
|
533
|
+
// We have to load the details of the step
|
|
534
|
+
return await this.loadStepDetail(step, id, process_transactions);
|
|
535
|
+
|
|
536
|
+
// return await this.prepareStepData(id, finalData, process_transactions);
|
|
537
|
+
|
|
538
|
+
})).then((steps) => {
|
|
539
|
+
|
|
540
|
+
return {
|
|
541
|
+
...process,
|
|
542
|
+
process_transactions,
|
|
543
|
+
steps: steps
|
|
544
|
+
}
|
|
545
|
+
})
|
|
546
|
+
})
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Load the all details of the step
|
|
552
|
+
*
|
|
553
|
+
* Who it is assigned to
|
|
554
|
+
*/
|
|
555
|
+
async loadStepDetail(step, id, process_transactions) {
|
|
556
|
+
|
|
557
|
+
// Load Sub Steps
|
|
558
|
+
var queries = [{
|
|
559
|
+
field: 'header_id',
|
|
560
|
+
value: step.id
|
|
561
|
+
}, {
|
|
562
|
+
field: 'active',
|
|
563
|
+
value: true
|
|
564
|
+
}]
|
|
565
|
+
|
|
566
|
+
// We Check if there are any sub steps under
|
|
567
|
+
// the steps .
|
|
568
|
+
const { steps = [] } = await Steps.get(queries, { orderBy: 'order' })
|
|
569
|
+
|
|
570
|
+
if (steps.length) {
|
|
571
|
+
|
|
572
|
+
// For the step we have to prepare the step data which incldues the form /page
|
|
573
|
+
const final = await this.prepareStepData(id, step, process_transactions)
|
|
574
|
+
|
|
575
|
+
// For all the sub steps , we have to load the details of it
|
|
576
|
+
const modifiedSteps = await Promise.all(steps.map((innerStep) => this.loadStepDetail(innerStep, id, process_transactions)))
|
|
577
|
+
|
|
578
|
+
return {
|
|
579
|
+
...final,
|
|
580
|
+
sub_steps: modifiedSteps
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
} else {
|
|
584
|
+
|
|
585
|
+
// If there is no sub steps , we have to still load the steps information
|
|
586
|
+
const final = await this.prepareStepData(id, step, process_transactions)
|
|
587
|
+
|
|
588
|
+
return {
|
|
589
|
+
// ...step,
|
|
590
|
+
...final,
|
|
591
|
+
sub_steps: []
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// if (step.role_id && step.role_id.length) {
|
|
596
|
+
|
|
597
|
+
// var queries = [{
|
|
598
|
+
// field: firebase.firestore.FieldPath.documentId(),
|
|
599
|
+
// operator: 'in',
|
|
600
|
+
// value: step.role_id
|
|
601
|
+
// }]
|
|
602
|
+
|
|
603
|
+
// const { roles } = await Roles.get(queries)
|
|
604
|
+
|
|
605
|
+
// return {
|
|
606
|
+
// ...step,
|
|
607
|
+
// roles
|
|
608
|
+
// }
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
// } else {
|
|
612
|
+
|
|
613
|
+
// return {
|
|
614
|
+
// ...step,
|
|
615
|
+
// }
|
|
616
|
+
// }
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
async getStepRole() {
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Prepare the step data to be shown in the timeline
|
|
629
|
+
* We load the step transaction and use process transaction
|
|
630
|
+
* to enable the form
|
|
631
|
+
*/
|
|
632
|
+
prepareStepData(id, step, transactions) {
|
|
633
|
+
|
|
634
|
+
let user = this.getUser();
|
|
635
|
+
|
|
636
|
+
var queries = [{
|
|
637
|
+
field: 'record_id',
|
|
638
|
+
value: id
|
|
639
|
+
}, {
|
|
640
|
+
field: 'step_id',
|
|
641
|
+
value: step.id
|
|
642
|
+
}]
|
|
643
|
+
|
|
644
|
+
// For the particular step id we have to check if there are any transactions active.
|
|
645
|
+
return StepTransactions.get(queries).then(({ step_transactions }) => {
|
|
646
|
+
|
|
647
|
+
// Considering the process trnsaction current stage , we have to enable the form
|
|
648
|
+
// Also we consider the role
|
|
649
|
+
if (transactions.length && transactions[0].step_id === step.id) {
|
|
650
|
+
|
|
651
|
+
// Decide who should see the form
|
|
652
|
+
if (step.role_id && step.role_id.indexOf(user.role_id) !== -1) {
|
|
653
|
+
|
|
654
|
+
// if (user.role_id === step.role_id) {
|
|
655
|
+
|
|
656
|
+
step.formEnabled = true;
|
|
657
|
+
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
step.process_transaction = transactions[0]
|
|
661
|
+
|
|
662
|
+
step.current_state = 'ongoing';
|
|
663
|
+
|
|
664
|
+
} else {
|
|
665
|
+
|
|
666
|
+
step.pending = true;
|
|
667
|
+
|
|
668
|
+
step.current_state = 'pending';
|
|
669
|
+
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
step.step_transactions = [];
|
|
673
|
+
|
|
674
|
+
// Below applicable cases
|
|
675
|
+
// Its pending
|
|
676
|
+
// Its done
|
|
677
|
+
// Its in process
|
|
678
|
+
if (step_transactions.length) {
|
|
679
|
+
|
|
680
|
+
if (step_transactions[0].completed) {
|
|
681
|
+
|
|
682
|
+
step.current_state = 'completed';
|
|
683
|
+
|
|
684
|
+
} else {
|
|
685
|
+
|
|
686
|
+
step.current_state = 'ongoing';
|
|
687
|
+
|
|
688
|
+
// If there is a form or page linked to the step ,
|
|
689
|
+
// we have to activate the task form ,
|
|
690
|
+
// which would take care of the redirection to the page
|
|
691
|
+
// or load the form to complete the step
|
|
692
|
+
if (step.form_id || step.page_id) {
|
|
693
|
+
|
|
694
|
+
step.formEnabled = true;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
step.step_transactions = step_transactions;
|
|
702
|
+
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return step
|
|
706
|
+
|
|
707
|
+
})
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
get columns() {
|
|
712
|
+
return [
|
|
713
|
+
|
|
714
|
+
{
|
|
715
|
+
caption: 'Name',
|
|
716
|
+
render: (record) => {
|
|
717
|
+
|
|
718
|
+
return <Link className="booking-card" to={`/process/${record['id']}`}>
|
|
719
|
+
{record.name}
|
|
720
|
+
</Link>
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
},
|
|
724
|
+
key: 'created_at',
|
|
725
|
+
},
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
{
|
|
729
|
+
caption: 'Description',
|
|
730
|
+
field: 'description',
|
|
731
|
+
key: 'description',
|
|
732
|
+
},
|
|
733
|
+
|
|
734
|
+
{
|
|
735
|
+
caption: 'Identier',
|
|
736
|
+
field: 'identier',
|
|
737
|
+
key: 'identier',
|
|
738
|
+
},
|
|
739
|
+
|
|
740
|
+
];
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
Card = (record) => {
|
|
744
|
+
|
|
745
|
+
return (<Link className="booking-card" to={`process/${record['id']}`}>
|
|
746
|
+
<div className="card">
|
|
747
|
+
<h2 className="">
|
|
748
|
+
|
|
749
|
+
{record['amount']}
|
|
750
|
+
|
|
751
|
+
</h2>
|
|
752
|
+
<h3 className="head">
|
|
753
|
+
|
|
754
|
+
{record['name']}
|
|
755
|
+
|
|
756
|
+
</h3>
|
|
757
|
+
|
|
758
|
+
<h3 className="title">
|
|
759
|
+
|
|
760
|
+
{record['title']}
|
|
761
|
+
|
|
762
|
+
</h3>
|
|
763
|
+
|
|
764
|
+
<p className="address">
|
|
765
|
+
Booked on {record['Booking Date']}
|
|
766
|
+
<Tag color="magenta">{record['Consultant Name']}</Tag>
|
|
767
|
+
</p>
|
|
768
|
+
|
|
769
|
+
</div>
|
|
770
|
+
</Link>)
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
DetailComponent = ({ model }) => <ProcessDetail model={model} />
|
|
774
|
+
|
|
775
|
+
// AddComponent = ({ model }) => <ProcessAdd model={model} />
|
|
776
|
+
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export default Process;
|
|
780
|
+
|
|
781
|
+
export { ProcessDashboard }
|