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,611 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component, ElementRef, HostListener, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
import { GlobalStateService } from 'tango-app-ui-global';
|
|
4
|
+
import { TraxService } from '../../services/trax.service';
|
|
5
|
+
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
6
|
+
import { Router } from '@angular/router';
|
|
7
|
+
import { Answer, AnswerForm, AnswerType, HeaderFilter, ITask, Question, QuestionForm, Section, SectionForm, TaskForm, ValidationType } from './create-task.interface';
|
|
8
|
+
import { date_question_template, descriptive_question_template, descriptiveImage_question_template, image_question_template, linearscale_question_template, multiplechoice_answer_template, multiplechoicemultiple_question_template, multiplechoicesingle_question_template, multipleImage_question_template, time_question_template, video_question_template, yesorno_question_template, image_video_question_template, dropdown_question_template } from './create-task.data';
|
|
9
|
+
import { Subject, debounceTime, distinctUntilChanged, filter, takeUntil } from "rxjs";
|
|
10
|
+
import { ToastService } from 'tango-app-ui-shared';
|
|
11
|
+
import dayjs from "dayjs";
|
|
12
|
+
import utc from 'dayjs/plugin/utc';
|
|
13
|
+
import { noWhitespaceValidator } from './whitespace-validator';
|
|
14
|
+
import { uniqueStringValidator } from './unique-string-validator';
|
|
15
|
+
import { TimePeriod } from 'ngx-daterangepicker-material/daterangepicker.component';
|
|
16
|
+
import { rangeValidator } from './ascending-validator';
|
|
17
|
+
|
|
18
|
+
dayjs.extend(utc);
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'lib-add-multitask',
|
|
22
|
+
templateUrl: './add-multitask.component.html',
|
|
23
|
+
styleUrl: './add-multitask.component.scss'
|
|
24
|
+
})
|
|
25
|
+
export class AddMultitaskComponent implements OnDestroy, OnInit {
|
|
26
|
+
taskForm: FormGroup<TaskForm>;
|
|
27
|
+
@Input() type: any
|
|
28
|
+
@Input() sourceCheckList_id: any
|
|
29
|
+
@Input() filtertype: any
|
|
30
|
+
@Input() showcomment: any
|
|
31
|
+
@Input() excelData: any
|
|
32
|
+
currentIndex: number = 0;
|
|
33
|
+
intervalId: any;
|
|
34
|
+
allowedStoreLocation: boolean = false
|
|
35
|
+
restrictAttendance: boolean = false
|
|
36
|
+
submitted: boolean = false
|
|
37
|
+
headerData: HeaderFilter | null | undefined;
|
|
38
|
+
selectedlistselectControl: FormControl;
|
|
39
|
+
answerTypes: { label: string, value: AnswerType }[] = [
|
|
40
|
+
{ label: 'Descriptive Answer', value: 'descriptive' },
|
|
41
|
+
{ label: 'A/B Question', value: 'yes/no' },
|
|
42
|
+
{ label: 'Multiple Choice Question - Single Answer', value: 'multiplechoicesingle' },
|
|
43
|
+
{ label: 'Multiple Choice Question - Multiple Answer', value: 'multiplechoicemultiple' },
|
|
44
|
+
{ label: 'Capture Image with Description', value: 'descriptiveImage' },
|
|
45
|
+
{ label: 'Capture Image as answer', value: 'image' },
|
|
46
|
+
{ label: 'Capture video as answer', value: 'video' },
|
|
47
|
+
{ label: 'Capture Multiple Image', value: 'multipleImage' },
|
|
48
|
+
{ label: 'Date - DD/MM/YYYY', value: 'date' },
|
|
49
|
+
{ label: 'Linear Scale', value: 'linearscale' },
|
|
50
|
+
{ label: 'Time', value: 'time' },
|
|
51
|
+
{ label: 'Capture Image/Video as Answer', value: 'image/video' },
|
|
52
|
+
{ label: 'Dropdown as an answer', value: 'dropdown' }
|
|
53
|
+
]
|
|
54
|
+
validationTypes: { label: string, value: ValidationType }[] = [
|
|
55
|
+
{ label: 'Capture Image', value: 'Capture Image' },
|
|
56
|
+
{ label: 'Descriptive Answer', value: 'Descriptive Answer' },
|
|
57
|
+
{ label: 'Capture Video', value: 'Capture Video' }]
|
|
58
|
+
environment: any;
|
|
59
|
+
taskContainer: HTMLElement | null;
|
|
60
|
+
private destroy$ = new Subject();
|
|
61
|
+
@Input() payload: any
|
|
62
|
+
@Input() taskDetails: any
|
|
63
|
+
@Input() checklistInfo: any
|
|
64
|
+
selectedStores:any=[]
|
|
65
|
+
selectedUsers:any=[]
|
|
66
|
+
priorityTypeList: any = [{ value: 'low', label: 'Low' },
|
|
67
|
+
{ value: 'medium', label: 'Medium' },
|
|
68
|
+
{ value: 'high', label: 'High' }
|
|
69
|
+
]
|
|
70
|
+
clientId: any
|
|
71
|
+
timeDetails: any = [{ id: '00:00', text: "00:00" }, { id: '00:30', text: "00:30" }, { id: '01:00', text: "01:00" }, { id: '01:30', text: "01:30" }, { id: '02:00', text: "02:00" }, { id: '02:30', text: "02:30" }, { id: '03:00', text: "03:00" }, { id: '03:30', text: "03:30" }, { id: '04:00', text: "04:00" }, { id: '04:30', text: "04:30" }, { id: '05:00', text: "05:00" }, { id: '05:30', text: "05:30" }, { id: '06:00', text: "06:00" }, { id: '06:30', text: "06:30" }, { id: '07:00', text: "07:00" }, { id: '07:30', text: "07:30" }, { id: '08:00', text: "08:00" }, { id: '08:30', text: "08:30" }, { id: '09:00', text: "09:00" }, { id: '09:30', text: "09:30" }, { id: '10:00', text: "10:00" }, { id: '10:30', text: "10:30" },
|
|
72
|
+
{ id: '11:00', text: "11:00" }, { id: '11:30', text: "11:30" }, { id: '12:00', text: "12:00" }, { id: '12:30', text: "12:30" }, { id: '13:00', text: "13:00" }, { id: '13:30', text: "13:30" }, { id: '14:00', text: "14:00" }, { id: '14:30', text: "14:30" }, { id: '15:00', text: "15:00" }, { id: '15:30', text: "15:30" }, { id: '16:00', text: "16:00" }, { id: '16:30', text: "16:30" }, { id: '17:00', text: "17:00" }, { id: '17:30', text: "17:30" }, { id: '18:00', text: "18:00" }, { id: '18:30', text: "18:30" }, { id: '19:00', text: "19:00" }, { id: '19:30', text: "19:30" }, { id: '20:00', text: "20:00" }, { id: '20:30', text: "20:30" }, { id: '21:00', text: "21:00" }, { id: '21:30', text: "21:30" }, { id: '22:00', text: "22:00" }, { id: '22:30', text: "22:30" }, { id: '23:00', text: "23:00" }, { id: '23:30', text: "23:30" }, { id: '24:00', text: "24:00" }
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
constructor(private fb: FormBuilder, private activeModal: NgbActiveModal, private gs: GlobalStateService, private traxService: TraxService, private cd: ChangeDetectorRef, private modalService: NgbModal, private router: Router, private toastService: ToastService,
|
|
77
|
+
) {
|
|
78
|
+
this.headerData = JSON.parse(localStorage.getItem('header-filters') as string)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ngOnInit() {
|
|
82
|
+
this.selectedStores = Array.from(new Map(this.payload.selectedStores.map((obj:any) => [obj.storeName, obj])).values());
|
|
83
|
+
this.selectedUsers = Array.from(new Map(this.payload.selectedUsers.map((obj:any) => [obj.userEmail, obj])).values());
|
|
84
|
+
console.log(this.selectedStores,this.selectedUsers)
|
|
85
|
+
console.log(this.payload)
|
|
86
|
+
this.selectedlistselectControl = new FormControl('high');
|
|
87
|
+
this.gs.environment.pipe(takeUntil(this.destroy$)).subscribe((env) => {
|
|
88
|
+
if (env) {
|
|
89
|
+
this.environment = env
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
if (this.headerData?.client) {
|
|
93
|
+
this.clientId = this.headerData?.client
|
|
94
|
+
} else {
|
|
95
|
+
let userinfo = JSON.parse(localStorage.getItem("user-info") || "")
|
|
96
|
+
if (userinfo && userinfo?.clientId) {
|
|
97
|
+
this.clientId = userinfo?.clientId
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.createForm();
|
|
101
|
+
this.selectedDate.startDate = this.dayjs().utc().format("DD-MM-YYYY");
|
|
102
|
+
this.updateCurrentTime()
|
|
103
|
+
}
|
|
104
|
+
tasks: number[] = [1]; // List of task IDs
|
|
105
|
+
taskCounter: number = 1; // Counter to generate unique task IDs
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
updateForm() {
|
|
109
|
+
this.taskForm.patchValue({
|
|
110
|
+
checklistName: this.taskDetails?.checkListName ?? '',
|
|
111
|
+
checklistDescription: this.taskDetails?.checkListDescription ?? '',
|
|
112
|
+
})
|
|
113
|
+
for (let i = 0; i < this.taskDetails?.sections?.length; i++) {
|
|
114
|
+
this.addSectionForm(this.taskDetails.sections[i]);
|
|
115
|
+
|
|
116
|
+
for (let j = 0; j < this.taskDetails.sections[i]?.questions?.length; j++) {
|
|
117
|
+
this.addQuestionForm(this.taskDetails.sections[i]?.questions[j], i);
|
|
118
|
+
for (let k = 0; k < this.taskDetails.sections[i]?.questions[j]?.answers?.length; k++) {
|
|
119
|
+
this.addAnswerForm(this.taskDetails.sections[i]?.questions[j]?.answers[k], i, j);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
filterChange(event: any) {
|
|
127
|
+
this.selectedlistselectControl.setValue(event);
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
prevSlide() {
|
|
131
|
+
if (this.currentIndex > 0) {
|
|
132
|
+
this.currentIndex--;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
nextSlide() {
|
|
137
|
+
if (this.currentIndex < this.payload.refImage.length - 1) {
|
|
138
|
+
this.currentIndex++;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
goToSlide(index: number) {
|
|
143
|
+
if (index >= 0 && index < this.payload.refImage.length) {
|
|
144
|
+
this.currentIndex = index;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
cancel() {
|
|
148
|
+
this.activeModal.close('submit')
|
|
149
|
+
const triggerButton = document.querySelector('#triggerButtonId') as HTMLElement;
|
|
150
|
+
triggerButton?.focus();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
onSubmit() {
|
|
155
|
+
this.submitted = true
|
|
156
|
+
let response: any = this.taskForm.value.sections
|
|
157
|
+
|
|
158
|
+
const time = dayjs(this.selectedItem, "HH:mm")
|
|
159
|
+
if (this.type === 'redo') {
|
|
160
|
+
let input = {
|
|
161
|
+
"clientId": this.clientId,
|
|
162
|
+
"payload": {
|
|
163
|
+
"coverage": this.payload.coverage,
|
|
164
|
+
"userEmail": this.payload.selectedUsers,
|
|
165
|
+
"storeName": this.payload.selectedStores,
|
|
166
|
+
"section_id": this.payload.sectionInfo.section_id,
|
|
167
|
+
"sectionName": this.payload.sectionInfo.sectionName,
|
|
168
|
+
"qno": response[0].questions[0].qno,
|
|
169
|
+
"showcomment": this.showcomment,
|
|
170
|
+
"excelData": this.excelData,
|
|
171
|
+
"checklistDescription": this.taskForm.value.checklistDescription,
|
|
172
|
+
"parentQuestion": this.payload.inputData.parentQuestion ? this.payload.inputData.parentQuestion : this.payload.inputData.qno,
|
|
173
|
+
},
|
|
174
|
+
"upsert": {
|
|
175
|
+
"redoStatus": true,
|
|
176
|
+
"redo": true
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (this.payload.operationtype == 'task') {
|
|
180
|
+
this.traxService.redomultiTask(input).pipe(takeUntil(this.destroy$)).subscribe({
|
|
181
|
+
next: (res: any) => {
|
|
182
|
+
if (res && res?.code === 200) {
|
|
183
|
+
this.toastService.getSuccessToast(res?.message)
|
|
184
|
+
this.activeModal.close('submit');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
} else {
|
|
189
|
+
this.traxService.redoTaskmultichecklist(input).pipe(takeUntil(this.destroy$)).subscribe({
|
|
190
|
+
next: (res: any) => {
|
|
191
|
+
if (res && res?.code === 200) {
|
|
192
|
+
this.toastService.getSuccessToast(res?.message)
|
|
193
|
+
this.activeModal.close('submit');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
} else {
|
|
200
|
+
let payload = {
|
|
201
|
+
"checkListName": this.taskForm.value.checklistName,
|
|
202
|
+
"checkListDescription": this.taskForm.value.checklistDescription,
|
|
203
|
+
"checkListId": this.sourceCheckList_id,
|
|
204
|
+
"sectionId": this.payload.sectionInfo.section_id,
|
|
205
|
+
"sectionName": this.payload.sectionInfo.sectionName,
|
|
206
|
+
"qno": this.payload.inputData.qno,
|
|
207
|
+
"coverage": this.payload.coverage,
|
|
208
|
+
"showcomment": this.showcomment,
|
|
209
|
+
"excelData": this.excelData,
|
|
210
|
+
"parentQuestion": this.payload.inputData.parentQuestion ? this.payload.inputData.parentQuestion : this.payload.inputData.qno,
|
|
211
|
+
"question": [
|
|
212
|
+
{
|
|
213
|
+
"qno": 1,
|
|
214
|
+
"qname": this.payload.inputData.qname,
|
|
215
|
+
"qcomment": this.taskForm.value.checklistDescription,
|
|
216
|
+
"answerType": response[0].questions[0].answerType,
|
|
217
|
+
"runAI": false,
|
|
218
|
+
"runAIDescription": "",
|
|
219
|
+
"allowUploadfromGallery": response[0].questions[0].allowUploadfromGallery,
|
|
220
|
+
"linkType": false,
|
|
221
|
+
"questionReferenceImage": this.uploadedFiles && this.uploadedFiles.length > 0 ? this.uploadedFiles : response[0].questions[0].questionReferenceImage,
|
|
222
|
+
"descriptivetype": response[0].questions[0].descriptivetype,
|
|
223
|
+
"answers": response[0].questions[0].answers
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"scheduleDate": dayjs(this.selectedDate.startDate, "DD-MM-YYYY").format("YYYY-MM-DD"),
|
|
227
|
+
"scheduleEndTime": time.format("hh:mm A"),
|
|
228
|
+
"userEmail": this.payload.selectedUsers,
|
|
229
|
+
"storeName": this.payload.selectedStores,
|
|
230
|
+
"clientId": this.clientId,
|
|
231
|
+
"allowedStoreLocation": this.allowedStoreLocation,
|
|
232
|
+
"restrictAttendance": this.restrictAttendance,
|
|
233
|
+
"priorityType": this.selectedlistselectControl.value,
|
|
234
|
+
"checkListType": "checklistTask" // ['checklistTask','cctv]
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (response[0].questions[0].answerType === 'image' || response[0].questions[0].answerType === 'descriptiveImage' || response[0].questions[0].answerType === 'multipleImage') {
|
|
238
|
+
if (this.uploadedFiles && this.uploadedFiles.length > 0) {
|
|
239
|
+
payload.question.forEach((data: any) => {
|
|
240
|
+
data?.answers.forEach((ans: any) => {
|
|
241
|
+
ans.referenceImage = this.uploadedFiles
|
|
242
|
+
});
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// console.log(payload)
|
|
249
|
+
// return
|
|
250
|
+
try {
|
|
251
|
+
|
|
252
|
+
this.traxService.CreatechecklistMultiTask(payload).subscribe({
|
|
253
|
+
next: (res: any) => {
|
|
254
|
+
if (res?.code === 200) {
|
|
255
|
+
console.log("------------------")
|
|
256
|
+
this.toastService.getSuccessToast(res?.message)
|
|
257
|
+
this.activeModal.close('submit');
|
|
258
|
+
}
|
|
259
|
+
}, error: (err) => {
|
|
260
|
+
console.error('Request Failed:', err);
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
} catch (err) {
|
|
264
|
+
console.log("88888", err)
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
preventEnter(event: any) {
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
event.stopPropagation();
|
|
275
|
+
}
|
|
276
|
+
createForm() {
|
|
277
|
+
this.taskForm = this.fb.group({
|
|
278
|
+
checklistName: ['', [Validators.required, noWhitespaceValidator()]],
|
|
279
|
+
checklistDescription: [''],
|
|
280
|
+
sections: this.fb.array<FormGroup<SectionForm>>([])
|
|
281
|
+
})
|
|
282
|
+
this.updateForm()
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
addSectionForm(section?: Section) {
|
|
286
|
+
|
|
287
|
+
const sectionFormData: FormGroup<SectionForm> = this.fb.group({
|
|
288
|
+
id: [section?.id ?? ''],
|
|
289
|
+
name: [section?.name ?? ''],
|
|
290
|
+
questions: this.fb.array<FormGroup<QuestionForm>>([])
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
(this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>).push(sectionFormData)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
addQuestionForm(question: Question, sectionIndex: number, insertIndex?: number) {
|
|
297
|
+
const questionFormData: FormGroup<QuestionForm> = this.fb.group({
|
|
298
|
+
qno: [question?.qno ?? (this.getQuestions(sectionIndex)?.length ? this.getQuestions(sectionIndex).length + 1 : 1), [Validators.required]],
|
|
299
|
+
qname: [question?.qname ?? '', [Validators.required, noWhitespaceValidator()]],
|
|
300
|
+
answerType: [question?.answerType ?? 'descriptive', [Validators.required]],
|
|
301
|
+
runAI: [question?.runAI ?? false],
|
|
302
|
+
runAIDescription: [question?.runAIDescription ?? ''],
|
|
303
|
+
allowUploadfromGallery: [question?.allowUploadfromGallery ?? false],
|
|
304
|
+
linkType: [question?.linkType ?? false],
|
|
305
|
+
questionReferenceImage: [[...question?.questionReferenceImage ?? '']],
|
|
306
|
+
answers: this.fb.array<FormGroup<AnswerForm>>([])
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
if (question.answerType === 'descriptive' || question.answerType === 'multipleImage') {
|
|
310
|
+
questionFormData.addControl('descriptivetype', new FormControl(question?.descriptivetype ?? 'text'))
|
|
311
|
+
}
|
|
312
|
+
if (question.answerType === 'yes/no' || question.answerType === 'multiplechoicesingle' || question.answerType === 'multiplechoicemultiple') {
|
|
313
|
+
questionFormData.get('answers')?.addValidators(uniqueStringValidator())
|
|
314
|
+
}
|
|
315
|
+
if (insertIndex !== undefined) {
|
|
316
|
+
((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
317
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>).insert(insertIndex, questionFormData)
|
|
318
|
+
return
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
322
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>).push(questionFormData)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
addAnswerForm(answer: Answer, sectionIndex: number, questionIndex: number, insertIndex?: number) {
|
|
326
|
+
console.log(answer?.referenceImage)
|
|
327
|
+
const answerFormData: FormGroup<AnswerForm> = this.fb.group({
|
|
328
|
+
answer: [answer?.answer ?? ''],
|
|
329
|
+
answeroptionNumber: [answer?.answeroptionNumber ?? (this.getAnswers(sectionIndex, questionIndex)?.length ? this.getAnswers(sectionIndex, questionIndex).length + 1 : 1), [Validators.required]],
|
|
330
|
+
sopFlag: [answer?.sopFlag ?? false],
|
|
331
|
+
validation: [answer?.validation ?? false],
|
|
332
|
+
validationType: [answer?.validationType ?? ''],
|
|
333
|
+
referenceImage: [[...answer?.referenceImage ?? '']],
|
|
334
|
+
showLinked: [answer?.showLinked ?? false],
|
|
335
|
+
linkedQuestion: [answer?.linkedQuestion ?? 0],
|
|
336
|
+
nestedQuestion: [answer?.nestedQuestion ?? []],
|
|
337
|
+
index: [answer?.index ?? this.getAnswers(sectionIndex, questionIndex)?.length - 1, [Validators.required]],
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
const answerType: AnswerType = ((this.taskForm?.get('sections') as FormArray).at(sectionIndex)?.get('questions') as FormArray).at(questionIndex)?.get('answerType')?.value;
|
|
341
|
+
|
|
342
|
+
if (answerType === 'descriptive' || answerType === 'descriptiveImage' || answerType === 'image' || answerType === 'multipleImage' || answerType === 'date' || answerType === 'linearscale' || answerType === 'time') {
|
|
343
|
+
answerFormData.addControl('validationAnswer', new FormControl(answer?.validationAnswer ?? ''))
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (answerType === 'yes/no' || answerType === 'multiplechoicesingle' || answerType === 'multiplechoicemultiple') {
|
|
347
|
+
answerFormData.addControl('allowUploadfromGallery', new FormControl(answer?.allowUploadfromGallery ?? false));
|
|
348
|
+
answerFormData.addControl('runAI', new FormControl(answer?.runAI ?? false));
|
|
349
|
+
answerFormData.get('answer')?.addValidators([Validators.required, noWhitespaceValidator()])
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (answerType === 'image/video') {
|
|
353
|
+
answerFormData.addControl('allowUploadfromGallery', new FormControl(answer?.allowUploadfromGallery ?? false));
|
|
354
|
+
answerFormData.addControl('limit', new FormControl(answer?.limit ?? false));
|
|
355
|
+
answerFormData.addControl('imageLimit', new FormControl(answer?.imageLimit ?? 1));
|
|
356
|
+
answerFormData.addControl('videoLimit', new FormControl(answer?.videoLimit ?? 1));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (answerType === 'linearscale') {
|
|
360
|
+
const linearType = answer?.linearType ?? 'degree';
|
|
361
|
+
const defaults: Record<string, { rangeStart: number; rangeEnd: number }> = {
|
|
362
|
+
percentage: { rangeStart: 0, rangeEnd: 100 },
|
|
363
|
+
number: { rangeStart: 0, rangeEnd: 100 },
|
|
364
|
+
degree: { rangeStart: 0, rangeEnd: 100 }, // default 0; user can enter down to -273.15
|
|
365
|
+
};
|
|
366
|
+
const { rangeStart, rangeEnd } = defaults[linearType] ?? defaults.number;
|
|
367
|
+
answerFormData.addControl('rangeStart', new FormControl(answer?.rangeStart ?? rangeStart));
|
|
368
|
+
answerFormData.addControl('rangeEnd', new FormControl(answer?.rangeEnd ?? rangeEnd));
|
|
369
|
+
answerFormData.addControl('linearType', new FormControl(linearType));
|
|
370
|
+
answerFormData.addValidators(rangeValidator())
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (answerType === 'date') {
|
|
374
|
+
answerFormData.addControl('historicDate', new FormControl(answer?.historicDate ?? false));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (answerType === 'yes/no' || answerType === 'multiplechoicesingle' || answerType === 'multiplechoicemultiple' || answerType === 'multipleImage') {
|
|
378
|
+
answerFormData.addControl('descriptivetype', new FormControl(answer?.descriptivetype ?? 'text'));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (insertIndex !== undefined) {
|
|
382
|
+
(((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
383
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
384
|
+
.at(questionIndex).get('answers') as FormArray<FormGroup<AnswerForm>>).insert(insertIndex, answerFormData)
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
(((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
389
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
390
|
+
.at(questionIndex).get('answers') as FormArray<FormGroup<AnswerForm>>).push(answerFormData)
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
get getSections() {
|
|
394
|
+
return (this.taskForm?.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
getQuestions(sectionIndex: number) {
|
|
398
|
+
return ((this.taskForm?.get('sections') as FormArray<FormGroup<SectionForm>>).at(sectionIndex)?.get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
399
|
+
}
|
|
400
|
+
isInvalidAnswer(secIdx: number, qnIdx: number) {
|
|
401
|
+
let answer = this.getAnswers(secIdx, qnIdx);
|
|
402
|
+
if (answer.value.length > 2) {
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
getAnswers(sectionIndex: number, questionIndex: number) {
|
|
410
|
+
return (((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>).at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>).at(questionIndex).get('answers') as FormArray<FormGroup<AnswerForm>>)
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
uploadFile(event: any, sectionIndex: number, questionIndex: number, answerIndex?: number) {
|
|
414
|
+
if (event.target.files != undefined && event.target.files.length) {
|
|
415
|
+
const formData = new FormData();
|
|
416
|
+
const file: File = event.target.files[0];
|
|
417
|
+
formData.append('file', file, file.name);
|
|
418
|
+
formData.append('clientId', this.clientId as string)
|
|
419
|
+
this.traxService.taskImageupload(formData).pipe(takeUntil(this.destroy$)).subscribe({
|
|
420
|
+
next: (res: any) => {
|
|
421
|
+
if (res.data.path) {
|
|
422
|
+
this.selectedFile = file;
|
|
423
|
+
this.previewUrl = URL.createObjectURL(file);
|
|
424
|
+
this.uploadedFiles.push(res.data.path)
|
|
425
|
+
if (this.fileInput) {
|
|
426
|
+
this.fileInput.nativeElement.value = '';
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
error: (err: any) => {
|
|
432
|
+
this.toastService.getErrorToast(err?.error?.error?.message || 'Something went wrong')
|
|
433
|
+
}
|
|
434
|
+
})
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
togglegeofencing(evt: any) {
|
|
438
|
+
this.allowedStoreLocation = evt.target.checked;
|
|
439
|
+
}
|
|
440
|
+
toggleAttendance(evt: any) {
|
|
441
|
+
this.restrictAttendance = evt.target.checked;
|
|
442
|
+
}
|
|
443
|
+
@HostListener('document:click', ['$event'])
|
|
444
|
+
closeDropdown(event: MouseEvent): void {
|
|
445
|
+
this.dropDown = false;
|
|
446
|
+
}
|
|
447
|
+
openDropdown(event: MouseEvent) {
|
|
448
|
+
event.stopPropagation();
|
|
449
|
+
this.dropDown = !this.dropDown;
|
|
450
|
+
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
selectedItem: any = '00:00';
|
|
454
|
+
dropDown: boolean = false;
|
|
455
|
+
currentTime: string = '';
|
|
456
|
+
|
|
457
|
+
updateCurrentTime(): void {
|
|
458
|
+
const now = new Date();
|
|
459
|
+
const nextHour = new Date();
|
|
460
|
+
nextHour.setHours(now.getHours() + 1);
|
|
461
|
+
|
|
462
|
+
const hours = String(now.getHours()).padStart(2, '0');
|
|
463
|
+
const minutes = String(Math.floor(now.getMinutes() / 30) * 30).padStart(2, '0');
|
|
464
|
+
this.currentTime = `${hours}:${minutes}`;
|
|
465
|
+
|
|
466
|
+
const nextHourStr = `${String(nextHour.getHours()).padStart(2, '0')}:00`;
|
|
467
|
+
this.selectedItem = this.timeDetails[this.timeDetails.length - 2].id;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
isDisabled(time: string): boolean {
|
|
471
|
+
const now = new Date();
|
|
472
|
+
console.log(dayjs(now).format('YYYY-MM-DD'), dayjs(this.selectedDate.startDate, "DD-MM-YYYY").format("YYYY-MM-DD"))
|
|
473
|
+
if (dayjs(now).format('YYYY-MM-DD') === dayjs(this.selectedDate.startDate, "DD-MM-YYYY").format("YYYY-MM-DD")) {
|
|
474
|
+
now.setHours(now.getHours() + 1);
|
|
475
|
+
const disabledThreshold = `${String(now.getHours()).padStart(2, '0')}:00`;
|
|
476
|
+
console.log(disabledThreshold)
|
|
477
|
+
return time < disabledThreshold;
|
|
478
|
+
} else {
|
|
479
|
+
return false
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
selectItem(value: any) {
|
|
484
|
+
this.selectedItem = value;
|
|
485
|
+
this.dropDown = false;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
onAnswerDelete(sectionIndex: number, questionIndex: number, answerIndex: number) {
|
|
489
|
+
this.getAnswers(sectionIndex, questionIndex).removeAt(answerIndex)
|
|
490
|
+
this.toastService.getSuccessToast('Answer deleted successfully')
|
|
491
|
+
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
onValidateResponseChange(event: any, sectionIndex: number, questionIndex: number, answerIndex: number) {
|
|
495
|
+
if (event.target.checked) {
|
|
496
|
+
this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('showLinked')?.setValue(false)
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
addNewAnswer(sectionIndex: number, questionIndex: number, type: AnswerType) {
|
|
500
|
+
if (type === 'multiplechoicesingle' || type === 'multiplechoicemultiple') {
|
|
501
|
+
this.addAnswerForm(multiplechoice_answer_template as Answer, sectionIndex, questionIndex)
|
|
502
|
+
this.toastService.getSuccessToast('Answer added successfully')
|
|
503
|
+
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
onQuestionChange(event: any, sectionIndex: number, questionIndex: number) {
|
|
507
|
+
let question
|
|
508
|
+
const answerType: AnswerType = event.target.value
|
|
509
|
+
switch (answerType) {
|
|
510
|
+
case 'descriptive': question = descriptive_question_template
|
|
511
|
+
break;
|
|
512
|
+
case 'yes/no': question = yesorno_question_template
|
|
513
|
+
break;
|
|
514
|
+
case 'multiplechoicesingle': question = multiplechoicesingle_question_template
|
|
515
|
+
break;
|
|
516
|
+
case 'multiplechoicemultiple': question = multiplechoicemultiple_question_template
|
|
517
|
+
break;
|
|
518
|
+
case 'descriptiveImage': question = descriptiveImage_question_template
|
|
519
|
+
break;
|
|
520
|
+
case 'image': question = image_question_template
|
|
521
|
+
break;
|
|
522
|
+
case 'video': question = video_question_template
|
|
523
|
+
break;
|
|
524
|
+
case 'multipleImage': question = multipleImage_question_template
|
|
525
|
+
break;
|
|
526
|
+
case 'date': question = date_question_template
|
|
527
|
+
break;
|
|
528
|
+
case 'linearscale': question = linearscale_question_template
|
|
529
|
+
break;
|
|
530
|
+
case 'time': question = time_question_template
|
|
531
|
+
break;
|
|
532
|
+
case 'image/video': question = image_video_question_template;
|
|
533
|
+
break;
|
|
534
|
+
case 'dropdown': question = dropdown_question_template;
|
|
535
|
+
break;
|
|
536
|
+
default: question = descriptive_question_template
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
const questionName = this.getQuestions(sectionIndex).at(questionIndex).get('qname')?.value || ''
|
|
540
|
+
|
|
541
|
+
this.getQuestions(sectionIndex).removeAt(questionIndex)
|
|
542
|
+
|
|
543
|
+
this.addQuestionForm(question as Question, sectionIndex, questionIndex)
|
|
544
|
+
|
|
545
|
+
this.getQuestions(sectionIndex).at(questionIndex).get('qname')?.setValue(questionName)
|
|
546
|
+
|
|
547
|
+
if (question?.answers.length) {
|
|
548
|
+
question.answers.forEach((element, idx) => {
|
|
549
|
+
this.addAnswerForm(element as Answer, sectionIndex, questionIndex, idx)
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
selectedDate: any = {};
|
|
554
|
+
dayjs = dayjs;
|
|
555
|
+
isCustomDate = (m: dayjs.Dayjs) => {
|
|
556
|
+
const isValidDate = m > this.dayjs();
|
|
557
|
+
return isValidDate ? 'invalid-date' : false;
|
|
558
|
+
}
|
|
559
|
+
onStartDateChange(event: any) {
|
|
560
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
561
|
+
this.isCustomDate = (m: dayjs.Dayjs) => {
|
|
562
|
+
return m.isBefore(this.dayjs(), 'day') ? 'invalid-date' : false;
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
datechange(event: TimePeriod) {
|
|
568
|
+
if (!event.endDate || !event.startDate) {
|
|
569
|
+
return
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
uploadedFiles: File[] = [];
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
selectedFile?: File;
|
|
578
|
+
previewUrl?: any;
|
|
579
|
+
@ViewChild('fileInput') fileInput!: ElementRef;
|
|
580
|
+
|
|
581
|
+
removeImage(index: any): void {
|
|
582
|
+
this.selectedFile = undefined;
|
|
583
|
+
this.previewUrl = undefined;
|
|
584
|
+
if (this.fileInput) {
|
|
585
|
+
this.fileInput.nativeElement.value = '';
|
|
586
|
+
}
|
|
587
|
+
this.uploadedFiles.splice(index, 1)
|
|
588
|
+
}
|
|
589
|
+
ngOnDestroy(): void {
|
|
590
|
+
|
|
591
|
+
this.destroy$.next(true);
|
|
592
|
+
this.destroy$.complete();
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
updateLinearTypeRange(event: any, sectionIndex: number, questionIndex: number) {
|
|
596
|
+
const linearType = event?.target?.value as 'percentage' | 'number' | 'degree';
|
|
597
|
+
const answers = this.getAnswers(sectionIndex, questionIndex).at(0);
|
|
598
|
+
if (!answers) return;
|
|
599
|
+
|
|
600
|
+
const defaults: Record<string, { rangeStart: number; rangeEnd: number }> = {
|
|
601
|
+
percentage: { rangeStart: 0, rangeEnd: 100 },
|
|
602
|
+
number: { rangeStart: 0, rangeEnd: 100 },
|
|
603
|
+
degree: { rangeStart: 0, rangeEnd: 100 }, // default 0; user can enter down to -273.15
|
|
604
|
+
};
|
|
605
|
+
const { rangeStart, rangeEnd } = defaults[linearType] ?? defaults.number;
|
|
606
|
+
|
|
607
|
+
answers.get('rangeStart')?.setValue(rangeStart);
|
|
608
|
+
answers.get('rangeEnd')?.setValue(rangeEnd);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
2
|
+
|
|
3
|
+
export function rangeValidator(): ValidatorFn {
|
|
4
|
+
return (control: AbstractControl): ValidationErrors | null => {
|
|
5
|
+
const rangeStart = control.get('rangeStart')?.value;
|
|
6
|
+
const rangeEnd = control.get('rangeEnd')?.value;
|
|
7
|
+
|
|
8
|
+
if (rangeStart != null && rangeEnd != null && rangeStart >= rangeEnd) {
|
|
9
|
+
return { invalidRange: true };
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
}
|