tango-app-ui-analyse-trax 3.9.2 → 3.9.3
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/.eslintrc.json +37 -0
- package/ng-package.json +7 -0
- package/package.json +12 -25
- package/src/lib/components/action-centre/action-centre.component.html +607 -0
- package/src/lib/components/action-centre/action-centre.component.scss +185 -0
- package/src/lib/components/action-centre/action-centre.component.spec.ts +23 -0
- package/src/lib/components/action-centre/action-centre.component.ts +279 -0
- package/src/lib/components/activity-log/activity-log.component.html +84 -0
- package/src/lib/components/activity-log/activity-log.component.scss +33 -0
- package/src/lib/components/activity-log/activity-log.component.spec.ts +23 -0
- package/src/lib/components/activity-log/activity-log.component.ts +137 -0
- package/src/lib/components/activity-log-v2/activity-log-v2.component.html +189 -0
- package/src/lib/components/activity-log-v2/activity-log-v2.component.scss +162 -0
- package/src/lib/components/activity-log-v2/activity-log-v2.component.spec.ts +23 -0
- package/src/lib/components/activity-log-v2/activity-log-v2.component.ts +517 -0
- package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.html +19 -0
- package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.scss +148 -0
- package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.spec.ts +23 -0
- package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.ts +141 -0
- package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.html +42 -0
- package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.scss +49 -0
- package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.spec.ts +23 -0
- package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.ts +22 -0
- package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.html +724 -0
- package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.scss +217 -0
- package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.spec.ts +23 -0
- package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.ts +122 -0
- package/src/lib/components/add-checklist/add-checklist.component.html +1459 -0
- package/src/lib/components/add-checklist/add-checklist.component.scss +1205 -0
- package/src/lib/components/add-checklist/add-checklist.component.spec.ts +23 -0
- package/src/lib/components/add-checklist/add-checklist.component.ts +2460 -0
- package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.html +207 -0
- package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.scss +213 -0
- package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.spec.ts +23 -0
- package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.ts +621 -0
- package/src/lib/components/add-checklist/counter/counter.component.html +43 -0
- package/src/lib/components/add-checklist/counter/counter.component.scss +49 -0
- package/src/lib/components/add-checklist/counter/counter.component.spec.ts +23 -0
- package/src/lib/components/add-checklist/counter/counter.component.ts +123 -0
- package/src/lib/components/add-multitask/add-multitask.component.html +705 -0
- package/src/lib/components/add-multitask/add-multitask.component.scss +296 -0
- package/src/lib/components/add-multitask/add-multitask.component.spec.ts +23 -0
- package/src/lib/components/add-multitask/add-multitask.component.ts +611 -0
- package/src/lib/components/add-multitask/ascending-validator.ts +13 -0
- package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.html +197 -0
- package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.scss +31 -0
- package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.spec.ts +23 -0
- package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.ts +285 -0
- package/src/lib/components/add-multitask/create-task.data.ts +374 -0
- package/src/lib/components/add-multitask/create-task.interface.ts +177 -0
- package/src/lib/components/add-multitask/unique-string-validator.ts +13 -0
- package/src/lib/components/add-multitask/whitespace-validator.ts +11 -0
- package/src/lib/components/add-task/add-task.component.html +654 -0
- package/src/lib/components/add-task/add-task.component.scss +536 -0
- package/src/lib/components/add-task/add-task.component.spec.ts +23 -0
- package/src/lib/components/add-task/add-task.component.ts +569 -0
- package/src/lib/components/add-task/ascending-validator.ts +13 -0
- package/src/lib/components/add-task/create-task.data.ts +374 -0
- package/src/lib/components/add-task/create-task.interface.ts +192 -0
- package/src/lib/components/add-task/unique-string-validator.ts +13 -0
- package/src/lib/components/add-task/whitespace-validator.ts +11 -0
- package/src/lib/components/approval-popup/approval-popup.component.html +25 -0
- package/src/lib/components/approval-popup/approval-popup.component.scss +3 -0
- package/src/lib/components/approval-popup/approval-popup.component.spec.ts +23 -0
- package/src/lib/components/approval-popup/approval-popup.component.ts +26 -0
- package/src/lib/components/checklist/checklist.component.html +330 -0
- package/src/lib/components/checklist/checklist.component.scss +112 -0
- package/src/lib/components/checklist/checklist.component.spec.ts +23 -0
- package/src/lib/components/checklist/checklist.component.ts +344 -0
- package/src/lib/components/checklist-configure/assign/assign.component.html +665 -0
- package/src/lib/components/checklist-configure/assign/assign.component.scss +219 -0
- package/src/lib/components/checklist-configure/assign/assign.component.spec.ts +23 -0
- package/src/lib/components/checklist-configure/assign/assign.component.ts +932 -0
- package/src/lib/components/checklist-configure/checklist-configure.component.html +4340 -0
- package/src/lib/components/checklist-configure/checklist-configure.component.scss +2338 -0
- package/src/lib/components/checklist-configure/checklist-configure.component.spec.ts +23 -0
- package/src/lib/components/checklist-configure/checklist-configure.component.ts +4659 -0
- package/src/lib/components/checklistlayout/checklistlayout.component.html +30 -0
- package/src/lib/components/checklistlayout/checklistlayout.component.scss +15 -0
- package/src/lib/components/checklistlayout/checklistlayout.component.spec.ts +23 -0
- package/src/lib/components/checklistlayout/checklistlayout.component.ts +47 -0
- package/src/lib/components/chip-dropdown/chip-dropdown.component.html +36 -0
- package/src/lib/components/chip-dropdown/chip-dropdown.component.scss +97 -0
- package/src/lib/components/chip-dropdown/chip-dropdown.component.spec.ts +23 -0
- package/src/lib/components/chip-dropdown/chip-dropdown.component.ts +125 -0
- package/src/lib/components/create-task/create-task.component.html +2003 -0
- package/src/lib/components/create-task/create-task.component.scss +272 -0
- package/src/lib/components/create-task/create-task.component.spec.ts +23 -0
- package/src/lib/components/create-task/create-task.component.ts +614 -0
- package/src/lib/components/create-task/create-task.data.ts +372 -0
- package/src/lib/components/create-task/create-task.interface.ts +182 -0
- package/src/lib/components/create-task/validators/ascending-validator.ts +13 -0
- package/src/lib/components/create-task/validators/unique-string-validator.ts +13 -0
- package/src/lib/components/create-task/validators/whitespace-validator.ts +11 -0
- package/src/lib/components/custom-select/custom-select.component.html +44 -0
- package/src/lib/components/custom-select/custom-select.component.scss +144 -0
- package/src/lib/components/custom-select/custom-select.component.spec.ts +23 -0
- package/src/lib/components/custom-select/custom-select.component.ts +265 -0
- package/src/lib/components/dashboard/dashboard.component.html +1076 -0
- package/src/lib/components/dashboard/dashboard.component.scss +237 -0
- package/src/lib/components/dashboard/dashboard.component.spec.ts +23 -0
- package/src/lib/components/dashboard/dashboard.component.ts +539 -0
- package/src/lib/components/dashboard-info/dashboard-info.component.html +1420 -0
- package/src/lib/components/dashboard-info/dashboard-info.component.scss +409 -0
- package/src/lib/components/dashboard-info/dashboard-info.component.spec.ts +23 -0
- package/src/lib/components/dashboard-info/dashboard-info.component.ts +772 -0
- package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.html +110 -0
- package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.scss +260 -0
- package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.spec.ts +23 -0
- package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.ts +143 -0
- package/src/lib/components/dashboard-layout/dashboard-layout.component.html +1 -0
- package/src/lib/components/dashboard-layout/dashboard-layout.component.scss +0 -0
- package/src/lib/components/dashboard-layout/dashboard-layout.component.spec.ts +23 -0
- package/src/lib/components/dashboard-layout/dashboard-layout.component.ts +10 -0
- package/src/lib/components/disabled-select/disabled-select.component.html +44 -0
- package/src/lib/components/disabled-select/disabled-select.component.scss +149 -0
- package/src/lib/components/disabled-select/disabled-select.component.spec.ts +23 -0
- package/src/lib/components/disabled-select/disabled-select.component.ts +146 -0
- package/src/lib/components/export-gallery/export-gallery.component.html +175 -0
- package/src/lib/components/export-gallery/export-gallery.component.scss +200 -0
- package/src/lib/components/export-gallery/export-gallery.component.spec.ts +23 -0
- package/src/lib/components/export-gallery/export-gallery.component.ts +263 -0
- package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.html +36 -0
- package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.scss +97 -0
- package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.ts +104 -0
- package/src/lib/components/eye-test-audit/custom-select/custom-select.component.html +44 -0
- package/src/lib/components/eye-test-audit/custom-select/custom-select.component.scss +144 -0
- package/src/lib/components/eye-test-audit/custom-select/custom-select.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/custom-select/custom-select.component.ts +265 -0
- package/src/lib/components/eye-test-audit/eye-test/eye-test.component.html +1804 -0
- package/src/lib/components/eye-test-audit/eye-test/eye-test.component.scss +806 -0
- package/src/lib/components/eye-test-audit/eye-test/eye-test.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/eye-test/eye-test.component.ts +1890 -0
- package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.html +25 -0
- package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.scss +0 -0
- package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.ts +20 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.ts +26 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.html +1 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.scss +0 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.ts +24 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.ts +44 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.html +490 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.scss +721 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.ts +1017 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.html +708 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.scss +247 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.ts +446 -0
- package/src/lib/components/eye-test-audit/group-select/group-select.component.html +44 -0
- package/src/lib/components/eye-test-audit/group-select/group-select.component.scss +144 -0
- package/src/lib/components/eye-test-audit/group-select/group-select.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/group-select/group-select.component.ts +147 -0
- package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.html +18 -0
- package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.scss +49 -0
- package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.ts +104 -0
- package/src/lib/components/eye-test-audit/select-drop/select-drop.component.html +44 -0
- package/src/lib/components/eye-test-audit/select-drop/select-drop.component.scss +144 -0
- package/src/lib/components/eye-test-audit/select-drop/select-drop.component.spec.ts +23 -0
- package/src/lib/components/eye-test-audit/select-drop/select-drop.component.ts +152 -0
- package/src/lib/components/eye-test-audit/services/eye-test-audit.service.spec.ts +16 -0
- package/src/lib/components/eye-test-audit/services/eye-test-audit.service.ts +190 -0
- package/src/lib/components/flag-layout/flag-layout.component.html +1 -0
- package/src/lib/components/flag-layout/flag-layout.component.scss +0 -0
- package/src/lib/components/flag-layout/flag-layout.component.spec.ts +23 -0
- package/src/lib/components/flag-layout/flag-layout.component.ts +10 -0
- package/src/lib/components/flags/flags.component.html +473 -0
- package/src/lib/components/flags/flags.component.scss +86 -0
- package/src/lib/components/flags/flags.component.spec.ts +23 -0
- package/src/lib/components/flags/flags.component.ts +280 -0
- package/{lib/components/flags/flags.interface.d.ts → src/lib/components/flags/flags.interface.ts} +73 -65
- package/src/lib/components/flags-info/flags-info.component.html +6012 -0
- package/src/lib/components/flags-info/flags-info.component.scss +278 -0
- package/src/lib/components/flags-info/flags-info.component.spec.ts +23 -0
- package/src/lib/components/flags-info/flags-info.component.ts +490 -0
- package/src/lib/components/flags-info/flags-info.interface.ts +441 -0
- package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.html +1 -0
- package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.scss +4 -0
- package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.ts +78 -0
- package/src/lib/components/flags-new/flags-new.component.html +904 -0
- package/src/lib/components/flags-new/flags-new.component.scss +121 -0
- package/src/lib/components/flags-new/flags-new.component.spec.ts +23 -0
- package/src/lib/components/flags-new/flags-new.component.ts +357 -0
- package/{lib/components/flags-new/flags-new.interface.d.ts → src/lib/components/flags-new/flags-new.interface.ts} +90 -81
- package/src/lib/components/gallery/gallery.component.html +3660 -0
- package/src/lib/components/gallery/gallery.component.scss +930 -0
- package/src/lib/components/gallery/gallery.component.ts +3527 -0
- package/src/lib/components/group-select/group-select.component.html +44 -0
- package/src/lib/components/group-select/group-select.component.scss +144 -0
- package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
- package/src/lib/components/group-select/group-select.component.ts +145 -0
- package/src/lib/components/image-popup/image-popup.component.html +11 -0
- package/src/lib/components/image-popup/image-popup.component.scss +5 -0
- package/src/lib/components/image-popup/image-popup.component.ts +18 -0
- package/src/lib/components/lib/custom-select/custom-select.component.html +42 -0
- package/src/lib/components/lib/custom-select/custom-select.component.scss +131 -0
- package/src/lib/components/lib/custom-select/custom-select.component.spec.ts +23 -0
- package/src/lib/components/lib/custom-select/custom-select.component.ts +151 -0
- package/src/lib/components/manage-task/manage-task.component.html +265 -0
- package/src/lib/components/manage-task/manage-task.component.scss +69 -0
- package/src/lib/components/manage-task/manage-task.component.spec.ts +23 -0
- package/src/lib/components/manage-task/manage-task.component.ts +267 -0
- package/src/lib/components/managechecklist/managechecklist.component.html +176 -0
- package/src/lib/components/managechecklist/managechecklist.component.scss +43 -0
- package/src/lib/components/managechecklist/managechecklist.component.spec.ts +23 -0
- package/src/lib/components/managechecklist/managechecklist.component.ts +176 -0
- package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.html +46 -0
- package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.scss +181 -0
- package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.spec.ts +23 -0
- package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.ts +221 -0
- package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.html +36 -0
- package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.scss +89 -0
- package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.spec.ts +23 -0
- package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.ts +118 -0
- package/src/lib/components/orders/orders.component.html +203 -0
- package/src/lib/components/orders/orders.component.scss +180 -0
- package/src/lib/components/orders/orders.component.spec.ts +25 -0
- package/src/lib/components/orders/orders.component.ts +197 -0
- package/src/lib/components/pagination/pagination.component.html +28 -0
- package/src/lib/components/pagination/pagination.component.scss +6 -0
- package/src/lib/components/pagination/pagination.component.spec.ts +23 -0
- package/src/lib/components/pagination/pagination.component.ts +54 -0
- package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
- package/src/lib/components/reactive-select/reactive-select.component.scss +48 -0
- package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
- package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
- package/src/lib/components/reports/date-picker/date-picker.component.html +54 -0
- package/src/lib/components/reports/date-picker/date-picker.component.scss +156 -0
- package/src/lib/components/reports/date-picker/date-picker.component.spec.ts +23 -0
- package/src/lib/components/reports/date-picker/date-picker.component.ts +60 -0
- package/src/lib/components/reports/reports.component.html +225 -0
- package/src/lib/components/reports/reports.component.scss +69 -0
- package/src/lib/components/reports/reports.component.spec.ts +23 -0
- package/src/lib/components/reports/reports.component.ts +334 -0
- package/{lib/components/reports/reports.interface.d.ts → src/lib/components/reports/reports.interface.ts} +50 -46
- package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.html +1 -0
- package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.scss +15 -0
- package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.spec.ts +23 -0
- package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.ts +31 -0
- package/src/lib/components/task/task.component.html +322 -0
- package/src/lib/components/task/task.component.scss +169 -0
- package/src/lib/components/task/task.component.spec.ts +23 -0
- package/src/lib/components/task/task.component.ts +340 -0
- package/src/lib/components/task-configure/task-configure.component.html +737 -0
- package/src/lib/components/task-configure/task-configure.component.scss +569 -0
- package/src/lib/components/task-configure/task-configure.component.spec.ts +23 -0
- package/src/lib/components/task-configure/task-configure.component.ts +1603 -0
- package/src/lib/components/task-configure/task-configure.interface.ts +138 -0
- package/src/lib/components/task-info/task-info.component.html +390 -0
- package/src/lib/components/task-info/task-info.component.scss +56 -0
- package/src/lib/components/task-info/task-info.component.spec.ts +23 -0
- package/src/lib/components/task-info/task-info.component.ts +400 -0
- package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.html +141 -0
- package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.scss +460 -0
- package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.spec.ts +23 -0
- package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.ts +202 -0
- package/src/lib/components/task-layout/task-layout.component.html +1 -0
- package/src/lib/components/task-layout/task-layout.component.scss +0 -0
- package/src/lib/components/task-layout/task-layout.component.spec.ts +23 -0
- package/src/lib/components/task-layout/task-layout.component.ts +10 -0
- package/src/lib/components/task-logs/task-logs.component.html +97 -0
- package/src/lib/components/task-logs/task-logs.component.scss +301 -0
- package/src/lib/components/task-logs/task-logs.component.spec.ts +23 -0
- package/src/lib/components/task-logs/task-logs.component.ts +80 -0
- package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.html +84 -0
- package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.scss +229 -0
- package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.spec.ts +23 -0
- package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.ts +111 -0
- package/src/lib/components/trax-store/trax-store.component.html +78 -0
- package/src/lib/components/trax-store/trax-store.component.scss +134 -0
- package/src/lib/components/trax-store/trax-store.component.spec.ts +23 -0
- package/src/lib/components/trax-store/trax-store.component.ts +172 -0
- package/src/lib/components/traxpopup/traxpopup.component.html +130 -0
- package/src/lib/components/traxpopup/traxpopup.component.scss +225 -0
- package/src/lib/components/traxpopup/traxpopup.component.spec.ts +23 -0
- package/src/lib/components/traxpopup/traxpopup.component.ts +71 -0
- package/src/lib/services/trax.service.spec.ts +16 -0
- package/src/lib/services/trax.service.ts +789 -0
- package/src/lib/tango-analyse-trax-routing.module.ts +151 -0
- package/src/lib/tango-analyse-trax.module.ts +140 -0
- package/{public-api.d.ts → src/public-api.ts} +6 -2
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/lib/components/action-centre/action-centre.component.mjs +0 -288
- package/esm2022/lib/components/activity-log/activity-log.component.mjs +0 -150
- package/esm2022/lib/components/activity-log-v2/activity-log-v2.component.mjs +0 -502
- package/esm2022/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.mjs +0 -114
- package/esm2022/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.mjs +0 -24
- package/esm2022/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.mjs +0 -126
- package/esm2022/lib/components/add-checklist/add-checklist.component.mjs +0 -2352
- package/esm2022/lib/components/add-checklist/checklist-popup/checklist-popup.component.mjs +0 -612
- package/esm2022/lib/components/add-checklist/counter/counter.component.mjs +0 -138
- package/esm2022/lib/components/add-multitask/add-multitask.component.mjs +0 -604
- package/esm2022/lib/components/add-multitask/ascending-validator.mjs +0 -11
- package/esm2022/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.mjs +0 -297
- package/esm2022/lib/components/add-multitask/create-task.data.mjs +0 -372
- package/esm2022/lib/components/add-multitask/create-task.interface.mjs +0 -2
- package/esm2022/lib/components/add-multitask/unique-string-validator.mjs +0 -10
- package/esm2022/lib/components/add-multitask/whitespace-validator.mjs +0 -10
- package/esm2022/lib/components/add-task/add-task.component.mjs +0 -561
- package/esm2022/lib/components/add-task/ascending-validator.mjs +0 -11
- package/esm2022/lib/components/add-task/create-task.data.mjs +0 -372
- package/esm2022/lib/components/add-task/create-task.interface.mjs +0 -2
- package/esm2022/lib/components/add-task/unique-string-validator.mjs +0 -10
- package/esm2022/lib/components/add-task/whitespace-validator.mjs +0 -10
- package/esm2022/lib/components/approval-popup/approval-popup.component.mjs +0 -30
- package/esm2022/lib/components/checklist/checklist.component.mjs +0 -327
- package/esm2022/lib/components/checklist-configure/assign/assign.component.mjs +0 -912
- package/esm2022/lib/components/checklist-configure/checklist-configure.component.mjs +0 -4161
- package/esm2022/lib/components/checklistlayout/checklistlayout.component.mjs +0 -44
- package/esm2022/lib/components/chip-dropdown/chip-dropdown.component.mjs +0 -120
- package/esm2022/lib/components/create-task/create-task.component.mjs +0 -585
- package/esm2022/lib/components/create-task/create-task.data.mjs +0 -372
- package/esm2022/lib/components/create-task/create-task.interface.mjs +0 -2
- package/esm2022/lib/components/create-task/validators/ascending-validator.mjs +0 -11
- package/esm2022/lib/components/create-task/validators/unique-string-validator.mjs +0 -10
- package/esm2022/lib/components/create-task/validators/whitespace-validator.mjs +0 -10
- package/esm2022/lib/components/custom-select/custom-select.component.mjs +0 -240
- package/esm2022/lib/components/dashboard/dashboard.component.mjs +0 -532
- package/esm2022/lib/components/dashboard-info/dashboard-info.component.mjs +0 -741
- package/esm2022/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.mjs +0 -155
- package/esm2022/lib/components/dashboard-layout/dashboard-layout.component.mjs +0 -12
- package/esm2022/lib/components/disabled-select/disabled-select.component.mjs +0 -158
- package/esm2022/lib/components/export-gallery/export-gallery.component.mjs +0 -266
- package/esm2022/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.mjs +0 -105
- package/esm2022/lib/components/eye-test-audit/custom-select/custom-select.component.mjs +0 -240
- package/esm2022/lib/components/eye-test-audit/eye-test/eye-test.component.mjs +0 -1733
- package/esm2022/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.mjs +0 -24
- package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.mjs +0 -34
- package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.mjs +0 -27
- package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.mjs +0 -71
- package/esm2022/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.mjs +0 -823
- package/esm2022/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.mjs +0 -412
- package/esm2022/lib/components/eye-test-audit/group-select/group-select.component.mjs +0 -157
- package/esm2022/lib/components/eye-test-audit/reactive-select/reactive-select.component.mjs +0 -105
- package/esm2022/lib/components/eye-test-audit/select-drop/select-drop.component.mjs +0 -162
- package/esm2022/lib/components/eye-test-audit/services/eye-test-audit.service.mjs +0 -166
- package/esm2022/lib/components/flag-layout/flag-layout.component.mjs +0 -12
- package/esm2022/lib/components/flags/flags.component.mjs +0 -263
- package/esm2022/lib/components/flags/flags.interface.mjs +0 -2
- package/esm2022/lib/components/flags-info/flags-info.component.mjs +0 -452
- package/esm2022/lib/components/flags-info/flags-info.interface.mjs +0 -2
- package/esm2022/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.mjs +0 -71
- package/esm2022/lib/components/flags-new/flags-new.component.mjs +0 -335
- package/esm2022/lib/components/flags-new/flags-new.interface.mjs +0 -2
- package/esm2022/lib/components/gallery/gallery.component.mjs +0 -3402
- package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
- package/esm2022/lib/components/image-popup/image-popup.component.mjs +0 -25
- package/esm2022/lib/components/lib/custom-select/custom-select.component.mjs +0 -158
- package/esm2022/lib/components/manage-task/manage-task.component.mjs +0 -264
- package/esm2022/lib/components/managechecklist/managechecklist.component.mjs +0 -186
- package/esm2022/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.mjs +0 -229
- package/esm2022/lib/components/multi-date-datepicker/multi-date-datepicker.component.mjs +0 -124
- package/esm2022/lib/components/orders/orders.component.mjs +0 -171
- package/esm2022/lib/components/pagination/pagination.component.mjs +0 -62
- package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
- package/esm2022/lib/components/reports/date-picker/date-picker.component.mjs +0 -60
- package/esm2022/lib/components/reports/reports.component.mjs +0 -300
- package/esm2022/lib/components/reports/reports.interface.mjs +0 -2
- package/esm2022/lib/components/tango-analyse-trax/tango-analyse-trax.component.mjs +0 -32
- package/esm2022/lib/components/task/task.component.mjs +0 -341
- package/esm2022/lib/components/task-configure/task-configure.component.mjs +0 -1532
- package/esm2022/lib/components/task-configure/task-configure.interface.mjs +0 -2
- package/esm2022/lib/components/task-info/task-info.component.mjs +0 -375
- package/esm2022/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.mjs +0 -208
- package/esm2022/lib/components/task-layout/task-layout.component.mjs +0 -12
- package/esm2022/lib/components/task-logs/task-logs.component.mjs +0 -104
- package/esm2022/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.mjs +0 -107
- package/esm2022/lib/components/trax-store/trax-store.component.mjs +0 -179
- package/esm2022/lib/components/traxpopup/traxpopup.component.mjs +0 -70
- package/esm2022/lib/services/trax.service.mjs +0 -559
- package/esm2022/lib/tango-analyse-trax-routing.module.mjs +0 -153
- package/esm2022/lib/tango-analyse-trax.module.mjs +0 -221
- package/esm2022/public-api.mjs +0 -6
- package/esm2022/tango-app-ui-analyse-trax.mjs +0 -5
- package/fesm2022/tango-app-ui-analyse-trax.mjs +0 -28896
- package/fesm2022/tango-app-ui-analyse-trax.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/action-centre/action-centre.component.d.ts +0 -68
- package/lib/components/activity-log/activity-log.component.d.ts +0 -39
- package/lib/components/activity-log-v2/activity-log-v2.component.d.ts +0 -78
- package/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.d.ts +0 -24
- package/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.d.ts +0 -9
- package/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.d.ts +0 -34
- package/lib/components/add-checklist/add-checklist.component.d.ts +0 -121
- package/lib/components/add-checklist/checklist-popup/checklist-popup.component.d.ts +0 -45
- package/lib/components/add-checklist/counter/counter.component.d.ts +0 -29
- package/lib/components/add-multitask/add-multitask.component.d.ts +0 -102
- package/lib/components/add-multitask/ascending-validator.d.ts +0 -2
- package/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.d.ts +0 -45
- package/lib/components/add-multitask/create-task.data.d.ts +0 -293
- package/lib/components/add-multitask/create-task.interface.d.ts +0 -159
- package/lib/components/add-multitask/unique-string-validator.d.ts +0 -2
- package/lib/components/add-multitask/whitespace-validator.d.ts +0 -2
- package/lib/components/add-task/add-task.component.d.ts +0 -89
- package/lib/components/add-task/ascending-validator.d.ts +0 -2
- package/lib/components/add-task/create-task.data.d.ts +0 -293
- package/lib/components/add-task/create-task.interface.d.ts +0 -161
- package/lib/components/add-task/unique-string-validator.d.ts +0 -2
- package/lib/components/add-task/whitespace-validator.d.ts +0 -2
- package/lib/components/approval-popup/approval-popup.component.d.ts +0 -14
- package/lib/components/checklist/checklist.component.d.ts +0 -40
- package/lib/components/checklist-configure/assign/assign.component.d.ts +0 -105
- package/lib/components/checklist-configure/checklist-configure.component.d.ts +0 -325
- package/lib/components/checklistlayout/checklistlayout.component.d.ts +0 -15
- package/lib/components/chip-dropdown/chip-dropdown.component.d.ts +0 -28
- package/lib/components/create-task/create-task.component.d.ts +0 -76
- package/lib/components/create-task/create-task.data.d.ts +0 -293
- package/lib/components/create-task/create-task.interface.d.ts +0 -163
- package/lib/components/create-task/validators/ascending-validator.d.ts +0 -2
- package/lib/components/create-task/validators/unique-string-validator.d.ts +0 -2
- package/lib/components/create-task/validators/whitespace-validator.d.ts +0 -2
- package/lib/components/custom-select/custom-select.component.d.ts +0 -35
- package/lib/components/dashboard/dashboard.component.d.ts +0 -80
- package/lib/components/dashboard-info/dashboard-info.component.d.ts +0 -117
- package/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.d.ts +0 -41
- package/lib/components/dashboard-layout/dashboard-layout.component.d.ts +0 -5
- package/lib/components/disabled-select/disabled-select.component.d.ts +0 -34
- package/lib/components/export-gallery/export-gallery.component.d.ts +0 -44
- package/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.d.ts +0 -26
- package/lib/components/eye-test-audit/custom-select/custom-select.component.d.ts +0 -35
- package/lib/components/eye-test-audit/eye-test/eye-test.component.d.ts +0 -218
- package/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.d.ts +0 -12
- package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.d.ts +0 -7
- package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.d.ts +0 -11
- package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.d.ts +0 -21
- package/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.d.ts +0 -129
- package/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.d.ts +0 -86
- package/lib/components/eye-test-audit/group-select/group-select.component.d.ts +0 -33
- package/lib/components/eye-test-audit/reactive-select/reactive-select.component.d.ts +0 -32
- package/lib/components/eye-test-audit/select-drop/select-drop.component.d.ts +0 -33
- package/lib/components/eye-test-audit/services/eye-test-audit.service.d.ts +0 -47
- package/lib/components/flag-layout/flag-layout.component.d.ts +0 -5
- package/lib/components/flags/flags.component.d.ts +0 -52
- package/lib/components/flags-info/flags-info.component.d.ts +0 -73
- package/lib/components/flags-info/flags-info.interface.d.ts +0 -430
- package/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.d.ts +0 -13
- package/lib/components/flags-new/flags-new.component.d.ts +0 -60
- package/lib/components/gallery/gallery.component.d.ts +0 -261
- package/lib/components/group-select/group-select.component.d.ts +0 -33
- package/lib/components/image-popup/image-popup.component.d.ts +0 -11
- package/lib/components/lib/custom-select/custom-select.component.d.ts +0 -33
- package/lib/components/manage-task/manage-task.component.d.ts +0 -47
- package/lib/components/managechecklist/managechecklist.component.d.ts +0 -33
- package/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.d.ts +0 -40
- package/lib/components/multi-date-datepicker/multi-date-datepicker.component.d.ts +0 -27
- package/lib/components/orders/orders.component.d.ts +0 -38
- package/lib/components/pagination/pagination.component.d.ts +0 -16
- package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
- package/lib/components/reports/date-picker/date-picker.component.d.ts +0 -23
- package/lib/components/reports/reports.component.d.ts +0 -55
- package/lib/components/tango-analyse-trax/tango-analyse-trax.component.d.ts +0 -14
- package/lib/components/task/task.component.d.ts +0 -70
- package/lib/components/task-configure/task-configure.component.d.ts +0 -142
- package/lib/components/task-configure/task-configure.interface.d.ts +0 -128
- package/lib/components/task-info/task-info.component.d.ts +0 -76
- package/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.d.ts +0 -61
- package/lib/components/task-layout/task-layout.component.d.ts +0 -5
- package/lib/components/task-logs/task-logs.component.d.ts +0 -27
- package/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.d.ts +0 -26
- package/lib/components/trax-store/trax-store.component.d.ts +0 -45
- package/lib/components/traxpopup/traxpopup.component.d.ts +0 -24
- package/lib/services/trax.service.d.ts +0 -175
- package/lib/tango-analyse-trax-routing.module.d.ts +0 -7
- package/lib/tango-analyse-trax.module.d.ts +0 -68
|
@@ -0,0 +1,1890 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component, OnInit, OnDestroy, ViewChild, ElementRef, AfterViewInit, HostListener } from "@angular/core";
|
|
2
|
+
import { Router, ActivatedRoute } from "@angular/router";
|
|
3
|
+
import { GlobalStateService, PageInfoService } from "tango-app-ui-global";
|
|
4
|
+
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
|
|
5
|
+
import dayjs from "dayjs";
|
|
6
|
+
import "dayjs/locale/en";
|
|
7
|
+
import utc from "dayjs/plugin/utc";
|
|
8
|
+
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
9
|
+
import { debounceTime, distinctUntilChanged, Subject, takeUntil,Observable,tap, BehaviorSubject } from "rxjs";
|
|
10
|
+
import { TraxService } from "../../../services/trax.service";
|
|
11
|
+
import { EyeTestAuditService } from "../services/eye-test-audit.service";
|
|
12
|
+
import { ToastService } from "tango-app-ui-shared";
|
|
13
|
+
import { switchMap, finalize } from 'rxjs/operators';
|
|
14
|
+
import { NgbModal, NgbTooltip } from "@ng-bootstrap/ng-bootstrap";
|
|
15
|
+
import { SendAlertComponent } from "./send-alert/send-alert.component";
|
|
16
|
+
@Component({
|
|
17
|
+
selector: "lib-eye-test",
|
|
18
|
+
templateUrl: "./eye-test.component.html",
|
|
19
|
+
styleUrl: "./eye-test.component.scss",
|
|
20
|
+
})
|
|
21
|
+
export class EyeTestComponent implements OnInit, OnDestroy {
|
|
22
|
+
dayjs = dayjs;
|
|
23
|
+
eyeTestForm: FormGroup;
|
|
24
|
+
selectedDateRange: any = {};
|
|
25
|
+
selectedDate: any;
|
|
26
|
+
isCustomDate: any;
|
|
27
|
+
headerFilters: any = [];
|
|
28
|
+
ClusterList: any = [];
|
|
29
|
+
stores: any = [];
|
|
30
|
+
clientData: any;
|
|
31
|
+
private destroy$ = new Subject();
|
|
32
|
+
groups: any = [];
|
|
33
|
+
storeList: any[] = [];
|
|
34
|
+
noData = false;
|
|
35
|
+
loading = true;
|
|
36
|
+
eyeTestData: any;
|
|
37
|
+
typeValue: any;
|
|
38
|
+
type: any = [
|
|
39
|
+
{ value: "physical", label: "Eye Test" },
|
|
40
|
+
{ value: "remote", label: "Remote Test" },
|
|
41
|
+
];
|
|
42
|
+
auditType: any = [
|
|
43
|
+
{ label: "All", value: "all" },
|
|
44
|
+
{ label: "Adult", value: "adult" },
|
|
45
|
+
{ label: "Kid", value: "kids" },
|
|
46
|
+
];
|
|
47
|
+
dateType: any = [
|
|
48
|
+
{ value: "fileDate", label: "Eye Test Date" },
|
|
49
|
+
{ value: "auditedDate", label: "Audited Date" },
|
|
50
|
+
];
|
|
51
|
+
typePercentageArray:any = [];
|
|
52
|
+
|
|
53
|
+
nearAdditionArray: any = [
|
|
54
|
+
{
|
|
55
|
+
label: "All",
|
|
56
|
+
value: "",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: "With Near Addition",
|
|
60
|
+
value: "true"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "Without Near Addition",
|
|
64
|
+
value: "false"
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
categoryArray: any = [
|
|
69
|
+
{
|
|
70
|
+
label: "Genuine",
|
|
71
|
+
value: "genuine",
|
|
72
|
+
},
|
|
73
|
+
{ label: "Fake", value: "fake" },
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
auditedDateAuditStatus:any =[
|
|
77
|
+
{ label: "Audited", value: "Audited" },
|
|
78
|
+
{ label: "Re-Audited", value: "Re-Audited" },
|
|
79
|
+
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
auditStatusArray:any =[
|
|
83
|
+
{ label: "Audited", value: "Audited" },
|
|
84
|
+
{ label: "Re-Audited", value: "Re-Audited" },
|
|
85
|
+
{label :"Yet-to-Audit", value: "Yet-to-Audit" },
|
|
86
|
+
{ label :"In-Progress", value: "In-Progress" },
|
|
87
|
+
|
|
88
|
+
]
|
|
89
|
+
showEyeTest = true;
|
|
90
|
+
constructor(
|
|
91
|
+
private pageInfo: PageInfoService,
|
|
92
|
+
private fb: FormBuilder,
|
|
93
|
+
private traxService: TraxService,
|
|
94
|
+
private eyeService: EyeTestAuditService,
|
|
95
|
+
private router: Router,
|
|
96
|
+
private cd: ChangeDetectorRef,
|
|
97
|
+
public gs: GlobalStateService,
|
|
98
|
+
private ts: ToastService, private modalService: NgbModal,
|
|
99
|
+
private route: ActivatedRoute,
|
|
100
|
+
private sanitizer: DomSanitizer
|
|
101
|
+
) {
|
|
102
|
+
this.typeValue = this.route.snapshot.queryParamMap.get("typeValue");
|
|
103
|
+
}
|
|
104
|
+
headDate: any;
|
|
105
|
+
headDateEnd: any;
|
|
106
|
+
users: any;
|
|
107
|
+
ngOnDestroy(): void {
|
|
108
|
+
this.destroy$.next(true);
|
|
109
|
+
this.destroy$.complete();
|
|
110
|
+
}
|
|
111
|
+
closeEyeTest() {
|
|
112
|
+
this.showEyeTest = false;
|
|
113
|
+
this.cd.detectChanges();
|
|
114
|
+
}
|
|
115
|
+
RmListNew:any;
|
|
116
|
+
storesNew:any;
|
|
117
|
+
dataBackGet:any;
|
|
118
|
+
auditStatusNew:any;
|
|
119
|
+
complianceScoreArray:any;
|
|
120
|
+
ngOnInit(): void {
|
|
121
|
+
let userinfo = JSON.parse(localStorage.getItem("user-info") || "");
|
|
122
|
+
this.users = userinfo;
|
|
123
|
+
this.initAiSession();
|
|
124
|
+
if (this.users && (this.users.role === "superadmin" || this.users.role === "admin")) {
|
|
125
|
+
this.typePercentageArray = [
|
|
126
|
+
{ label: "0–10%", value: "0-10" },
|
|
127
|
+
{ label: "10–20%", value: "10-20" },
|
|
128
|
+
{ label: "20–30%", value: "20-30" },
|
|
129
|
+
{ label: "30–40%", value: "30-40" },
|
|
130
|
+
{ label: "40–50%", value: "40-50"},
|
|
131
|
+
{ label: "50–60%", value: "50-60" },
|
|
132
|
+
{ label: "60–70%", value: "60-70" },
|
|
133
|
+
{ label: "70–80%", value: "70-80" },
|
|
134
|
+
{ label: "80–90%", value: "80-90" },
|
|
135
|
+
{ label: "90–100%", value: "90-100" },
|
|
136
|
+
];
|
|
137
|
+
} else {
|
|
138
|
+
this.typePercentageArray = [
|
|
139
|
+
{ label: "0%", value: "0" },
|
|
140
|
+
{ label: "17%", value: "16" },
|
|
141
|
+
{ label: "33%", value: "33" },
|
|
142
|
+
{ label: "50%", value: "50" },
|
|
143
|
+
{ label: "67%", value: "66" },
|
|
144
|
+
{ label: "83%", value: "83" },
|
|
145
|
+
{ label: "100%", value: "100" },
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!this.typeValue) {
|
|
150
|
+
this.typeValue = "physical";
|
|
151
|
+
}
|
|
152
|
+
this.isCustomDate = (m: dayjs.Dayjs) => {
|
|
153
|
+
const isValidDate = m > this.dayjs();
|
|
154
|
+
return isValidDate ? "invalid-date" : false;
|
|
155
|
+
};
|
|
156
|
+
this.selectedDateRange = {
|
|
157
|
+
startDate: this.dayjs().subtract(1, "day").format("DD-MM-YYYY"),
|
|
158
|
+
endDate: this.dayjs().subtract(1, "day").format("DD-MM-YYYY"),
|
|
159
|
+
};
|
|
160
|
+
let headerFilters = JSON.parse(
|
|
161
|
+
localStorage.getItem("header-filters") || "{}"
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
if (headerFilters?.date?.startDate && headerFilters?.date?.endDate) {
|
|
165
|
+
this.selectedDateRange = {
|
|
166
|
+
startDate: this.dayjs(
|
|
167
|
+
headerFilters.date.startDate,
|
|
168
|
+
"YYYY-MM-DD"
|
|
169
|
+
).format("DD-MM-YYYY"),
|
|
170
|
+
endDate: this.dayjs(headerFilters.date.endDate, "YYYY-MM-DD").format(
|
|
171
|
+
"DD-MM-YYYY"
|
|
172
|
+
),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
this.route.queryParams.subscribe((params) => {
|
|
176
|
+
if (
|
|
177
|
+
params &&
|
|
178
|
+
params["fromDate"] &&
|
|
179
|
+
params["toDate"] &&
|
|
180
|
+
params["typeValue"]
|
|
181
|
+
) {
|
|
182
|
+
this.typeValue = params["typeValue"] ? params["typeValue"] : "physical";
|
|
183
|
+
|
|
184
|
+
this.selectedDateRange.startDate = this.dayjs(
|
|
185
|
+
params["fromDate"],
|
|
186
|
+
"YYYY-MM-DD"
|
|
187
|
+
).format("DD-MM-YYYY");
|
|
188
|
+
this.selectedDateRange.endDate = this.dayjs(
|
|
189
|
+
params["toDate"],
|
|
190
|
+
"YYYY-MM-DD"
|
|
191
|
+
).format("DD-MM-YYYY");
|
|
192
|
+
} else {
|
|
193
|
+
this.router.navigate(["/manage/trax/audit"], {
|
|
194
|
+
queryParams: {
|
|
195
|
+
fromDate: this.dayjs(
|
|
196
|
+
this.selectedDateRange.startDate,
|
|
197
|
+
"DD-MM-YYYY"
|
|
198
|
+
).format("YYYY-MM-DD"),
|
|
199
|
+
toDate: this.dayjs(
|
|
200
|
+
this.selectedDateRange.endDate,
|
|
201
|
+
"DD-MM-YYYY"
|
|
202
|
+
).format("YYYY-MM-DD"),
|
|
203
|
+
typeValue: this.typeValue ? this.typeValue : "physical",
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
let dateTime = this.selectedDateRange.startDate;
|
|
209
|
+
this.headDate = this.dayjs(dateTime, "DD-MM-YYYY").format("MMM, DD");
|
|
210
|
+
this.headDateEnd = this.dayjs(
|
|
211
|
+
this.selectedDateRange.endDate,
|
|
212
|
+
"DD-MM-YYYY"
|
|
213
|
+
).format("MMM DD, YYYY");
|
|
214
|
+
this.createForm();
|
|
215
|
+
this.eyeTestForm.get("Type")?.setValue(this.typeValue);
|
|
216
|
+
this.eyeTestForm.get("complianceScore")?.setValue(this.typePercentageArray);
|
|
217
|
+
this.eyeTestForm.get("auditStatus")?.setValue(this.auditStatusArray);
|
|
218
|
+
this.gs.dataRangeValue.pipe(takeUntil(this.destroy$)).subscribe({
|
|
219
|
+
next: (data: any) => {
|
|
220
|
+
// let data = JSON.parse(localStorage.getItem("header-filters") || "")
|
|
221
|
+
if (data?.client) {
|
|
222
|
+
this.headerFilters = data;
|
|
223
|
+
// setTimeout(() => {
|
|
224
|
+
if (this.headerFilters.client) {
|
|
225
|
+
|
|
226
|
+
this.getAllRm1()
|
|
227
|
+
.pipe(
|
|
228
|
+
switchMap(() => this.getAllGroups1()),
|
|
229
|
+
switchMap(() => this.getAllStores1())
|
|
230
|
+
)
|
|
231
|
+
.subscribe({
|
|
232
|
+
next: () => {
|
|
233
|
+
// All done ✅
|
|
234
|
+
this.onSubmit();
|
|
235
|
+
this.cd.detectChanges();
|
|
236
|
+
},
|
|
237
|
+
error: (err:any) => {
|
|
238
|
+
console.error("Error loading data:", err);
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
this.cd.detectChanges();
|
|
243
|
+
// }, 10);
|
|
244
|
+
} else {
|
|
245
|
+
// setTimeout(() => {
|
|
246
|
+
if (this.users && this.users?.clientId) {
|
|
247
|
+
this.headerFilters.client = this.users.clientId;
|
|
248
|
+
|
|
249
|
+
this.getAllRm1()
|
|
250
|
+
.pipe(
|
|
251
|
+
switchMap(() => this.getAllGroups1()),
|
|
252
|
+
switchMap(() => this.getAllStores1())
|
|
253
|
+
)
|
|
254
|
+
.subscribe({
|
|
255
|
+
next: () => {
|
|
256
|
+
// All done ✅
|
|
257
|
+
this.onSubmit();
|
|
258
|
+
this.cd.detectChanges();
|
|
259
|
+
},
|
|
260
|
+
error: (err:any) => {
|
|
261
|
+
console.error("Error loading data:", err);
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
this.cd.detectChanges();
|
|
267
|
+
// }, 10);
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
getAbsValue(value: number | null | undefined): number {
|
|
273
|
+
return value != null ? Math.abs(value) : 0;
|
|
274
|
+
}
|
|
275
|
+
// clusters old api removed
|
|
276
|
+
// getAllGroups() {
|
|
277
|
+
// this.traxService.getclusters({ clientId: this.headerFilters?.client, group: [], city: [] }).pipe(takeUntil(this.destroy$)).subscribe({
|
|
278
|
+
// next: (res: any) => {
|
|
279
|
+
// if (res && res.code == 200) {
|
|
280
|
+
// this.ClusterList = res.data.groupData
|
|
281
|
+
// } else {
|
|
282
|
+
// this.ClusterList = []
|
|
283
|
+
// }
|
|
284
|
+
// }
|
|
285
|
+
// })
|
|
286
|
+
// }
|
|
287
|
+
loading1 = true;
|
|
288
|
+
// clusters new api
|
|
289
|
+
getAllGroups1(event?: any): Observable<any> {
|
|
290
|
+
|
|
291
|
+
let rmList: any = [];
|
|
292
|
+
this.ClusterList = [];
|
|
293
|
+
if (Array.isArray(this.eyeTestForm.value.RmList)) {
|
|
294
|
+
this.eyeTestForm.value.RmList.forEach((el: any) => {
|
|
295
|
+
rmList.push(el?.email);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
event?.map((el: any) => el?.email) || [this.users?.email];
|
|
299
|
+
const obj = {
|
|
300
|
+
clientId: this.headerFilters?.client ? this.headerFilters.client : "",
|
|
301
|
+
rmList: rmList.length > 0 ? rmList : [this.users?.email],
|
|
302
|
+
};
|
|
303
|
+
return this.eyeService.getClusters(obj).pipe(
|
|
304
|
+
tap((res: any) => {
|
|
305
|
+
if (res && res.code === 200) {
|
|
306
|
+
this.ClusterList = res.data.result;
|
|
307
|
+
this.eyeTestForm.get("ClusterList")?.setValue(this.ClusterList);
|
|
308
|
+
this.groups = this.ClusterList.map((el: any) => el.clusterName);
|
|
309
|
+
// Note: Do NOT call getAllStores() here; chain it outside
|
|
310
|
+
} else {
|
|
311
|
+
this.ClusterList = [];
|
|
312
|
+
this.loading1 = false;
|
|
313
|
+
}
|
|
314
|
+
this.cd.detectChanges();
|
|
315
|
+
})
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// clientDetails() {
|
|
320
|
+
// this.traxService.getclient({ clientId: this.headerFilters.client }).subscribe({
|
|
321
|
+
// next: (res: any) => {
|
|
322
|
+
// if (res && res.code == 200) {
|
|
323
|
+
// this.clientData = res.data.result
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// })
|
|
327
|
+
// }
|
|
328
|
+
|
|
329
|
+
getAllStores1(): Observable<any> {
|
|
330
|
+
return this.traxService
|
|
331
|
+
.getStoreslist({
|
|
332
|
+
clientId: this.headerFilters?.client,
|
|
333
|
+
clusters: this.groups,
|
|
334
|
+
city: [],
|
|
335
|
+
})
|
|
336
|
+
.pipe(
|
|
337
|
+
tap((res: any) => {
|
|
338
|
+
if (res && res.code === 200) {
|
|
339
|
+
this.storeList = res.data.storesData;
|
|
340
|
+
this.eyeTestForm.get("storeList")?.setValue(this.storeList);
|
|
341
|
+
this.loading1 =false;
|
|
342
|
+
} else {
|
|
343
|
+
this.storeList = [];
|
|
344
|
+
this.loading1 =false;
|
|
345
|
+
}
|
|
346
|
+
}),
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
typeChange(event: any) {
|
|
351
|
+
this.eyeTestForm.get("Type")?.setValue(event);
|
|
352
|
+
this.router.navigate(["/manage/trax/audit"], {
|
|
353
|
+
queryParams: {
|
|
354
|
+
fromDate: this.dayjs(
|
|
355
|
+
this.selectedDateRange.startDate,
|
|
356
|
+
"DD-MM-YYYY"
|
|
357
|
+
).format("YYYY-MM-DD"),
|
|
358
|
+
toDate: this.dayjs(this.selectedDateRange.endDate, "DD-MM-YYYY").format(
|
|
359
|
+
"YYYY-MM-DD"
|
|
360
|
+
),
|
|
361
|
+
typeValue: event,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
this.cd.detectChanges();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
dateTypeChange(event: any) {
|
|
368
|
+
this.eyeTestForm.get("dateType")?.setValue(event);
|
|
369
|
+
if(event === "auditedDate"){
|
|
370
|
+
this.eyeTestForm.get("auditStatus")?.setValue([...this.auditedDateAuditStatus]);
|
|
371
|
+
}else{
|
|
372
|
+
this.eyeTestForm.get("auditStatus")?.setValue([...this.auditStatusArray]);
|
|
373
|
+
}
|
|
374
|
+
this.cd.detectChanges();
|
|
375
|
+
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
auditTypeChange(event: any) {
|
|
379
|
+
this.eyeTestForm.get("auditType")?.setValue(event);
|
|
380
|
+
this.cd.detectChanges();
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
typePercentageChange(event: any) {
|
|
384
|
+
this.eyeTestForm.get("complianceScore")?.setValue(event);
|
|
385
|
+
this.cd.detectChanges();
|
|
386
|
+
}
|
|
387
|
+
typeAuditStatusChange(event: any) {
|
|
388
|
+
console.log("...............typeauditChages", event)
|
|
389
|
+
this.eyeTestForm.get("auditStatus")?.setValue(event);
|
|
390
|
+
this.cd.detectChanges();
|
|
391
|
+
}
|
|
392
|
+
nearAdditionChange(event: any) {
|
|
393
|
+
this.eyeTestForm.get("nearAddition")?.setValue(event);
|
|
394
|
+
this.cd.detectChanges();
|
|
395
|
+
}
|
|
396
|
+
categoryTypeChange(event: any) {
|
|
397
|
+
this.eyeTestForm.get("category")?.setValue(event);
|
|
398
|
+
this.cd.detectChanges();
|
|
399
|
+
}
|
|
400
|
+
datechange(event: any) {
|
|
401
|
+
if (event && event.startDate && event.endDate) {
|
|
402
|
+
if (
|
|
403
|
+
this.dayjs(event.startDate).isValid() &&
|
|
404
|
+
this.dayjs(event.endDate).isValid()
|
|
405
|
+
) {
|
|
406
|
+
this.selectedDateRange.startDate = this.dayjs(
|
|
407
|
+
event.startDate,
|
|
408
|
+
"DD-MM-YYYY"
|
|
409
|
+
).format("YYYY-MM-DD");
|
|
410
|
+
this.selectedDateRange.endDate = this.dayjs(
|
|
411
|
+
event.endDate,
|
|
412
|
+
"DD-MM-YYYY"
|
|
413
|
+
).format("YYYY-MM-DD");
|
|
414
|
+
|
|
415
|
+
this.eyeTestForm
|
|
416
|
+
.get("fromDate")
|
|
417
|
+
?.setValue(this.selectedDateRange.startDate);
|
|
418
|
+
if (
|
|
419
|
+
this.selectedDateRange.startDate &&
|
|
420
|
+
this.dayjs(this.selectedDateRange.startDate).isValid()
|
|
421
|
+
) {
|
|
422
|
+
this.headDate = this.dayjs(this.selectedDateRange.startDate).format(
|
|
423
|
+
"MMM, DD"
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
this.eyeTestForm
|
|
427
|
+
.get("toDate")
|
|
428
|
+
?.setValue(this.selectedDateRange.endDate);
|
|
429
|
+
if (
|
|
430
|
+
this.selectedDateRange.endDate &&
|
|
431
|
+
this.dayjs(this.selectedDateRange.endDate).isValid()
|
|
432
|
+
) {
|
|
433
|
+
this.headDateEnd = this.dayjs(this.selectedDateRange.endDate).format(
|
|
434
|
+
"MMM DD, YYYY"
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
this.router.navigate(["/manage/trax/audit"], {
|
|
438
|
+
queryParams: {
|
|
439
|
+
fromDate: this.selectedDateRange.startDate,
|
|
440
|
+
toDate: this.selectedDateRange.endDate,
|
|
441
|
+
typeValue: this.typeValue,
|
|
442
|
+
},
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
onStartDateChange(event: any) {
|
|
449
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
450
|
+
this.isCustomDate = (m: dayjs.Dayjs) => {
|
|
451
|
+
const isValidDate =
|
|
452
|
+
m > this.dayjs() || m > this.dayjs(event.startDate.add(60, "days"));
|
|
453
|
+
return isValidDate ? "invalid-date" : false;
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
resetValidation() {
|
|
459
|
+
this.isCustomDate = (m: dayjs.Dayjs) => {
|
|
460
|
+
// Check if the given date is before yesterday
|
|
461
|
+
return m.isAfter(this.dayjs(), "day") ? "invalid-date" : false;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
selectedType: any;
|
|
466
|
+
createForm() {
|
|
467
|
+
const isRemote = this.selectedType === "physical"; // or however you're determining it
|
|
468
|
+
|
|
469
|
+
this.eyeTestForm = this.fb.group({
|
|
470
|
+
fromDate: [
|
|
471
|
+
this.selectedDateRange?.startDate
|
|
472
|
+
? this.dayjs(this.selectedDateRange.startDate, "DD-MM-YYYY").format("YYYY-MM-DD")
|
|
473
|
+
: this.dayjs().subtract(1, "day").format("YYYY-MM-DD"),
|
|
474
|
+
],
|
|
475
|
+
toDate: [
|
|
476
|
+
this.selectedDateRange?.endDate
|
|
477
|
+
? this.dayjs(this.selectedDateRange.endDate, "DD-MM-YYYY").format("YYYY-MM-DD")
|
|
478
|
+
: this.dayjs().subtract(1, "day").format("YYYY-MM-DD"),
|
|
479
|
+
],
|
|
480
|
+
type: this.typeValue,
|
|
481
|
+
dateType: "fileDate",
|
|
482
|
+
complianceScore: [this.typePercentageArray],
|
|
483
|
+
...(isRemote ? {} : { category: ["genuine"] }),
|
|
484
|
+
nearAddition: [""],
|
|
485
|
+
auditStatus: [this.auditStatusArray],
|
|
486
|
+
ClusterList: [this.groups],
|
|
487
|
+
storeList: [this.stores],
|
|
488
|
+
RmList: [this.RmList],
|
|
489
|
+
...(isRemote ? {} : { auditType: "all" }), // Conditionally add auditType
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
ongroupSelect(event: any) {
|
|
494
|
+
// this.loading1 = true;
|
|
495
|
+
this.eyeTestForm.get("ClusterList")?.setValue(event);
|
|
496
|
+
this.groups = event.map((el: any) => el.clusterName);
|
|
497
|
+
this.traxService
|
|
498
|
+
.getStoreslist({
|
|
499
|
+
clientId: this.headerFilters.client,
|
|
500
|
+
clusters: this.groups,
|
|
501
|
+
city: [],
|
|
502
|
+
})
|
|
503
|
+
.subscribe({
|
|
504
|
+
next: (res: any) => {
|
|
505
|
+
if (res && res.code == 200) {
|
|
506
|
+
this.storeList = res.data.storesData;
|
|
507
|
+
this.eyeTestForm.get("storeList")?.setValue(this.storeList);
|
|
508
|
+
this.loading1 = false;
|
|
509
|
+
this.onSubmit();
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
error: (err) => {
|
|
513
|
+
this.storeList = [];
|
|
514
|
+
this.loading1 = false;
|
|
515
|
+
this.onSubmit();
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
this.cd.detectChanges();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
onStoreSelect(event: any) {
|
|
522
|
+
this.eyeTestForm.get("storeList")?.setValue(event);
|
|
523
|
+
this.cd.detectChanges();
|
|
524
|
+
}
|
|
525
|
+
searchValue: any = "";
|
|
526
|
+
searchData() {
|
|
527
|
+
this.searchValue = this.searchValue;
|
|
528
|
+
this.onSubmit();
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
paginationSizes: any[] = [];
|
|
532
|
+
pageSize = 10;
|
|
533
|
+
setPaginationSizes() {
|
|
534
|
+
if (this.totalItems > 10) {
|
|
535
|
+
this.paginationSizes = [10, 20, 30];
|
|
536
|
+
} else {
|
|
537
|
+
this.paginationSizes = [this.totalItems]; // Just one option if 10
|
|
538
|
+
}
|
|
539
|
+
this.pageSize = this.paginationSizes[0];
|
|
540
|
+
}
|
|
541
|
+
RmListData: any = [];
|
|
542
|
+
keyType: any;
|
|
543
|
+
rmEmail: any;
|
|
544
|
+
|
|
545
|
+
// Tango AI
|
|
546
|
+
eyeTestChatQuery = '';
|
|
547
|
+
eyeTestAiMessage: string | null = null;
|
|
548
|
+
showEyeTestAiMessage = false;
|
|
549
|
+
|
|
550
|
+
// Model switcher
|
|
551
|
+
readonly modelOptions = [
|
|
552
|
+
{ label: 'v1', value: 'gemini-2.5-pro' },
|
|
553
|
+
{ label: 'v2', value: 'claude-sonnet-4-6' }
|
|
554
|
+
];
|
|
555
|
+
selectedModel = 'claude-sonnet-4-6';
|
|
556
|
+
showPlusMenu = false;
|
|
557
|
+
|
|
558
|
+
get selectedModelVersion(): string {
|
|
559
|
+
const match = this.selectedModel.match(/(\d+\.\d+)/);
|
|
560
|
+
return match ? match[1] : '';
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
selectModel(value: string): void { this.selectedModel = value; }
|
|
564
|
+
togglePlusMenu(): void { this.showPlusMenu = !this.showPlusMenu; }
|
|
565
|
+
closePlusMenu(): void { this.showPlusMenu = false; }
|
|
566
|
+
|
|
567
|
+
@HostListener('document:click', ['$event'])
|
|
568
|
+
onDocumentClick(e: MouseEvent): void {
|
|
569
|
+
if (!(e.target as HTMLElement).closest('.plus-menu-wrap')) {
|
|
570
|
+
this.showPlusMenu = false;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
// typeVal(val: any, obj?: any) {
|
|
574
|
+
// this.loading = true;
|
|
575
|
+
// this.searchValue = "";
|
|
576
|
+
// this.limit = 10;
|
|
577
|
+
// this.offset = 1;
|
|
578
|
+
// this.pageSize = 10;
|
|
579
|
+
// this.keyType = val;
|
|
580
|
+
// this.rmEmail = obj?.RMEmail ? obj?.RMEmail : obj;
|
|
581
|
+
// // 🔍 find the RM object in your RmList array
|
|
582
|
+
// if (this.users?.role === "superadmin" && this.RmList?.length) {
|
|
583
|
+
// this.RmList?.forEach((element: any) => {
|
|
584
|
+
// if (element?.email === this.rmEmail) {
|
|
585
|
+
// this.eyeTestForm.get("RmList")?.setValue([element]);
|
|
586
|
+
// this.onRmSelect([element]);
|
|
587
|
+
// }
|
|
588
|
+
// });
|
|
589
|
+
// }
|
|
590
|
+
// this.groups = obj?.clusterName ? [obj?.clusterName] : this.groups;
|
|
591
|
+
// if (
|
|
592
|
+
// this.users?.role === "admin" &&
|
|
593
|
+
// this.ClusterList?.length &&
|
|
594
|
+
// obj?.clusterName
|
|
595
|
+
// ) {
|
|
596
|
+
// this.ClusterList.forEach((element: any) => {
|
|
597
|
+
// if (element?.clusterName === this.groups) {
|
|
598
|
+
// this.eyeTestForm.get("ClusterList")?.setValue([element]);
|
|
599
|
+
// this.ongroupSelect([element]);
|
|
600
|
+
// }
|
|
601
|
+
// });
|
|
602
|
+
// }
|
|
603
|
+
// this.sortedColumn = "date";
|
|
604
|
+
// if (this.rmEmail === "") this.onSubmit();
|
|
605
|
+
// }
|
|
606
|
+
demoGrapics:any;
|
|
607
|
+
typeVal(val: any, obj?: any) {
|
|
608
|
+
// console.log(val, obj);
|
|
609
|
+
this.typePercentageArray =[];
|
|
610
|
+
this.loading = true;
|
|
611
|
+
this.searchValue = "";
|
|
612
|
+
this.limit = 10;
|
|
613
|
+
this.offset = 1;
|
|
614
|
+
this.pageSize = 10;
|
|
615
|
+
this.keyType = val;
|
|
616
|
+
this.showEyeTestAiMessage = false;
|
|
617
|
+
this.eyeTestAiMessage = null;
|
|
618
|
+
this.eyeTestChatQuery = '';
|
|
619
|
+
this.initAiSession();
|
|
620
|
+
this.sortedColumn = "date";
|
|
621
|
+
this.demoGrapics = this.eyeTestForm.value.auditType;
|
|
622
|
+
if (this.demoGrapics === "all") {
|
|
623
|
+
this.demoGrapics = ["adult", "kids"];
|
|
624
|
+
}
|
|
625
|
+
if (this.users?.role === "superadmin" && this.RmList?.length)
|
|
626
|
+
this.rmEmail = obj?.RMEmail ? obj?.RMEmail : obj;
|
|
627
|
+
|
|
628
|
+
this.groups = obj?.clusterName ? [obj?.clusterName] : this.groups;
|
|
629
|
+
|
|
630
|
+
let foundRM = false;
|
|
631
|
+
let foundCluster = false;
|
|
632
|
+
if(val !=="store"){
|
|
633
|
+
this.typePercentageArray = [
|
|
634
|
+
{ label: "0–10%", value: "0-10" },
|
|
635
|
+
{ label: "10–20%", value: "10-20" },
|
|
636
|
+
{ label: "20–30%", value: "20-30" },
|
|
637
|
+
{ label: "30–40%", value: "30-40" },
|
|
638
|
+
{ label: "40–50%", value: "40-50"},
|
|
639
|
+
{ label: "50–60%", value: "50-60" },
|
|
640
|
+
{ label: "60–70%", value: "60-70" },
|
|
641
|
+
{ label: "70–80%", value: "70-80" },
|
|
642
|
+
{ label: "80–90%", value: "80-90" },
|
|
643
|
+
{ label: "90–100%", value: "90-100" },
|
|
644
|
+
];
|
|
645
|
+
} else {
|
|
646
|
+
this.typePercentageArray = [
|
|
647
|
+
{ label: "0%", value: "0" },
|
|
648
|
+
{ label: "17%", value: "16" },
|
|
649
|
+
{ label: "33%", value: "33" },
|
|
650
|
+
{ label: "50%", value: "50" },
|
|
651
|
+
{ label: "67%", value: "66" },
|
|
652
|
+
{ label: "83%", value: "83" },
|
|
653
|
+
{ label: "100%", value: "100" },
|
|
654
|
+
];
|
|
655
|
+
}
|
|
656
|
+
this.eyeTestForm.get("complianceScore")?.setValue(this.typePercentageArray);
|
|
657
|
+
if((this.users?.role === "superadmin" || this.users?.role === "admin") && val ==="store" &&
|
|
658
|
+
this.ClusterList?.length &&
|
|
659
|
+
obj?.clusterName
|
|
660
|
+
) {
|
|
661
|
+
this.ClusterList.forEach(
|
|
662
|
+
(element: any) =>
|
|
663
|
+
{
|
|
664
|
+
if(element?.clusterName === obj.clusterName){
|
|
665
|
+
this.eyeTestForm.get("ClusterList")?.setValue([element]);
|
|
666
|
+
this.ongroupSelect([element]);
|
|
667
|
+
this.loading1 = true;
|
|
668
|
+
foundCluster = true;
|
|
669
|
+
}
|
|
670
|
+
})
|
|
671
|
+
} else if((this.users?.role === "superadmin" || this.users?.role === "admin") && val ==="cluster" &&
|
|
672
|
+
this.ClusterList?.length &&
|
|
673
|
+
obj?.clusterName
|
|
674
|
+
) {
|
|
675
|
+
this.ClusterList.forEach(
|
|
676
|
+
(element: any) =>
|
|
677
|
+
{
|
|
678
|
+
if(element?.clusterName === obj.clusterName){
|
|
679
|
+
this.eyeTestForm.get("ClusterList")?.setValue([element]);
|
|
680
|
+
this.ongroupSelect([element]);
|
|
681
|
+
this.loading1 = true;
|
|
682
|
+
foundCluster = true;
|
|
683
|
+
}
|
|
684
|
+
})
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// ✅ RM selection (only for superadmin)
|
|
688
|
+
if (this.users?.role === "superadmin" && val ==="cluster" && this.RmList?.length) {
|
|
689
|
+
this.RmList.forEach(
|
|
690
|
+
(element: any) => {
|
|
691
|
+
if(element?.email === this.rmEmail) {
|
|
692
|
+
this.eyeTestForm.get("RmList")?.setValue([element]);
|
|
693
|
+
this.onRmSelect([element]);
|
|
694
|
+
this.loading1 = true;
|
|
695
|
+
foundRM = true;
|
|
696
|
+
}
|
|
697
|
+
})
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// ✅ Cluster selection (only for admin)
|
|
701
|
+
|
|
702
|
+
// ✅ Submit fallback
|
|
703
|
+
if (!foundRM && !foundCluster) {
|
|
704
|
+
this.getAllStores();
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
this.onSubmit();
|
|
708
|
+
|
|
709
|
+
this.cd.detectChanges();
|
|
710
|
+
}
|
|
711
|
+
typeVal1(val: any, obj?: any) {
|
|
712
|
+
this.loading = true;
|
|
713
|
+
this.searchValue = "";
|
|
714
|
+
this.limit = 10;
|
|
715
|
+
this.offset = 1;
|
|
716
|
+
this.pageSize = 10;
|
|
717
|
+
this.keyType = val;
|
|
718
|
+
this.showEyeTestAiMessage = false;
|
|
719
|
+
this.eyeTestAiMessage = null;
|
|
720
|
+
this.eyeTestChatQuery = '';
|
|
721
|
+
this.initAiSession();
|
|
722
|
+
this.sortedColumn = "date";
|
|
723
|
+
if(val !=="store"){
|
|
724
|
+
this.typePercentageArray = [
|
|
725
|
+
{ label: "0–10%", value: "0-10" },
|
|
726
|
+
{ label: "10–20%", value: "10-20" },
|
|
727
|
+
{ label: "20–30%", value: "20-30" },
|
|
728
|
+
{ label: "30–40%", value: "30-40" },
|
|
729
|
+
{ label: "40–50%", value: "40-50"},
|
|
730
|
+
{ label: "50–60%", value: "50-60" },
|
|
731
|
+
{ label: "60–70%", value: "60-70" },
|
|
732
|
+
{ label: "70–80%", value: "70-80" },
|
|
733
|
+
{ label: "80–90%", value: "80-90" },
|
|
734
|
+
{ label: "90–100%", value: "90-100" },
|
|
735
|
+
];
|
|
736
|
+
} else {
|
|
737
|
+
this.typePercentageArray = [
|
|
738
|
+
{ label: "0%", value: "0" },
|
|
739
|
+
{ label: "17%", value: "16" },
|
|
740
|
+
{ label: "33%", value: "33" },
|
|
741
|
+
{ label: "50%", value: "50" },
|
|
742
|
+
{ label: "67%", value: "66" },
|
|
743
|
+
{ label: "83%", value: "83" },
|
|
744
|
+
{ label: "100%", value: "100" },
|
|
745
|
+
];
|
|
746
|
+
}
|
|
747
|
+
this.eyeTestForm.get("complianceScore")?.setValue(this.typePercentageArray);
|
|
748
|
+
if (this.users?.role === "superadmin" && this.RmList?.length) {
|
|
749
|
+
this.rmEmail = obj?.RMEmail ? obj?.RMEmail : obj;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// this.groups = obj?.clusterName ? [obj?.clusterName] : this.groups;
|
|
753
|
+
|
|
754
|
+
this.demoGrapics = this.eyeTestForm.value.auditType;
|
|
755
|
+
if (this.demoGrapics === "all") {
|
|
756
|
+
this.demoGrapics = ["adult", "kids"];
|
|
757
|
+
}
|
|
758
|
+
this.eyeTestData = [];
|
|
759
|
+
let foundRM = false;
|
|
760
|
+
let foundCluster = false;
|
|
761
|
+
|
|
762
|
+
// ✅ Cluster / Store
|
|
763
|
+
if ((this.users?.role === "superadmin" || this.users?.role === "admin") &&
|
|
764
|
+
(val === "store" || val === "cluster")) {
|
|
765
|
+
this.getAllGroups();
|
|
766
|
+
this.loading1 = true;
|
|
767
|
+
foundCluster = true;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// ✅ RM (only for superadmin)
|
|
771
|
+
if (this.users?.role === "superadmin" && val === "rm") {
|
|
772
|
+
this.onRmSelect(this.rmList);
|
|
773
|
+
this.loading1 = true;
|
|
774
|
+
foundRM = true;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// ✅ Fallback
|
|
778
|
+
if (!foundRM && !foundCluster) {
|
|
779
|
+
this.getAllStores();
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
this.onSubmit();
|
|
783
|
+
this.loading1 =false;
|
|
784
|
+
this.cd.detectChanges();
|
|
785
|
+
}
|
|
786
|
+
// private resetAllClusters() {
|
|
787
|
+
// if (this.ClusterList?.length) {
|
|
788
|
+
// this.eyeTestForm.get("ClusterList")?.setValue(this.ClusterList);
|
|
789
|
+
// this.ongroupSelect(this.ClusterList);
|
|
790
|
+
// } else {
|
|
791
|
+
// this.eyeTestForm.get("ClusterList")?.setValue([]);
|
|
792
|
+
// }
|
|
793
|
+
// this.getAllGroups();
|
|
794
|
+
// }
|
|
795
|
+
|
|
796
|
+
// private resetAllRms() {
|
|
797
|
+
// if (this.RmList?.length) {
|
|
798
|
+
// this.eyeTestForm.get("RmList")?.setValue(this.RmList);
|
|
799
|
+
// this.onRmSelect(this.RmList);
|
|
800
|
+
// } else {
|
|
801
|
+
// this.eyeTestForm.get("RmList")?.setValue([]);
|
|
802
|
+
// }
|
|
803
|
+
// this.getAllRm();
|
|
804
|
+
// }
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
buildRequestData(params?: {
|
|
808
|
+
isExport?: boolean;
|
|
809
|
+
limit?: number;
|
|
810
|
+
offset?: number;
|
|
811
|
+
}): any {
|
|
812
|
+
// Map role → keyType
|
|
813
|
+
const roleKeyTypeMap: any = {
|
|
814
|
+
superadmin: "rm",
|
|
815
|
+
admin: "cluster",
|
|
816
|
+
user: "store",
|
|
817
|
+
};
|
|
818
|
+
if (!this.keyType) {
|
|
819
|
+
this.keyType = roleKeyTypeMap[this.users?.role] || "store";
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// Collect store IDs
|
|
823
|
+
const finalStores = Array.isArray(this.eyeTestForm.value.storeList)
|
|
824
|
+
? this.eyeTestForm.value.storeList.map((store: any) => store.storeId)
|
|
825
|
+
: [];
|
|
826
|
+
|
|
827
|
+
// Collect RM emails
|
|
828
|
+
let finalRMList: string[] = [];
|
|
829
|
+
if (Array.isArray(this.eyeTestForm.value.RmList) && this.eyeTestForm.value.RmList.length) {
|
|
830
|
+
finalRMList = this.eyeTestForm.value.RmList.map((el: any) => el?.email);
|
|
831
|
+
} else if (this.rmEmail) {
|
|
832
|
+
finalRMList = [this.rmEmail];
|
|
833
|
+
} else if (this.users?.email) {
|
|
834
|
+
finalRMList = [this.users.email];
|
|
835
|
+
}
|
|
836
|
+
this.RmListData = finalRMList?.length ? finalRMList?.length : [];
|
|
837
|
+
// Handle auditType → normalize to array
|
|
838
|
+
const auditTypeValue = this.eyeTestForm.value.auditType;
|
|
839
|
+
let auditTypes: string[] = [];
|
|
840
|
+
if (auditTypeValue === "all") {
|
|
841
|
+
auditTypes = ["adult", "kids"];
|
|
842
|
+
} else if (Array.isArray(auditTypeValue)) {
|
|
843
|
+
auditTypes = auditTypeValue;
|
|
844
|
+
} else if (auditTypeValue) {
|
|
845
|
+
auditTypes = [auditTypeValue];
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
return {
|
|
849
|
+
clientId: this.headerFilters?.client,
|
|
850
|
+
fromDate: this.eyeTestForm.value.fromDate,
|
|
851
|
+
toDate: this.eyeTestForm.value.toDate,
|
|
852
|
+
type: this.eyeTestForm.value.type,
|
|
853
|
+
dateType: this.eyeTestForm.value.dateType,
|
|
854
|
+
|
|
855
|
+
// demographics only if type !== remote
|
|
856
|
+
...(this.eyeTestForm.value.type !== "remote" && { demographics: auditTypes }),
|
|
857
|
+
|
|
858
|
+
cluster: this.groups,
|
|
859
|
+
storeId: finalStores,
|
|
860
|
+
|
|
861
|
+
limit: params?.limit ?? this.limit ?? 10,
|
|
862
|
+
offset: params?.offset ?? this.offset ?? 1,
|
|
863
|
+
keyType: this.keyType,
|
|
864
|
+
|
|
865
|
+
complianceScore: this.eyeTestForm.value.complianceScore?.length ? (this.eyeTestForm.value.complianceScore.map((el: any) => el.value)): [],
|
|
866
|
+
|
|
867
|
+
auditStatus: this.eyeTestForm.value.auditStatus?.length
|
|
868
|
+
? this.eyeTestForm.value.auditStatus.map((el: any) => el.value)
|
|
869
|
+
: [],
|
|
870
|
+
nearAddition: this.eyeTestForm.value.nearAddition || "",
|
|
871
|
+
|
|
872
|
+
...(this.eyeTestForm.value.type !== "remote" && {
|
|
873
|
+
category: this.eyeTestForm.value.category,
|
|
874
|
+
}),
|
|
875
|
+
|
|
876
|
+
RMList: finalRMList,
|
|
877
|
+
searchValue: this.searchValue || "",
|
|
878
|
+
isExport: params?.isExport ?? false,
|
|
879
|
+
sortOrder: this.sortOrder ?? -1,
|
|
880
|
+
sortBy: this.sortedColumn ?? "date",
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
exportXLSX() {
|
|
887
|
+
const requestData = this.buildRequestData({
|
|
888
|
+
isExport: true,
|
|
889
|
+
limit: 10000,
|
|
890
|
+
offset: 1,
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
this.eyeService
|
|
894
|
+
.getEyeTestTableExport(requestData)
|
|
895
|
+
.pipe(takeUntil(this.destroy$))
|
|
896
|
+
.subscribe({
|
|
897
|
+
next: (res: any) => {
|
|
898
|
+
this.eyeService.saveAsExcelFile(
|
|
899
|
+
res,
|
|
900
|
+
`${this.eyeTestForm.value.type} Eye Test Table `
|
|
901
|
+
);
|
|
902
|
+
this.cd.detectChanges();
|
|
903
|
+
},
|
|
904
|
+
error: (err: any) => {
|
|
905
|
+
this.ts.getErrorToast(
|
|
906
|
+
err?.error?.error ? err?.error?.error : err?.error?.message
|
|
907
|
+
);
|
|
908
|
+
},
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
totalItems: any = 0;
|
|
913
|
+
offset = 1;
|
|
914
|
+
limit = 10;
|
|
915
|
+
dataResult:any;
|
|
916
|
+
onSubmit() {
|
|
917
|
+
|
|
918
|
+
this.eyeTestData=[];
|
|
919
|
+
this.typeValue = this.eyeTestForm?.value?.type;
|
|
920
|
+
this.loading = true;
|
|
921
|
+
this.noData = false;
|
|
922
|
+
setTimeout(()=>{
|
|
923
|
+
const requestData = this.buildRequestData({ isExport: false });
|
|
924
|
+
this.dataResult = requestData
|
|
925
|
+
this.eyeService
|
|
926
|
+
.getEyeTestlist(requestData)
|
|
927
|
+
.pipe(takeUntil(this.destroy$),distinctUntilChanged())
|
|
928
|
+
.subscribe({
|
|
929
|
+
next: (res: any) => {
|
|
930
|
+
if (res && res.code === 200) {
|
|
931
|
+
this.eyeTestData = res?.data.result;
|
|
932
|
+
this.totalItems = res.data?.count;
|
|
933
|
+
this.setPaginationSizes();
|
|
934
|
+
this.getCardData();
|
|
935
|
+
this.loading = false;
|
|
936
|
+
this.noData = false;
|
|
937
|
+
} else {
|
|
938
|
+
this.getCardData();
|
|
939
|
+
this.eyeTestData = [];
|
|
940
|
+
this.loading = false;
|
|
941
|
+
this.noData = true;
|
|
942
|
+
this.totalItems = 0;
|
|
943
|
+
}
|
|
944
|
+
this.cd.detectChanges();
|
|
945
|
+
},
|
|
946
|
+
error: () => {
|
|
947
|
+
this.loading = false;
|
|
948
|
+
this.noData = true;
|
|
949
|
+
this.cd.detectChanges();
|
|
950
|
+
},
|
|
951
|
+
});
|
|
952
|
+
},1000)
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
onPageChange(pageOffset: number) {
|
|
956
|
+
// this.limit = 10;
|
|
957
|
+
// this.pageSize = 10;
|
|
958
|
+
this.loading = true;
|
|
959
|
+
this.noData = false;
|
|
960
|
+
this.offset = Number(pageOffset);
|
|
961
|
+
|
|
962
|
+
const requestData = this.buildRequestData({
|
|
963
|
+
isExport: false,
|
|
964
|
+
limit: this.limit,
|
|
965
|
+
offset: this.offset,
|
|
966
|
+
});
|
|
967
|
+
// console.log(requestData)
|
|
968
|
+
// return
|
|
969
|
+
this.eyeService
|
|
970
|
+
.getEyeTestlist(requestData)
|
|
971
|
+
.pipe(takeUntil(this.destroy$))
|
|
972
|
+
.subscribe({
|
|
973
|
+
next: (res: any) => {
|
|
974
|
+
if (res && res.code === 200) {
|
|
975
|
+
this.eyeTestData = res?.data.result;
|
|
976
|
+
this.totalItems = res.data?.count;
|
|
977
|
+
this.loading = false;
|
|
978
|
+
this.noData = false;
|
|
979
|
+
} else {
|
|
980
|
+
this.eyeTestData = [];
|
|
981
|
+
this.loading = false;
|
|
982
|
+
this.noData = true;
|
|
983
|
+
this.totalItems = 0;
|
|
984
|
+
}
|
|
985
|
+
this.cd.detectChanges();
|
|
986
|
+
},
|
|
987
|
+
error: () => {
|
|
988
|
+
this.eyeTestData = [];
|
|
989
|
+
this.totalItems = 0;
|
|
990
|
+
this.loading = false;
|
|
991
|
+
this.noData = true;
|
|
992
|
+
},
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
onPageSizeChange(pageSize: number) {
|
|
997
|
+
this.offset = 1;
|
|
998
|
+
this.loading = true;
|
|
999
|
+
this.noData = false;
|
|
1000
|
+
this.pageSize = Number(pageSize);
|
|
1001
|
+
this.limit = Number(pageSize);
|
|
1002
|
+
|
|
1003
|
+
const requestData = this.buildRequestData({
|
|
1004
|
+
isExport: false,
|
|
1005
|
+
limit: this.limit,
|
|
1006
|
+
offset: this.offset,
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
this.eyeService
|
|
1010
|
+
.getEyeTestlist(requestData)
|
|
1011
|
+
.pipe(takeUntil(this.destroy$))
|
|
1012
|
+
.subscribe({
|
|
1013
|
+
next: (res: any) => {
|
|
1014
|
+
if (res && res.code === 200) {
|
|
1015
|
+
this.eyeTestData = res?.data.result;
|
|
1016
|
+
this.totalItems = res.data?.count;
|
|
1017
|
+
this.loading = false;
|
|
1018
|
+
this.noData = false;
|
|
1019
|
+
} else {
|
|
1020
|
+
this.eyeTestData = [];
|
|
1021
|
+
this.loading = false;
|
|
1022
|
+
this.noData = true;
|
|
1023
|
+
this.totalItems = 0;
|
|
1024
|
+
}
|
|
1025
|
+
this.cd.detectChanges();
|
|
1026
|
+
},
|
|
1027
|
+
error: () => {
|
|
1028
|
+
this.eyeTestData = [];
|
|
1029
|
+
this.totalItems = 0;
|
|
1030
|
+
this.loading = false;
|
|
1031
|
+
this.noData = true;
|
|
1032
|
+
},
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
sortedColumn: any;
|
|
1037
|
+
sortOrder: any;
|
|
1038
|
+
onSort(column: string) {
|
|
1039
|
+
if (this.sortedColumn === column) {
|
|
1040
|
+
this.sortOrder = this.sortOrder === 1 ? -1 : 1;
|
|
1041
|
+
} else {
|
|
1042
|
+
this.sortedColumn = column ? column : "storeName";
|
|
1043
|
+
this.sortOrder = 1;
|
|
1044
|
+
}
|
|
1045
|
+
this.onSubmit();
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
// new api intagrated
|
|
1049
|
+
|
|
1050
|
+
RmList: any = [];
|
|
1051
|
+
|
|
1052
|
+
getAllRm1(): Observable<any> {
|
|
1053
|
+
return this.eyeService.getRmList(this.headerFilters?.client).pipe(
|
|
1054
|
+
tap((res: any) => {
|
|
1055
|
+
if (res && res.code === 200) {
|
|
1056
|
+
this.RmList = this.rmList;
|
|
1057
|
+
this.eyeTestForm.get("RmList")?.setValue(this.RmList);
|
|
1058
|
+
} else {
|
|
1059
|
+
this.RmList = [];
|
|
1060
|
+
this.eyeTestForm.get("RmList")?.setValue([]);
|
|
1061
|
+
}
|
|
1062
|
+
})
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
onRmSelect(event: any) {
|
|
1067
|
+
this.eyeTestForm.get("RmList")?.setValue(event);
|
|
1068
|
+
this.getAllGroups(event);
|
|
1069
|
+
this.cd.detectChanges();
|
|
1070
|
+
}
|
|
1071
|
+
eyeTestCardData: any = [];
|
|
1072
|
+
getCardData() {
|
|
1073
|
+
let finalStores: any = [];
|
|
1074
|
+
let rmListValue: any = [];
|
|
1075
|
+
const roleKeyTypeMap: any = {
|
|
1076
|
+
superadmin: "rm",
|
|
1077
|
+
admin: "cluster",
|
|
1078
|
+
user: "store",
|
|
1079
|
+
};
|
|
1080
|
+
if (!this.keyType) {
|
|
1081
|
+
this.keyType = roleKeyTypeMap[this.users?.role] || "store";
|
|
1082
|
+
}
|
|
1083
|
+
const {
|
|
1084
|
+
fromDate,
|
|
1085
|
+
toDate,
|
|
1086
|
+
type,
|
|
1087
|
+
dateType,
|
|
1088
|
+
auditType,
|
|
1089
|
+
storeList,
|
|
1090
|
+
RmList,
|
|
1091
|
+
complianceScore,
|
|
1092
|
+
nearAddition,
|
|
1093
|
+
keyType,
|
|
1094
|
+
category,
|
|
1095
|
+
} = this.eyeTestForm.value;
|
|
1096
|
+
if (Array.isArray(this.eyeTestForm.value.storeList)) {
|
|
1097
|
+
this.eyeTestForm.value.storeList.forEach((store: any) => {
|
|
1098
|
+
finalStores.push(store.storeId);
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
if (Array.isArray(this.eyeTestForm.value.RmList)) {
|
|
1102
|
+
this.eyeTestForm.value.RmList.forEach((el: any) => {
|
|
1103
|
+
rmListValue.push(el?.email);
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
const demographics =
|
|
1107
|
+
type !== "remote"
|
|
1108
|
+
? auditType === "all"
|
|
1109
|
+
? ["adult", "kids"]
|
|
1110
|
+
: Array.isArray(auditType)
|
|
1111
|
+
? auditType
|
|
1112
|
+
: [auditType]
|
|
1113
|
+
: undefined;
|
|
1114
|
+
|
|
1115
|
+
const requestData: any = {
|
|
1116
|
+
fromDate,
|
|
1117
|
+
toDate,
|
|
1118
|
+
type,
|
|
1119
|
+
dateType,
|
|
1120
|
+
storeId: finalStores,
|
|
1121
|
+
RMList: rmListValue.length > 0 ? rmListValue : [this.users?.email],
|
|
1122
|
+
complianceScore: complianceScore?.length
|
|
1123
|
+
? (complianceScore.map((el: any) => el.value))
|
|
1124
|
+
: [],
|
|
1125
|
+
nearAddition,
|
|
1126
|
+
keyType : this.keyType,
|
|
1127
|
+
...(this.eyeTestForm.value.type !== "remote" && {
|
|
1128
|
+
category,
|
|
1129
|
+
}),
|
|
1130
|
+
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
if (demographics) {
|
|
1134
|
+
requestData.demographics = demographics;
|
|
1135
|
+
}
|
|
1136
|
+
this.eyeService
|
|
1137
|
+
.getCard(requestData)
|
|
1138
|
+
.pipe(takeUntil(this.destroy$))
|
|
1139
|
+
.subscribe({
|
|
1140
|
+
next: (res: any) => {
|
|
1141
|
+
this.eyeTestCardData = res?.code === 200 ? res?.data?.result : {};
|
|
1142
|
+
this.cd.detectChanges();
|
|
1143
|
+
},
|
|
1144
|
+
error: () => {
|
|
1145
|
+
this.eyeTestCardData = {};
|
|
1146
|
+
this.cd.detectChanges();
|
|
1147
|
+
},
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
eyeView = false;
|
|
1151
|
+
selectedStepIndex = 0;
|
|
1152
|
+
conversationData: any = null;
|
|
1153
|
+
// Conv audio player state
|
|
1154
|
+
convIsPlaying = false;
|
|
1155
|
+
convCurrentTime = '0:00';
|
|
1156
|
+
convDuration = '0:00';
|
|
1157
|
+
convProgress = 0;
|
|
1158
|
+
convIsMuted = false;
|
|
1159
|
+
readonly waveformHeights: number[] = [
|
|
1160
|
+
8, 22, 38, 52, 44, 28, 56, 42, 18, 32, 54, 46, 24, 40, 60, 50, 26, 44,
|
|
1161
|
+
36, 18, 52, 38, 28, 46, 34, 20, 56, 42, 14, 36, 50, 30, 22, 44, 56, 38,
|
|
1162
|
+
20, 46, 30, 16, 50, 36, 24, 54, 42, 28, 36, 20, 46, 32, 18, 40, 56, 44,
|
|
1163
|
+
24, 36, 20, 50, 34, 22
|
|
1164
|
+
];
|
|
1165
|
+
eyeTestView(data: any) {
|
|
1166
|
+
this.eyeView =true;
|
|
1167
|
+
|
|
1168
|
+
this.setPageData();
|
|
1169
|
+
this.auditData = this.eyeService.getAuditData();
|
|
1170
|
+
this.takeAudit =false
|
|
1171
|
+
this.stepWiseProcess =[];
|
|
1172
|
+
// this.route.queryParams.subscribe(params => {
|
|
1173
|
+
this.storeId = data['storeId'];
|
|
1174
|
+
this.currentAuditType = this.eyeTestForm.value.type
|
|
1175
|
+
this.AuditId = data['_id'];
|
|
1176
|
+
this.RmEmail = data['RMEmail'];
|
|
1177
|
+
this.cluster = data['clusterName'];
|
|
1178
|
+
this.eyeTestType = data?.comment ? "fake" : "genuine";
|
|
1179
|
+
// });
|
|
1180
|
+
this.getAuditdetails();
|
|
1181
|
+
this.generateTimeOptions();
|
|
1182
|
+
if(this.currentAuditType === 'remote'){
|
|
1183
|
+
this.dropdownList= [{ key: 'Sentence Transcription okay, but not matching with Predicted Step', item: 'Sentence Transcription okay, but not matching with Predicted Step' }, { key: 'Sentence Transcription not accurate, but matching with Predicted Step', item: 'Sentence Transcription not accurate, but matching with Predicted Step' }, { key: 'Step not accurate, not matching with Predicted Step', item: 'Step not accurate, not matching with Predicted Step' }, { key: 'others', item: 'Others' }]
|
|
1184
|
+
}else{
|
|
1185
|
+
this.dropdownList= [{ key: 'Step Non-Compliance', item: 'Step Non-Compliance' }, { key: 'Power Bank Non-Compliance', item: 'Power Bank Non-Compliance' }, { key: 'Correct Instrument Not Used', item: 'Correct Instrument Not Used' }, { key: 'others', item: 'Others' }]
|
|
1186
|
+
}
|
|
1187
|
+
this.conversationData = null;
|
|
1188
|
+
this.selectedStepIndex = 0;
|
|
1189
|
+
this.convIsPlaying = false;
|
|
1190
|
+
this.convCurrentTime = '0:00';
|
|
1191
|
+
this.convDuration = '0:00';
|
|
1192
|
+
this.convProgress = 0;
|
|
1193
|
+
this.convIsMuted = false;
|
|
1194
|
+
this.eyeService.getConversationDetails(data.queueId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1195
|
+
next: (res: any) => {
|
|
1196
|
+
if (res?.code === 200) {
|
|
1197
|
+
this.conversationData = res.data.result;
|
|
1198
|
+
// Use API-provided duration immediately (S3 m4a often can't report duration until fully buffered)
|
|
1199
|
+
if (this.conversationData?.duration) {
|
|
1200
|
+
this.convDuration = this.conversationData.duration;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
error: () => { this.conversationData = null; }
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
settingsView() {
|
|
1209
|
+
this.eyeService.setAuditData(this.headerFilters);
|
|
1210
|
+
this.router.navigate(["/manage/trax/audit/settings"], {
|
|
1211
|
+
queryParams: { type: this.eyeTestForm.value.type },
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
rmList = [
|
|
1215
|
+
{
|
|
1216
|
+
_id: "1",
|
|
1217
|
+
userName: "Anirban Ghosh",
|
|
1218
|
+
email: "anirban.ghosh@lenskart.com",
|
|
1219
|
+
role: "admin",
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
_id: "2",
|
|
1223
|
+
userName: "Avadhesh Sharma",
|
|
1224
|
+
email: "avadhesh.kumar@lenskart.com",
|
|
1225
|
+
role: "admin",
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
_id: "3",
|
|
1229
|
+
userName: "Ayush Gupta",
|
|
1230
|
+
email: "ayush.gupta1@lenskart.in",
|
|
1231
|
+
role: "admin",
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
_id: "4",
|
|
1235
|
+
userName: "Reshma Shetty",
|
|
1236
|
+
email: "reshma.shetty@lenskart.in",
|
|
1237
|
+
role: "admin",
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
_id: "5",
|
|
1241
|
+
userName: "Srinivas Reddy",
|
|
1242
|
+
email: "srinivas.reddy@thelenskart.com",
|
|
1243
|
+
role: "admin",
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
_id: "6",
|
|
1247
|
+
userName: "Suresh Balaji R",
|
|
1248
|
+
email: "suresh.r@thelenskart.com",
|
|
1249
|
+
role: "admin",
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
_id: "7",
|
|
1253
|
+
userName: "Thulasi Krishna",
|
|
1254
|
+
email: "krishna.thulasi@lenskart.in",
|
|
1255
|
+
role: "admin",
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
_id: "8",
|
|
1259
|
+
userName: "Kunal Sharma",
|
|
1260
|
+
email: "kunal.sharma@lenskart.mobi",
|
|
1261
|
+
role: "admin",
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
_id: "9",
|
|
1265
|
+
userName: "Nikhil T S",
|
|
1266
|
+
email: "nikhil.ts2@lenskart.com",
|
|
1267
|
+
role: "admin",
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
_id: "10",
|
|
1271
|
+
userName: "Mukul",
|
|
1272
|
+
email: "Mukul.upadhyay@lenskart.in",
|
|
1273
|
+
role: "admin",
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
_id: "11",
|
|
1277
|
+
userName: "Anand Singh",
|
|
1278
|
+
email: "anand.singh2@lenskart.com",
|
|
1279
|
+
role: "admin",
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
_id: "12",
|
|
1283
|
+
userName: "Sudhir Kumar",
|
|
1284
|
+
email: "sudhir.kumar2@lenskart.in",
|
|
1285
|
+
role: "admin",
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
_id: "13",
|
|
1289
|
+
userName: "Aniket Patole",
|
|
1290
|
+
email: "aniket.patole@lenskart.in",
|
|
1291
|
+
role: "admin",
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
_id: "14",
|
|
1295
|
+
userName: "Sachin",
|
|
1296
|
+
email: "sachin.kumar4@lenskart.in",
|
|
1297
|
+
role: "admin",
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
_id: "15",
|
|
1301
|
+
userName: "Sandeep Kumar",
|
|
1302
|
+
email: "sandeepkumar@thelenskart.com",
|
|
1303
|
+
role: "admin",
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
_id: "16",
|
|
1307
|
+
userName: "Rajesh Yadav",
|
|
1308
|
+
email: "rajesh.yadav2@lenskart.com",
|
|
1309
|
+
role: "admin",
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
_id: "17",
|
|
1313
|
+
userName: "Punjab-TBD",
|
|
1314
|
+
email: "sandeep.kumar@thelenskart.com",
|
|
1315
|
+
role: "admin",
|
|
1316
|
+
},
|
|
1317
|
+
];
|
|
1318
|
+
|
|
1319
|
+
getAllStores() {
|
|
1320
|
+
this.traxService.getStoreslist({ clientId: this.headerFilters?.client, clusters: this.groups, city: [], }) .pipe(takeUntil(this.destroy$)) .subscribe({ next: (res: any) => { if (res && res?.code == 200) { this.storeList = res.data.storesData; this.eyeTestForm.get("storeList")?.setValue(this.storeList); this.loading1 = false; } else { this.storeList = []; this.loading1 = false; } }, error: (err) => { this.storeList = []; this.loading1 = false; }, }); }
|
|
1321
|
+
getAllRm() {
|
|
1322
|
+
// this.eyeService.getRmList(this.headerFilters?.client) .pipe(takeUntil(this.destroy$)) .subscribe({
|
|
1323
|
+
// next: (res: any) => { if (res && res?.code == 200) {
|
|
1324
|
+
this.RmList = this.rmList; //for object based this will changed
|
|
1325
|
+
this.eyeTestForm.get("RmList")?.setValue(this.rmList);
|
|
1326
|
+
// } else {
|
|
1327
|
+
// this.RmList = []; this.eyeTestForm.get("RmList")?.setValue([]);
|
|
1328
|
+
// } this.getAllGroups(); }, });
|
|
1329
|
+
}
|
|
1330
|
+
getAllGroups(event?: any) { let rmList: any = []; this.ClusterList = []; if (Array.isArray(this.eyeTestForm.value.RmList)) { this.eyeTestForm.value.RmList.forEach((el: any) => { rmList.push(el?.email); }); } event?.map((el: any) => el?.email) || [this.users?.email]; const obj = { clientId: this.headerFilters?.client ? this.headerFilters.client : "", rmList: rmList.length > 0 ? rmList : [this.users?.email], }; this.eyeService.getClusters(obj).subscribe({ next: (res: any) => { if (res && res.code === 200) { this.ClusterList = res?.data?.result; this.eyeTestForm.get("ClusterList")?.setValue(this.ClusterList); this.groups = this.ClusterList.map((el: any) => el.clusterName); this.getAllStores(); } else { this.ClusterList = []; this.loading1 = false; } this.cd.detectChanges(); },
|
|
1331
|
+
error: (err) => { // console.error("Cluster fetch failed:", err);
|
|
1332
|
+
this.ClusterList = []; this.loading1 = false; }, }); }
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
// second page
|
|
1336
|
+
stepWiseProcess: any = [];
|
|
1337
|
+
dropdownList: any = []
|
|
1338
|
+
// loading: boolean = true;
|
|
1339
|
+
// noData: boolean = false;
|
|
1340
|
+
|
|
1341
|
+
tableLoading = new BehaviorSubject<'initial' | 'loading' | 'loaded'>('initial')
|
|
1342
|
+
historytableLoading = new BehaviorSubject<'initial' | 'loading' | 'loaded'>('initial')
|
|
1343
|
+
|
|
1344
|
+
selectedMinutes = '00';
|
|
1345
|
+
selectedSeconds = '00';
|
|
1346
|
+
minutesList: string[] = [];
|
|
1347
|
+
secondsList: string[] = [];
|
|
1348
|
+
|
|
1349
|
+
auditDetails: any = [];
|
|
1350
|
+
currentAuditType: any;
|
|
1351
|
+
takeAudit: boolean = false;
|
|
1352
|
+
storeId: any;
|
|
1353
|
+
@ViewChild('tooltipContent') tooltipContent!: NgbTooltip;
|
|
1354
|
+
@ViewChild('viewHistory') viewHistory: any;
|
|
1355
|
+
@ViewChild('viewCancel') viewCancel: any;
|
|
1356
|
+
@ViewChild('videoPlayer', { static: false }) videoPlayer!: ElementRef;
|
|
1357
|
+
historyData: any = [];
|
|
1358
|
+
AuditId: any;
|
|
1359
|
+
viewHistoryData: any;
|
|
1360
|
+
spokenLanguage:any='English'
|
|
1361
|
+
modalRef: any;
|
|
1362
|
+
disablecancel:boolean = false
|
|
1363
|
+
backNavigation(){
|
|
1364
|
+
// this.eyeService.auditFilterData = {
|
|
1365
|
+
// back: 'back',
|
|
1366
|
+
// auditDetails: this.auditDetails
|
|
1367
|
+
// };
|
|
1368
|
+
// this.router.navigate(['/manage/trax/audit'], {
|
|
1369
|
+
// queryParams: { date: this.dayjs(this.auditDetails.fileDate).format('YYYY-MM-DD'), typeValue: this.currentAuditType }
|
|
1370
|
+
// });
|
|
1371
|
+
this.eyeView =false;
|
|
1372
|
+
this.takeAudit =false
|
|
1373
|
+
this.stepWiseProcess =[];
|
|
1374
|
+
this.onSubmit();
|
|
1375
|
+
this.getCardData();
|
|
1376
|
+
}
|
|
1377
|
+
viewHistoryModel(item: any) {
|
|
1378
|
+
let payload = {
|
|
1379
|
+
id: item._id
|
|
1380
|
+
}
|
|
1381
|
+
this.eyeService.viewAuditHistory(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1382
|
+
next: (res: any) => {
|
|
1383
|
+
if (res && res?.code == 200) {
|
|
1384
|
+
this.viewHistoryData = res.data.result
|
|
1385
|
+
const modalRef = this.modalService.open(this.viewHistory, {
|
|
1386
|
+
size:'xl',
|
|
1387
|
+
centered: true,
|
|
1388
|
+
scrollable: true,
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
})
|
|
1393
|
+
}
|
|
1394
|
+
auditData:any;
|
|
1395
|
+
eyeTestType:any;
|
|
1396
|
+
RmEmail:any;
|
|
1397
|
+
cluster:any;
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
// ngOnInit(): void {
|
|
1402
|
+
|
|
1403
|
+
// }
|
|
1404
|
+
|
|
1405
|
+
setPageData() {
|
|
1406
|
+
this.pageInfo.setTitle('Eye Test')
|
|
1407
|
+
|
|
1408
|
+
this.pageInfo.setBreadcrumbs([
|
|
1409
|
+
{ title: 'Tango Trax', path: '/manage/trax/dashboard', isActive: false, isSeparator: false },
|
|
1410
|
+
{ title: 'Tango Trax', path: '/manage/trax/dashboard', isActive: false, isSeparator: true },
|
|
1411
|
+
])
|
|
1412
|
+
}
|
|
1413
|
+
getAuditHistory() {
|
|
1414
|
+
this.historytableLoading.next('loading');
|
|
1415
|
+
let payload = {
|
|
1416
|
+
id: this.currentAuditType === 'remote' ? this.auditDetails.engagementId : this.auditDetails.queueId,
|
|
1417
|
+
type: this.currentAuditType
|
|
1418
|
+
}
|
|
1419
|
+
this.eyeService.getAuditHistory(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1420
|
+
next: (res: any) => {
|
|
1421
|
+
if (res && res?.code == 200) {
|
|
1422
|
+
this.historyData = res.data.result
|
|
1423
|
+
this.historytableLoading.next('loaded')
|
|
1424
|
+
} else {
|
|
1425
|
+
this.historyData = []
|
|
1426
|
+
this.historytableLoading.next('loaded')
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
error: (err: any) => {
|
|
1430
|
+
this.historyData = []
|
|
1431
|
+
this.historytableLoading.next('loaded')
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
)
|
|
1435
|
+
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
getAuditdetails() {
|
|
1439
|
+
this.tableLoading.next('loading');
|
|
1440
|
+
let payload = {
|
|
1441
|
+
id: this.AuditId,
|
|
1442
|
+
type: this.currentAuditType
|
|
1443
|
+
}
|
|
1444
|
+
this.eyeService.getAuditdetails(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1445
|
+
next: (res: any) => {
|
|
1446
|
+
if (res && res?.code == 200) {
|
|
1447
|
+
this.disablecancel = false
|
|
1448
|
+
this.auditDetails = res?.data?.result;
|
|
1449
|
+
if (this.auditDetails.auditStatus === 'In-Progress') {
|
|
1450
|
+
this.takeAudit = true
|
|
1451
|
+
}else{
|
|
1452
|
+
this.takeAudit = false
|
|
1453
|
+
}
|
|
1454
|
+
this.stepWiseProcess = this.auditDetails?.steps;
|
|
1455
|
+
setTimeout(()=>{
|
|
1456
|
+
this.getAuditHistory()
|
|
1457
|
+
},100)
|
|
1458
|
+
this.cd.detectChanges();
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
})
|
|
1462
|
+
|
|
1463
|
+
this.tableLoading.next('loaded')
|
|
1464
|
+
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
generateTimeOptions() {
|
|
1468
|
+
this.minutesList = Array.from({ length: 60 }, (_, i) => this.formatNumber(i));
|
|
1469
|
+
this.secondsList = Array.from({ length: 60 }, (_, i) => this.formatNumber(i));
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
formatNumber(num: number): string {
|
|
1473
|
+
return num < 10 ? '0' + num : num.toString();
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
dropdownOpen: { [key: number]: { startTime: boolean; endTime: boolean; reason: boolean } } = {};
|
|
1477
|
+
|
|
1478
|
+
toggleDropdown(i: number, time: 'startTime' | 'endTime' | 'reason') {
|
|
1479
|
+
const currentState = this.dropdownOpen[i]?.[time] ?? false;
|
|
1480
|
+
|
|
1481
|
+
Object.keys(this.dropdownOpen).forEach((key) => {
|
|
1482
|
+
this.dropdownOpen[Number(key)] = { startTime: false, endTime: false, reason: false };
|
|
1483
|
+
});
|
|
1484
|
+
|
|
1485
|
+
if (!this.dropdownOpen[i]) {
|
|
1486
|
+
this.dropdownOpen[i] = { startTime: false, endTime: false, reason: false };
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
this.dropdownOpen[i][time] = !currentState;
|
|
1490
|
+
}
|
|
1491
|
+
getSecondsFromTime(time: string): number {
|
|
1492
|
+
if (!time) return 0;
|
|
1493
|
+
const [min, sec] = time.split(':').map(Number);
|
|
1494
|
+
return (min * 60) + sec;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
selectMinute(index: any, min: string, time: 'startTime' | 'endTime' | 'reason') {
|
|
1498
|
+
const previousTime = this.stepWiseProcess[index]?.[time] || '00:00';
|
|
1499
|
+
|
|
1500
|
+
this.selectedMinutes = min;
|
|
1501
|
+
const newTime = `${this.selectedMinutes}:${this.selectedSeconds}`;
|
|
1502
|
+
|
|
1503
|
+
const startTime = this.getSecondsFromTime(
|
|
1504
|
+
time === 'startTime' ? newTime : this.stepWiseProcess[index]?.startTime
|
|
1505
|
+
);
|
|
1506
|
+
const endTime = this.getSecondsFromTime(
|
|
1507
|
+
time === 'endTime' ? newTime : this.stepWiseProcess[index]?.endTime
|
|
1508
|
+
);
|
|
1509
|
+
|
|
1510
|
+
const isValid = (startTime === 0 || endTime === 0) || startTime < endTime;
|
|
1511
|
+
|
|
1512
|
+
if (!isValid && time !== 'reason') {
|
|
1513
|
+
this.ts.getWarningToast("Start time must be less than end time.");
|
|
1514
|
+
|
|
1515
|
+
const [prevMin, prevSec] = previousTime.split(':');
|
|
1516
|
+
this.selectedMinutes = prevMin;
|
|
1517
|
+
this.selectedSeconds = prevSec;
|
|
1518
|
+
|
|
1519
|
+
this.cd.detectChanges();
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
this.stepWiseProcess[index][time] = newTime;
|
|
1525
|
+
this.cd.detectChanges();
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
selectSecond(index: any, sec: string, time: 'startTime' | 'endTime' | 'reason') {
|
|
1529
|
+
const previousTime = this.stepWiseProcess[index]?.[time] || '00:00';
|
|
1530
|
+
|
|
1531
|
+
this.selectedSeconds = sec;
|
|
1532
|
+
const newTime = `${this.selectedMinutes}:${this.selectedSeconds}`;
|
|
1533
|
+
|
|
1534
|
+
const startTime = this.getSecondsFromTime(
|
|
1535
|
+
time === 'startTime' ? newTime : this.stepWiseProcess[index]?.startTime
|
|
1536
|
+
);
|
|
1537
|
+
const endTime = this.getSecondsFromTime(
|
|
1538
|
+
time === 'endTime' ? newTime : this.stepWiseProcess[index]?.endTime
|
|
1539
|
+
);
|
|
1540
|
+
|
|
1541
|
+
if ((time !== 'reason') && startTime !== 0 && endTime !== 0 && startTime >= endTime) {
|
|
1542
|
+
this.ts.getWarningToast("Start time must be less than end time.");
|
|
1543
|
+
|
|
1544
|
+
const [prevMin, prevSec] = previousTime.split(':');
|
|
1545
|
+
this.selectedMinutes = prevMin;
|
|
1546
|
+
this.selectedSeconds = prevSec;
|
|
1547
|
+
|
|
1548
|
+
this.cd.detectChanges();
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
this.stepWiseProcess[index][time] = newTime;
|
|
1553
|
+
this.cd.detectChanges();
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
selectReason(index: number, key: any, time: any) {
|
|
1559
|
+
this.stepWiseProcess[index][time] = key;
|
|
1560
|
+
|
|
1561
|
+
if (key === 'others') {
|
|
1562
|
+
this.stepWiseProcess[index].otherReason = '';
|
|
1563
|
+
} else {
|
|
1564
|
+
this.stepWiseProcess[index].otherReason = null;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
this.cd.detectChanges();
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
selectHumanVerified(index: number, value: boolean) {
|
|
1572
|
+
this.stepWiseProcess[index].auditedStatus = value;
|
|
1573
|
+
}
|
|
1574
|
+
findcount(){
|
|
1575
|
+
let count = 0
|
|
1576
|
+
this.stepWiseProcess.forEach((data:any)=>{
|
|
1577
|
+
if(data.auditedStatus!==data.AIStatus){
|
|
1578
|
+
count++
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
})
|
|
1583
|
+
return count
|
|
1584
|
+
}
|
|
1585
|
+
getValidaForm(){
|
|
1586
|
+
let errorCount = 0
|
|
1587
|
+
this.stepWiseProcess.forEach((data:any)=>{
|
|
1588
|
+
if(data.reason==='others'){
|
|
1589
|
+
data.otherReason = data.otherReason.trim()
|
|
1590
|
+
}
|
|
1591
|
+
if(data.auditedStatus!==data.AIStatus){
|
|
1592
|
+
if(!data.reason || data.reason&&data.reason==='others' && !data.otherReason){
|
|
1593
|
+
errorCount++
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
})
|
|
1597
|
+
if(errorCount>0){
|
|
1598
|
+
this.disablecancel = false
|
|
1599
|
+
this.ts.getWarningToast("Comments are mandatory for inverse human audited responses")
|
|
1600
|
+
}
|
|
1601
|
+
return errorCount
|
|
1602
|
+
}
|
|
1603
|
+
onsubmit(isReSend?:boolean) {
|
|
1604
|
+
this.disablecancel = true
|
|
1605
|
+
// if((this.stepWiseProcess.filter((data:any)=>data.auditedStatus===true).length+this.stepWiseProcess.filter((data:any)=>data.auditedStatus===false).length)!==this.stepWiseProcess.length){
|
|
1606
|
+
// this.toastService.getErrorToast("Oops! Looks like the eye test audit isn’t complete yet. Audit all eye test steps before submitting.")
|
|
1607
|
+
// this.disablecancel = false
|
|
1608
|
+
// return
|
|
1609
|
+
// }
|
|
1610
|
+
// if(this.getValidaForm()===0){
|
|
1611
|
+
|
|
1612
|
+
let payload = {
|
|
1613
|
+
id: this.AuditId,
|
|
1614
|
+
type: this.currentAuditType,
|
|
1615
|
+
fileId: this.currentAuditType === 'remote' ? this.auditDetails.engagementId : this.auditDetails.queueId,
|
|
1616
|
+
auditedSteps: this.stepWiseProcess.filter((data:any)=>data.auditedStatus===true).length,
|
|
1617
|
+
auditStatus:this.auditDetails?.auditType === 'Audit'? "Audited":"Re-Audited",
|
|
1618
|
+
overRides:this.findcount(),
|
|
1619
|
+
spokenLanguage: this.spokenLanguage,
|
|
1620
|
+
steps: this.stepWiseProcess,
|
|
1621
|
+
cluster: this.cluster,
|
|
1622
|
+
RMEmail: this.RmEmail,
|
|
1623
|
+
clientId: this.auditDetails?.storeId?.split("-")[0],
|
|
1624
|
+
...(typeof isReSend != 'undefined' && {isReSend:isReSend})
|
|
1625
|
+
}
|
|
1626
|
+
this.eyeService.submitAudit(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1627
|
+
next: (res: any) => {
|
|
1628
|
+
if (res && res?.code == 200) {
|
|
1629
|
+
console.log(res);
|
|
1630
|
+
|
|
1631
|
+
if(res?.message == "Do you want resend mail?") {
|
|
1632
|
+
const dialogRef = this.modalService.open(SendAlertComponent,{centered:true,size:'md'});
|
|
1633
|
+
dialogRef.componentInstance.message = res.message;
|
|
1634
|
+
dialogRef.result.then((result)=>{
|
|
1635
|
+
this.onsubmit(result);
|
|
1636
|
+
})
|
|
1637
|
+
}
|
|
1638
|
+
else {
|
|
1639
|
+
setTimeout(()=>{
|
|
1640
|
+
this.getAuditdetails();
|
|
1641
|
+
},1000)
|
|
1642
|
+
this.ts.getSuccessToast(`${this.auditDetails?.auditType} Submitted Successfully`)
|
|
1643
|
+
|
|
1644
|
+
}
|
|
1645
|
+
// this.disablecancel = false
|
|
1646
|
+
}
|
|
1647
|
+
},
|
|
1648
|
+
error: (err: any) => {
|
|
1649
|
+
this.ts.getErrorToast(err?.error?.error ? err?.error?.error : err?.error?.message)
|
|
1650
|
+
}
|
|
1651
|
+
})
|
|
1652
|
+
// }
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
}
|
|
1656
|
+
startAudit(value: any) {
|
|
1657
|
+
this.disablecancel = true
|
|
1658
|
+
this.takeAudit = true;
|
|
1659
|
+
this.auditDetails.auditStatus = 'Re-Audited'
|
|
1660
|
+
let payload = {
|
|
1661
|
+
id: this.AuditId
|
|
1662
|
+
}
|
|
1663
|
+
this.eyeService.getAuditFile(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1664
|
+
next: (res: any) => {
|
|
1665
|
+
if (res && res?.code == 200) {
|
|
1666
|
+
|
|
1667
|
+
this.getAuditdetails();
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
error: (err: any) => {
|
|
1671
|
+
this.ts.getErrorToast(err?.error?.error ? err?.error?.error : err?.error?.message)
|
|
1672
|
+
}
|
|
1673
|
+
})
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
onYes(){
|
|
1679
|
+
let payload = {
|
|
1680
|
+
id: this.AuditId,
|
|
1681
|
+
type: this.currentAuditType,
|
|
1682
|
+
fileId: this.currentAuditType === 'remote' ? this.auditDetails.engagementId : this.auditDetails.queueId,
|
|
1683
|
+
}
|
|
1684
|
+
this.eyeService.cancelAuditFile(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1685
|
+
next: (res: any) => {
|
|
1686
|
+
if (res && res?.code == 200) {
|
|
1687
|
+
this.getAuditdetails();
|
|
1688
|
+
this.ts.getSuccessToast(`${this.auditDetails?.auditType} Cancelled Successfully`)
|
|
1689
|
+
this.modalRef.dismiss();
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
error: (err: any) => {
|
|
1693
|
+
this.ts.getErrorToast(err?.error?.error ? err?.error?.error : err?.error?.message)
|
|
1694
|
+
this.modalRef.dismiss();
|
|
1695
|
+
}
|
|
1696
|
+
})
|
|
1697
|
+
|
|
1698
|
+
this.takeAudit =false
|
|
1699
|
+
}
|
|
1700
|
+
cancel(){
|
|
1701
|
+
this.modalRef = this.modalService.open(this.viewCancel, {
|
|
1702
|
+
size:'md',
|
|
1703
|
+
centered: true,
|
|
1704
|
+
scrollable: true,
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
OnCancel(){
|
|
1708
|
+
this.modalRef.dismiss();
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
onEyeTestAiSearch(): void {
|
|
1712
|
+
if (!this.eyeTestChatQuery.trim()) return;
|
|
1713
|
+
if (!this.aiSessionId) this.initAiSession();
|
|
1714
|
+
|
|
1715
|
+
this.showEyeTestAiMessage = true;
|
|
1716
|
+
this.eyeTestAiMessage = null;
|
|
1717
|
+
|
|
1718
|
+
const stores: string[] = Array.isArray(this.eyeTestForm.value.storeList)
|
|
1719
|
+
? this.eyeTestForm.value.storeList.map((s: any) => s.storeName)
|
|
1720
|
+
: [];
|
|
1721
|
+
|
|
1722
|
+
const startDate = this.selectedDateRange?.startDate
|
|
1723
|
+
? this.dayjs(this.selectedDateRange.startDate, 'DD-MM-YYYY').format('YYYY-MM-DD')
|
|
1724
|
+
: '';
|
|
1725
|
+
const endDate = this.selectedDateRange?.endDate
|
|
1726
|
+
? this.dayjs(this.selectedDateRange.endDate, 'DD-MM-YYYY').format('YYYY-MM-DD')
|
|
1727
|
+
: '';
|
|
1728
|
+
|
|
1729
|
+
const payload = {
|
|
1730
|
+
user_id: this.users?._id || '',
|
|
1731
|
+
session_id: this.aiSessionId,
|
|
1732
|
+
session_date: new Date().toISOString().slice(0, 10),
|
|
1733
|
+
session_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
1734
|
+
message: this.eyeTestChatQuery,
|
|
1735
|
+
analyticsType: 'eyetest',
|
|
1736
|
+
config: {
|
|
1737
|
+
selected_stores: stores,
|
|
1738
|
+
date_range: { start: startDate, end: endDate },
|
|
1739
|
+
selected_products: [],
|
|
1740
|
+
selected_model: this.selectedModel
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
this.eyeService.chatStream(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1745
|
+
next: (text: string) => { this.eyeTestAiMessage = text; },
|
|
1746
|
+
error: () => { this.eyeTestAiMessage = 'Unable to get AI response. Please try again.'; }
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
private getConvAudio(): HTMLAudioElement | null {
|
|
1751
|
+
return document.querySelector('#conv-audio') as HTMLAudioElement;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
toggleConvPlay(): void {
|
|
1755
|
+
const audio = this.getConvAudio();
|
|
1756
|
+
if (!audio) return;
|
|
1757
|
+
if (this.convIsPlaying) {
|
|
1758
|
+
audio.pause();
|
|
1759
|
+
this.convIsPlaying = false;
|
|
1760
|
+
} else {
|
|
1761
|
+
audio.play();
|
|
1762
|
+
this.convIsPlaying = true;
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
onConvTimeUpdate(): void {
|
|
1767
|
+
const audio = this.getConvAudio();
|
|
1768
|
+
if (!audio) return;
|
|
1769
|
+
this.convCurrentTime = this.formatConvTime(audio.currentTime);
|
|
1770
|
+
if (audio.duration && isFinite(audio.duration)) {
|
|
1771
|
+
this.convProgress = audio.currentTime / audio.duration;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
onConvLoaded(): void {
|
|
1776
|
+
const audio = this.getConvAudio();
|
|
1777
|
+
if (!audio) return;
|
|
1778
|
+
// Only use audio.duration if it's a valid finite number; otherwise keep API-provided duration
|
|
1779
|
+
if (audio.duration && isFinite(audio.duration)) {
|
|
1780
|
+
this.convDuration = this.formatConvTime(audio.duration);
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
formatConvTime(seconds: number): string {
|
|
1785
|
+
if (!seconds || isNaN(seconds)) return '0:00';
|
|
1786
|
+
const m = Math.floor(seconds / 60);
|
|
1787
|
+
const s = Math.floor(seconds % 60);
|
|
1788
|
+
return `${m}:${s < 10 ? '0' + s : s}`;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
seekConvAudio(event: MouseEvent): void {
|
|
1792
|
+
const audio = this.getConvAudio();
|
|
1793
|
+
if (!audio || !audio.duration) return;
|
|
1794
|
+
const track = event.currentTarget as HTMLElement;
|
|
1795
|
+
const ratio = event.offsetX / track.offsetWidth;
|
|
1796
|
+
audio.currentTime = ratio * audio.duration;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
toggleConvMute(): void {
|
|
1800
|
+
const audio = this.getConvAudio();
|
|
1801
|
+
if (!audio) return;
|
|
1802
|
+
this.convIsMuted = !this.convIsMuted;
|
|
1803
|
+
audio.muted = this.convIsMuted;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
playFromStep(step: any): void {
|
|
1807
|
+
const audio = this.getConvAudio();
|
|
1808
|
+
if (!audio || !step?.startTime) return;
|
|
1809
|
+
const parts = String(step.startTime).split(':').map(Number);
|
|
1810
|
+
let seconds = 0;
|
|
1811
|
+
if (parts.length === 3) {
|
|
1812
|
+
seconds = parts[0] * 3600 + parts[1] * 60 + parts[2];
|
|
1813
|
+
} else if (parts.length === 2) {
|
|
1814
|
+
seconds = parts[0] * 60 + parts[1];
|
|
1815
|
+
}
|
|
1816
|
+
audio.currentTime = seconds;
|
|
1817
|
+
audio.play();
|
|
1818
|
+
this.convIsPlaying = true;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
// ── AI Assistant ──────────────────────────────────────────
|
|
1822
|
+
parseAiMarkdown(text: string): SafeHtml {
|
|
1823
|
+
if (!text) return this.sanitizer.bypassSecurityTrustHtml('');
|
|
1824
|
+
let html = text
|
|
1825
|
+
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
1826
|
+
.replace(/^### (.+)$/gm, '<h5>$1</h5>')
|
|
1827
|
+
.replace(/^## (.+)$/gm, '<h4>$1</h4>')
|
|
1828
|
+
.replace(/^# (.+)$/gm, '<h3>$1</h3>')
|
|
1829
|
+
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
|
|
1830
|
+
.replace(/__(.+?)__/g, '<strong>$1</strong>')
|
|
1831
|
+
.replace(/\*(.+?)\*/g, '<em>$1</em>')
|
|
1832
|
+
.replace(/_(.+?)_/g, '<em>$1</em>')
|
|
1833
|
+
.replace(/^\s*[-*] (.+)$/gm, '<li>$1</li>')
|
|
1834
|
+
.replace(/^\s*\d+\. (.+)$/gm, '<li>$1</li>')
|
|
1835
|
+
.replace(/(<li>.*<\/li>)/gs, '<ul>$1</ul>')
|
|
1836
|
+
.replace(/\n{2,}/g, '</p><p>')
|
|
1837
|
+
.replace(/\n/g, '<br>');
|
|
1838
|
+
html = `<p>${html}</p>`;
|
|
1839
|
+
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
aiChatQuery = '';
|
|
1843
|
+
aiResponseText = '';
|
|
1844
|
+
isAiLoading = false;
|
|
1845
|
+
private aiSessionId = '';
|
|
1846
|
+
|
|
1847
|
+
private initAiSession(): void {
|
|
1848
|
+
this.aiSessionId = `EYETEST_${Date.now()}`;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
sendChatMessage(): void {
|
|
1852
|
+
if (!this.aiChatQuery.trim() || this.isAiLoading) return;
|
|
1853
|
+
if (!this.aiSessionId) this.initAiSession();
|
|
1854
|
+
|
|
1855
|
+
const stores: string[] = Array.isArray(this.eyeTestForm.value.storeList)
|
|
1856
|
+
? this.eyeTestForm.value.storeList.map((s: any) => s.storeId)
|
|
1857
|
+
: [];
|
|
1858
|
+
|
|
1859
|
+
const startDate = this.selectedDateRange?.startDate
|
|
1860
|
+
? this.dayjs(this.selectedDateRange.startDate, 'DD-MM-YYYY').format('YYYY-MM-DD')
|
|
1861
|
+
: '';
|
|
1862
|
+
const endDate = this.selectedDateRange?.endDate
|
|
1863
|
+
? this.dayjs(this.selectedDateRange.endDate, 'DD-MM-YYYY').format('YYYY-MM-DD')
|
|
1864
|
+
: '';
|
|
1865
|
+
|
|
1866
|
+
const payload = {
|
|
1867
|
+
user_id: this.users?._id || '',
|
|
1868
|
+
session_id: this.aiSessionId,
|
|
1869
|
+
session_date: new Date().toISOString().slice(0, 10),
|
|
1870
|
+
session_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
1871
|
+
message: this.aiChatQuery,
|
|
1872
|
+
analyticsType: 'eyetest',
|
|
1873
|
+
config: {
|
|
1874
|
+
selected_stores: stores,
|
|
1875
|
+
date_range: { start: startDate, end: endDate },
|
|
1876
|
+
selected_products: ['EyeTest'],
|
|
1877
|
+
selected_model: this.selectedModel
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
this.isAiLoading = true;
|
|
1882
|
+
this.aiResponseText = '';
|
|
1883
|
+
this.eyeService.chatStream(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1884
|
+
next: (text: string) => { this.aiResponseText = text; },
|
|
1885
|
+
error: () => { this.isAiLoading = false; },
|
|
1886
|
+
complete: () => { this.isAiLoading = false; }
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
}
|