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,614 @@
|
|
|
1
|
+
import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
import { Answer, AnswerForm, AnswerType, HeaderFilter, ITask, Question, QuestionForm, Section, SectionForm, TaskForm, ValidationType } from './create-task.interface';
|
|
4
|
+
import { TraxService } from '../../services/trax.service';
|
|
5
|
+
import { EMPTY, Subject, catchError, exhaustMap, fromEvent, map, merge, takeUntil } from "rxjs";
|
|
6
|
+
import { GlobalStateService, PageInfoService } from 'tango-app-ui-global';
|
|
7
|
+
import { date_question_template, descriptive_question_template, descriptiveImage_question_template, dropdown_question_template, image_question_template, image_video_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 } from './create-task.data';
|
|
8
|
+
import { ToastService } from 'tango-app-ui-shared';
|
|
9
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
10
|
+
import { noWhitespaceValidator } from './validators/whitespace-validator';
|
|
11
|
+
import { rangeValidator } from './validators/ascending-validator';
|
|
12
|
+
import { TraxpopupComponent } from '../traxpopup/traxpopup.component';
|
|
13
|
+
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
14
|
+
import { uniqueStringValidator } from './validators/unique-string-validator';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'lib-create-task',
|
|
19
|
+
templateUrl: './create-task.component.html',
|
|
20
|
+
styleUrl: './create-task.component.scss'
|
|
21
|
+
})
|
|
22
|
+
export class CreateTaskComponent implements OnInit, OnDestroy {
|
|
23
|
+
|
|
24
|
+
destroy$ = new Subject();
|
|
25
|
+
taskForm: FormGroup<TaskForm>
|
|
26
|
+
taskDetails: ITask
|
|
27
|
+
headerData: HeaderFilter | null | undefined;
|
|
28
|
+
selectedQuestion: FormGroup<QuestionForm> | undefined
|
|
29
|
+
answerTypes: { label: string, value: AnswerType }[] = [
|
|
30
|
+
{ label: 'Descriptive Answer', value: 'descriptive' },
|
|
31
|
+
{ label: 'A/B Question', value: 'yes/no' },
|
|
32
|
+
{ label: 'Multiple Choice Question - Single Answer', value: 'multiplechoicesingle' },
|
|
33
|
+
{ label: 'Multiple Choice Question - Multiple Answer', value: 'multiplechoicemultiple' },
|
|
34
|
+
{ label: 'Capture Image with Description', value: 'descriptiveImage' },
|
|
35
|
+
{ label: 'Capture Image as answer', value: 'image' },
|
|
36
|
+
{ label: 'Capture video as answer', value: 'video' },
|
|
37
|
+
{ label: 'Capture Multiple Image', value: 'multipleImage' },
|
|
38
|
+
{ label: 'Date - DD/MM/YYYY', value: 'date' },
|
|
39
|
+
{ label: 'Linear Scale', value: 'linearscale' },
|
|
40
|
+
{ label: 'Time', value: 'time' },
|
|
41
|
+
{ label: 'Capture Image/Video as Answer', value: 'image/video' },
|
|
42
|
+
{ label: 'Dropdown as an answer', value: 'dropdown' }]
|
|
43
|
+
validationTypes: { label: string, value: ValidationType }[] = [
|
|
44
|
+
{ label: 'Capture Image', value: 'Capture Image' },
|
|
45
|
+
{ label: 'Descriptive Answer', value: 'Descriptive Answer' },
|
|
46
|
+
{ label: 'Capture Video', value: 'Capture Video' }]
|
|
47
|
+
currentTaskId: string
|
|
48
|
+
@ViewChild('configureBtn') configureBtn: ElementRef
|
|
49
|
+
@ViewChild('saveBtn') saveBtn: ElementRef
|
|
50
|
+
environment:any;
|
|
51
|
+
userType: any;
|
|
52
|
+
|
|
53
|
+
constructor(private fb: FormBuilder, private traxService: TraxService, private toastService: ToastService,
|
|
54
|
+
private route: ActivatedRoute, private router: Router, private pageInfo: PageInfoService, private dialog: NgbModal, private gs:GlobalStateService) {
|
|
55
|
+
this.headerData = JSON.parse(localStorage.getItem('header-filters') as string)
|
|
56
|
+
this.createForm()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngOnInit(): void {
|
|
60
|
+
const userInfo = JSON.parse(localStorage.getItem('user-info') || '{}')
|
|
61
|
+
if (userInfo.userType) {
|
|
62
|
+
this.userType = userInfo.userType
|
|
63
|
+
}
|
|
64
|
+
this.setPageData()
|
|
65
|
+
this.route.queryParams
|
|
66
|
+
.pipe(takeUntil(this.destroy$))
|
|
67
|
+
.subscribe((params) => {
|
|
68
|
+
if (params?.id) {
|
|
69
|
+
this.currentTaskId = params.id
|
|
70
|
+
this.getTask(this.currentTaskId)
|
|
71
|
+
} else {
|
|
72
|
+
this.addSectionForm()
|
|
73
|
+
this.addQuestionForm(descriptive_question_template as Question, 0)
|
|
74
|
+
this.addAnswerForm(descriptive_question_template.answers[0] as Answer, 0, 0)
|
|
75
|
+
this.updateIndexNumbers()
|
|
76
|
+
this.selectedQuestion = this.getQuestions(0).at(0)
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.gs.environment.pipe(takeUntil(this.destroy$)).subscribe((env: any) => {
|
|
80
|
+
if (env) {
|
|
81
|
+
this.environment = env;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
detach(detach: any): any {
|
|
86
|
+
throw new Error('Method not implemented.');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
ngOnDestroy(): void {
|
|
90
|
+
this.destroy$.next(true);
|
|
91
|
+
this.destroy$.complete();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
onSubmit(event: any) {
|
|
96
|
+
this.taskForm.markAllAsTouched();
|
|
97
|
+
if (this.taskForm.invalid) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this.updateIndexNumbers();
|
|
101
|
+
const formData = this.removeInvalidCharacters(this.taskForm.value)
|
|
102
|
+
const payload = {
|
|
103
|
+
...formData,
|
|
104
|
+
clientId: this.headerData?.client,
|
|
105
|
+
submitType: event.target === this.configureBtn.nativeElement ? 'configure' : 'save',
|
|
106
|
+
...(this?.currentTaskId ? { _id: this.currentTaskId } : {})
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
if (payload.submitType === 'save') {
|
|
110
|
+
const dialogRef = this.dialog.open(TraxpopupComponent, { centered: true, size: 'md' });
|
|
111
|
+
dialogRef.componentInstance.data = {
|
|
112
|
+
imagesrc: `<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" viewBox="0 0 56 56" fill="none"><rect x="4" y="4" width="48" height="48" rx="24" fill="#FEF0C7"/><path d="M27.9998 24.0012V28.0012M27.9998 32.0012H28.0098M26.2898 18.8612L17.8198 33.0012C17.6451 33.3036 17.5527 33.6465 17.5518 33.9957C17.5508 34.3449 17.6413 34.6883 17.8142 34.9917C17.9871 35.2951 18.2365 35.5479 18.5375 35.725C18.8385 35.9021 19.1806 35.9973 19.5298 36.0012H36.4698C36.819 35.9973 37.1611 35.9021 37.4621 35.725C37.7631 35.5479 38.0124 35.2951 38.1854 34.9917C38.3583 34.6883 38.4488 34.3449 38.4478 33.9957C38.4468 33.6465 38.3544 33.3036 38.1798 33.0012L29.7098 18.8612C29.5315 18.5673 29.2805 18.3243 28.981 18.1557C28.6814 17.987 28.3435 17.8984 27.9998 17.8984C27.656 17.8984 27.3181 17.987 27.0186 18.1557C26.7191 18.3243 26.468 18.5673 26.2898 18.8612Z" stroke="#DC6803" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><rect x="4" y="4" width="48" height="48" rx="24" stroke="#FFFAEB" stroke-width="8"/></svg>`,
|
|
113
|
+
title: `Unsaved changes`,
|
|
114
|
+
content: `Do you want to save as draft?`,
|
|
115
|
+
buttontype: 'draft'
|
|
116
|
+
}
|
|
117
|
+
dialogRef.result.then((res) => {
|
|
118
|
+
if (res === 'confirm') {
|
|
119
|
+
this.traxService.createTask(payload).subscribe({
|
|
120
|
+
next: (response: any) => {
|
|
121
|
+
this.toastService.getSuccessToast(response?.data?.message)
|
|
122
|
+
this.router.navigate(['manage/trax/checklist/managetask'])
|
|
123
|
+
|
|
124
|
+
},
|
|
125
|
+
error: (error: any) => {
|
|
126
|
+
this.toastService.getErrorToast(error?.error?.error?.message || 'Something went wrong')
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
});
|
|
132
|
+
} else if (payload.submitType === 'configure') {
|
|
133
|
+
this.traxService.createTask(payload).subscribe({
|
|
134
|
+
next: (response: any) => {
|
|
135
|
+
this.toastService.getSuccessToast(response?.data?.message)
|
|
136
|
+
this.router.navigate(['manage/trax/task-configure'], { queryParams: { taskId: response.data.checklistId } })
|
|
137
|
+
},
|
|
138
|
+
error: (error: any) => {
|
|
139
|
+
this.toastService.getErrorToast(error?.error?.error?.message || 'Something went wrong')
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
setPageData() {
|
|
148
|
+
this.pageInfo.setTitle("Tasks");
|
|
149
|
+
this.pageInfo.setDescription("");
|
|
150
|
+
this.pageInfo.setBreadcrumbs([
|
|
151
|
+
{ title: "Tango Trax", path: "/manage/trax/dashboard", isActive: false, isSeparator: false },
|
|
152
|
+
{ title: "Tango Trax", path: "/manage/trax/dashboard", isActive: false, isSeparator: true }
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
createForm() {
|
|
157
|
+
this.taskForm = this.fb.group({
|
|
158
|
+
checklistName: ['', [Validators.required, noWhitespaceValidator()]],
|
|
159
|
+
checklistDescription: [''],
|
|
160
|
+
sections: this.fb.array<FormGroup<SectionForm>>([])
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
updateForm() {
|
|
165
|
+
this.taskForm.patchValue({
|
|
166
|
+
checklistName: this.taskDetails.checkListName ?? '',
|
|
167
|
+
checklistDescription: this.taskDetails.checkListDescription ?? '',
|
|
168
|
+
})
|
|
169
|
+
for (let i = 0; i < this.taskDetails?.sections?.length; i++) {
|
|
170
|
+
this.addSectionForm(this.taskDetails.sections[i]);
|
|
171
|
+
for (let j = 0; j < this.taskDetails.sections[i]?.questions?.length; j++) {
|
|
172
|
+
this.addQuestionForm(this.taskDetails.sections[i]?.questions[j], i);
|
|
173
|
+
for (let k = 0; k < this.taskDetails.sections[i]?.questions[j]?.answers?.length; k++) {
|
|
174
|
+
this.addAnswerForm(this.taskDetails.sections[i]?.questions[j]?.answers[k], i, j);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
this.updateIndexNumbers()
|
|
179
|
+
this.selectedQuestion = this.getQuestions(0).at(0)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
updateIndexNumbers() {
|
|
183
|
+
for (let i = 0; i < this.taskForm.controls.sections?.length; i++) {
|
|
184
|
+
for (let j = 0; j < this.taskForm.controls.sections.at(i)?.controls.questions?.length; j++) {
|
|
185
|
+
this.getQuestions(i).at(j).get('qno')?.setValue(j + 1)
|
|
186
|
+
for (let k = 0; k < this.taskForm.controls.sections.at(i)?.controls.questions?.at(j)?.controls.answers?.length; k++) {
|
|
187
|
+
this.getAnswers(i, j).at(k).get('answeroptionNumber')?.setValue(k + 1)
|
|
188
|
+
this.getAnswers(i, j).at(k).get('index')?.setValue(k)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
removeInvalidCharacters(formData: any) {
|
|
195
|
+
|
|
196
|
+
const formValues: ITask & { checklistName: string, checklistDescription: string } = JSON.parse(JSON.stringify(formData))
|
|
197
|
+
formValues.checklistName = trimString(formValues.checklistName)
|
|
198
|
+
formValues.checklistDescription = trimString(formValues.checklistDescription)
|
|
199
|
+
for (let i = 0; i < formValues?.sections?.length; i++) {
|
|
200
|
+
for (let j = 0; j < formValues.sections[i]?.questions?.length; j++) {
|
|
201
|
+
formValues.sections[i].questions[j].qname = trimString(formValues.sections[i]?.questions[j].qname)
|
|
202
|
+
if (formValues.sections[i].questions[j].answerType === 'dropdown') {
|
|
203
|
+
const allowMultipleControl = this.getQuestions(i).at(j).get('allowMultiple')
|
|
204
|
+
formValues.sections[i].questions[j].allowMultiple = allowMultipleControl?.value ?? false
|
|
205
|
+
}
|
|
206
|
+
for (let k = 0; k < formValues.sections[i]?.questions[j]?.answers?.length; k++) {
|
|
207
|
+
formValues.sections[i].questions[j].answers[k].answer = trimString(formValues.sections[i].questions[j].answers[k].answer)
|
|
208
|
+
if (formValues.sections[i].questions[j].answerType === 'image/video') {
|
|
209
|
+
const limit = formValues.sections[i].questions[j].answers[k].limit
|
|
210
|
+
if (!limit) {
|
|
211
|
+
formValues.sections[i].questions[j].answers[k].imageLimit = 0
|
|
212
|
+
formValues.sections[i].questions[j].answers[k].videoLimit = 0
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return formValues
|
|
219
|
+
|
|
220
|
+
function trimString(input: string) {
|
|
221
|
+
if (typeof input !== 'string') {
|
|
222
|
+
return input
|
|
223
|
+
}
|
|
224
|
+
return input.replace(/^\s+|\s+$/g, '');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
addSectionForm(section?: Section) {
|
|
231
|
+
const sectionFormData: FormGroup<SectionForm> = this.fb.group({
|
|
232
|
+
id: [section?.id ?? ''],
|
|
233
|
+
name: [section?.name ?? ''],
|
|
234
|
+
...(this.currentTaskId) ? {oldName: [section?.name ?? '']} : {},
|
|
235
|
+
questions: this.fb.array<FormGroup<QuestionForm>>([])
|
|
236
|
+
});
|
|
237
|
+
(this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>).push(sectionFormData)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
addQuestionForm(question: Question, sectionIndex: number, insertIndex?: number) {
|
|
241
|
+
const questionFormData: FormGroup<QuestionForm> = this.fb.group({
|
|
242
|
+
qno: [question?.qno ?? (this.getQuestions(sectionIndex)?.length ? this.getQuestions(sectionIndex).length + 1 : 1), [Validators.required]],
|
|
243
|
+
qname: [question?.qname ?? '', [Validators.required, noWhitespaceValidator()]],
|
|
244
|
+
...(this.currentTaskId) ? {oldQname: [question?.qname ?? '']} : {},
|
|
245
|
+
answerType: [question?.answerType ?? 'descriptive', [Validators.required]],
|
|
246
|
+
runAI: [question?.runAI ?? false],
|
|
247
|
+
runAIDescription: [question?.runAIDescription ?? ''],
|
|
248
|
+
allowUploadfromGallery: [question?.allowUploadfromGallery ?? false],
|
|
249
|
+
linkType: [question?.linkType ?? false],
|
|
250
|
+
questionReferenceImage: [[...question?.questionReferenceImage ?? '']],
|
|
251
|
+
answers: this.fb.array<FormGroup<AnswerForm>>([])
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
if (question.answerType === 'descriptive' || question.answerType === 'multipleImage') {
|
|
255
|
+
questionFormData.addControl('descriptivetype', new FormControl(question?.descriptivetype ?? 'text'))
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (question.answerType === 'dropdown') {
|
|
259
|
+
questionFormData.addControl('allowMultiple', new FormControl(question?.allowMultiple ?? false))
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (question.answerType === 'yes/no' || question.answerType === 'multiplechoicesingle' || question.answerType === 'multiplechoicemultiple' || question.answerType === 'dropdown') {
|
|
263
|
+
questionFormData.get('answers')?.addValidators(uniqueStringValidator())
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (insertIndex !== undefined) {
|
|
267
|
+
((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
268
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>).insert(insertIndex, questionFormData)
|
|
269
|
+
return
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
273
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>).push(questionFormData)
|
|
274
|
+
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
addAnswerForm(answer: Answer, sectionIndex: number, questionIndex: number, insertIndex?: number) {
|
|
278
|
+
const answerFormData: FormGroup<AnswerForm> = this.fb.group({
|
|
279
|
+
answer: [answer?.answer ?? ''],
|
|
280
|
+
answeroptionNumber: [answer?.answeroptionNumber ?? (this.getAnswers(sectionIndex, questionIndex)?.length ? this.getAnswers(sectionIndex, questionIndex).length + 1 : 1), [Validators.required]],
|
|
281
|
+
sopFlag: [answer?.sopFlag ?? false],
|
|
282
|
+
validation: [answer?.validation ?? false],
|
|
283
|
+
validationType: [answer?.validationType ?? ''],
|
|
284
|
+
referenceImage: [[...answer?.referenceImage ?? '']],
|
|
285
|
+
showLinked: [answer?.showLinked ?? false],
|
|
286
|
+
linkedQuestion: [answer?.linkedQuestion ?? 0],
|
|
287
|
+
nestedQuestion: [answer?.nestedQuestion ?? []],
|
|
288
|
+
index: [answer?.index ?? this.getAnswers(sectionIndex, questionIndex)?.length - 1, [Validators.required]],
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
const answerType: AnswerType = ((this.taskForm?.get('sections') as FormArray).at(sectionIndex)?.get('questions') as FormArray).at(questionIndex)?.get('answerType')?.value;
|
|
292
|
+
|
|
293
|
+
if (answerType === 'descriptive' || answerType === 'descriptiveImage' || answerType === 'image' || answerType === 'multipleImage' || answerType === 'date' || answerType === 'linearscale' || answerType === 'time') {
|
|
294
|
+
answerFormData.addControl('validationAnswer', new FormControl(answer?.validationAnswer ?? ''))
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (answerType === 'yes/no' || answerType === 'multiplechoicesingle' || answerType === 'multiplechoicemultiple' || answerType === 'dropdown') {
|
|
298
|
+
answerFormData.addControl('allowUploadfromGallery', new FormControl(answer?.allowUploadfromGallery ?? false));
|
|
299
|
+
answerFormData.addControl('runAI', new FormControl(answer?.runAI ?? false));
|
|
300
|
+
answerFormData.get('answer')?.addValidators([Validators.required, noWhitespaceValidator()])
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (answerType === 'image/video') {
|
|
304
|
+
answerFormData.addControl('allowUploadfromGallery', new FormControl(answer?.allowUploadfromGallery ?? false));
|
|
305
|
+
answerFormData.addControl('limit', new FormControl(answer?.limit ?? false));
|
|
306
|
+
answerFormData.addControl('imageLimit', new FormControl(answer?.imageLimit ?? 1));
|
|
307
|
+
answerFormData.addControl('videoLimit', new FormControl(answer?.videoLimit ?? 1));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (answerType === 'linearscale') {
|
|
311
|
+
const linearType = answer?.linearType ?? 'degree';
|
|
312
|
+
const defaults: Record<string, { rangeStart: number; rangeEnd: number }> = {
|
|
313
|
+
percentage: { rangeStart: 0, rangeEnd: 100 },
|
|
314
|
+
number: { rangeStart: 0, rangeEnd: 100 },
|
|
315
|
+
degree: { rangeStart: 0, rangeEnd: 100 }, // default 0; user can enter down to -273.15
|
|
316
|
+
};
|
|
317
|
+
const { rangeStart, rangeEnd } = defaults[linearType] ?? defaults.number;
|
|
318
|
+
answerFormData.addControl('rangeStart', new FormControl(answer?.rangeStart ?? rangeStart));
|
|
319
|
+
answerFormData.addControl('rangeEnd', new FormControl(answer?.rangeEnd ?? rangeEnd));
|
|
320
|
+
answerFormData.addControl('linearType', new FormControl(linearType));
|
|
321
|
+
answerFormData.addValidators(rangeValidator())
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (answerType === 'date') {
|
|
325
|
+
answerFormData.addControl('historicDate', new FormControl(answer?.historicDate ?? false));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (answerType === 'yes/no' || answerType === 'multiplechoicesingle' || answerType === 'multiplechoicemultiple' || answerType === 'dropdown' || answerType === 'multipleImage') {
|
|
329
|
+
answerFormData.addControl('descriptivetype', new FormControl(answer?.descriptivetype ?? 'text'));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (insertIndex !== undefined) {
|
|
333
|
+
(((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
334
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
335
|
+
.at(questionIndex).get('answers') as FormArray<FormGroup<AnswerForm>>).insert(insertIndex, answerFormData)
|
|
336
|
+
return
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
(((this.taskForm.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
340
|
+
.at(sectionIndex).get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
341
|
+
.at(questionIndex).get('answers') as FormArray<FormGroup<AnswerForm>>).push(answerFormData)
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
get getSections() {
|
|
345
|
+
return (this.taskForm?.get('sections') as FormArray<FormGroup<SectionForm>>)
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
getQuestions(sectionIndex: number) {
|
|
349
|
+
return ((this.taskForm?.get('sections') as FormArray<FormGroup<SectionForm>>).at(sectionIndex)?.get('questions') as FormArray<FormGroup<QuestionForm>>)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
getAnswers(sectionIndex: number, questionIndex: number) {
|
|
353
|
+
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>>)
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
uploadFile(event: any, sectionIndex: number, questionIndex: number, answerIndex: number =-1,imgIndex?:number) {
|
|
357
|
+
if (event.target.files != undefined && event.target.files.length) {
|
|
358
|
+
const formData = new FormData();
|
|
359
|
+
const file: File = event.target.files[0];
|
|
360
|
+
formData.append('file', file, file.name);
|
|
361
|
+
formData.append('clientId', this.headerData?.client as string)
|
|
362
|
+
this.traxService.imageupload(formData).pipe(takeUntil(this.destroy$)).subscribe({
|
|
363
|
+
next: (res: any) => {
|
|
364
|
+
if (res.data.imgUrl) {
|
|
365
|
+
let input = event.target as HTMLInputElement;
|
|
366
|
+
input.value='';
|
|
367
|
+
if (answerIndex == -1) {
|
|
368
|
+
console.log(imgIndex);
|
|
369
|
+
if(imgIndex != undefined) {
|
|
370
|
+
const questions = this.getQuestions(sectionIndex);
|
|
371
|
+
const questionGroup = questions.at(questionIndex) as FormGroup;
|
|
372
|
+
const imageArrayControl = questionGroup.get(
|
|
373
|
+
"questionReferenceImage"
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
if (imageArrayControl) {
|
|
377
|
+
const imageArray = imageArrayControl.value as string[];
|
|
378
|
+
imageArray[imgIndex] = res.data.imgUrl;
|
|
379
|
+
imageArrayControl.setValue([...imageArray]);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
this.getQuestions(sectionIndex).at(questionIndex).get('questionReferenceImage')
|
|
384
|
+
?.setValue(this.getQuestions(sectionIndex).at(questionIndex).get('questionReferenceImage')?.value?.concat(res.data.imgUrl)!)
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
if(imgIndex != undefined) {
|
|
388
|
+
let imageControl = this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('referenceImage');
|
|
389
|
+
if(imageControl) {
|
|
390
|
+
const imageArray = imageControl.value as string[];
|
|
391
|
+
imageArray[imgIndex] = res.data.imgUrl;
|
|
392
|
+
imageControl.setValue([...imageArray]);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('referenceImage')
|
|
397
|
+
?.setValue(this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('referenceImage')?.value?.concat(res.data.imgUrl)!)
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
error: (err: any) => {
|
|
403
|
+
this.toastService.getErrorToast(err?.error?.error?.message || 'Something went wrong')
|
|
404
|
+
}
|
|
405
|
+
})
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
onQuestionClone(sectionIndex: number, questionIndex: number, question: FormGroup<QuestionForm>) {
|
|
410
|
+
const cloneControl = (control: AbstractControl): AbstractControl => {
|
|
411
|
+
if (control instanceof FormGroup) {
|
|
412
|
+
const clonedGroup = new FormGroup(
|
|
413
|
+
Object.keys(control.controls).reduce((acc, key) => {
|
|
414
|
+
acc[key] = cloneControl(control.controls[key]);
|
|
415
|
+
return acc;
|
|
416
|
+
}, {} as { [key: string]: AbstractControl })
|
|
417
|
+
);
|
|
418
|
+
return clonedGroup;
|
|
419
|
+
} else if (control instanceof FormArray) {
|
|
420
|
+
const clonedArray = new FormArray(control.controls.map(cloneControl));
|
|
421
|
+
return clonedArray;
|
|
422
|
+
} else if (control instanceof FormControl) {
|
|
423
|
+
return new FormControl(control.value, control.validator, control.asyncValidator);
|
|
424
|
+
} else {
|
|
425
|
+
throw new Error('Unsupported control type');
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
const clonedQuestion = cloneControl(question) as FormGroup<QuestionForm>;
|
|
430
|
+
this.getQuestions(sectionIndex).insert(questionIndex + 1, clonedQuestion)
|
|
431
|
+
this.updateIndexNumbers()
|
|
432
|
+
this.toastService.getSuccessToast('Question cloned successfully')
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
onQuestionDelete(sectionIndex: number, questionIndex: number) {
|
|
436
|
+
|
|
437
|
+
const dialogRef = this.dialog.open(TraxpopupComponent,{centered: true, size: 'md'});
|
|
438
|
+
dialogRef.componentInstance.data = {
|
|
439
|
+
imagesrc: `<span><svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" viewBox="0 0 56 56" fill="none"><rect x="4" y="4" width="48" height="48" rx="24" fill="#FEE4E2"/><path d="M28 24V28M28 32H28.01M38 28C38 33.5228 33.5228 38 28 38C22.4772 38 18 33.5228 18 28C18 22.4772 22.4772 18 28 18C33.5228 18 38 22.4772 38 28Z" stroke="#D92D20" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><rect x="4" y="4" width="48" height="48" rx="24" stroke="#FEF3F2" stroke-width="8"/></svg></span>`,
|
|
440
|
+
title: `Delete 'Question ${questionIndex + 1}'?`,
|
|
441
|
+
content: `Are you sure you want to delete <b>'Question ${questionIndex + 1}'</b>? This action cannot be undone.`,
|
|
442
|
+
buttontype: 'delete'
|
|
443
|
+
}
|
|
444
|
+
dialogRef.result.then((res) => {
|
|
445
|
+
if (res == 'delete') {
|
|
446
|
+
this.getQuestions(sectionIndex).removeAt(questionIndex)
|
|
447
|
+
this.updateIndexNumbers()
|
|
448
|
+
this.toastService.getSuccessToast('Question deleted successfully')
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
onDeleteQuestionReferenceImage(sectionIndex: number, questionIndex: number, imageIndex: number) {
|
|
454
|
+
this.getQuestions(sectionIndex).at(questionIndex).get('questionReferenceImage')
|
|
455
|
+
?.setValue(this.getQuestions(sectionIndex).at(questionIndex).get('questionReferenceImage')!.value!.filter((_, index) => index !== imageIndex))
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
onDeleteAnswerReferenceImage(sectionIndex: number, questionIndex: number, answerIndex: number, imageIndex: number) {
|
|
459
|
+
this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('referenceImage')
|
|
460
|
+
?.setValue(this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('referenceImage')!.value!.filter((_, index) => index !== imageIndex))
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
onValidateResponseChange(event: any, sectionIndex: number, questionIndex: number, answerIndex: number) {
|
|
465
|
+
if (event.target.checked) {
|
|
466
|
+
this.getAnswers(sectionIndex, questionIndex).at(answerIndex).get('showLinked')?.setValue(false)
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
onAnswerDelete(sectionIndex: number, questionIndex: number, answerIndex: number) {
|
|
471
|
+
this.getAnswers(sectionIndex, questionIndex).removeAt(answerIndex)
|
|
472
|
+
this.updateIndexNumbers()
|
|
473
|
+
this.toastService.getSuccessToast('Answer deleted successfully')
|
|
474
|
+
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
addNewAnswer(sectionIndex: number, questionIndex: number, type: AnswerType) {
|
|
478
|
+
if (type === 'multiplechoicesingle' || type === 'multiplechoicemultiple' || type === 'dropdown') {
|
|
479
|
+
this.addAnswerForm(multiplechoice_answer_template as Answer, sectionIndex, questionIndex)
|
|
480
|
+
this.updateIndexNumbers()
|
|
481
|
+
this.toastService.getSuccessToast('Answer added successfully')
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
addNewQuestion(sectionIndex: number, questionIndex: number) {
|
|
486
|
+
this.addQuestionForm(descriptive_question_template as Question, sectionIndex)
|
|
487
|
+
if (descriptive_question_template?.answers.length) {
|
|
488
|
+
descriptive_question_template.answers.forEach((element, idx) => {
|
|
489
|
+
this.addAnswerForm(element as Answer, sectionIndex, questionIndex + 1, idx)
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
this.updateIndexNumbers()
|
|
493
|
+
this.toastService.getSuccessToast('Question added successfully')
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
onQuestionChange(event: any, sectionIndex: number, questionIndex: number) {
|
|
497
|
+
let question
|
|
498
|
+
const answerType: AnswerType = event.target.value
|
|
499
|
+
switch (answerType) {
|
|
500
|
+
case 'descriptive': question = descriptive_question_template
|
|
501
|
+
break;
|
|
502
|
+
case 'yes/no': question = yesorno_question_template
|
|
503
|
+
break;
|
|
504
|
+
case 'multiplechoicesingle': question = multiplechoicesingle_question_template
|
|
505
|
+
break;
|
|
506
|
+
case 'multiplechoicemultiple': question = multiplechoicemultiple_question_template
|
|
507
|
+
break;
|
|
508
|
+
case 'descriptiveImage': question = descriptiveImage_question_template
|
|
509
|
+
break;
|
|
510
|
+
case 'image': question = image_question_template
|
|
511
|
+
break;
|
|
512
|
+
case 'video': question = video_question_template
|
|
513
|
+
break;
|
|
514
|
+
case 'image/video': question = image_video_question_template
|
|
515
|
+
break;
|
|
516
|
+
case 'multipleImage': question = multipleImage_question_template
|
|
517
|
+
break;
|
|
518
|
+
case 'date': question = date_question_template
|
|
519
|
+
break;
|
|
520
|
+
case 'linearscale': question = linearscale_question_template
|
|
521
|
+
break;
|
|
522
|
+
case 'time': question = time_question_template
|
|
523
|
+
break;
|
|
524
|
+
case 'dropdown': question = dropdown_question_template
|
|
525
|
+
break;
|
|
526
|
+
default: question = descriptive_question_template
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
const questionName = this.getQuestions(sectionIndex).at(questionIndex).get('qname')?.value || '';
|
|
531
|
+
const questionOldName = this.getQuestions(sectionIndex).at(questionIndex).get('oldQname')?.value || ''
|
|
532
|
+
|
|
533
|
+
this.getQuestions(sectionIndex).removeAt(questionIndex)
|
|
534
|
+
|
|
535
|
+
this.addQuestionForm(question as Question, sectionIndex, questionIndex)
|
|
536
|
+
|
|
537
|
+
this.getQuestions(sectionIndex).at(questionIndex).get('qname')?.setValue(questionName)
|
|
538
|
+
if(questionOldName) {
|
|
539
|
+
this.getQuestions(sectionIndex).at(questionIndex).get('oldQname')?.setValue(questionOldName)
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
if (question?.answers.length) {
|
|
543
|
+
question.answers.forEach((element, idx) => {
|
|
544
|
+
this.addAnswerForm(element as Answer, sectionIndex, questionIndex, idx)
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
this.updateIndexNumbers()
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
updateLinearTypeRange(event: any, sectionIndex: number, questionIndex: number) {
|
|
552
|
+
const linearType = event?.target?.value as 'percentage' | 'number' | 'degree';
|
|
553
|
+
const answers = this.getAnswers(sectionIndex, questionIndex).at(0);
|
|
554
|
+
if (!answers) return;
|
|
555
|
+
|
|
556
|
+
const defaults: Record<string, { rangeStart: number; rangeEnd: number }> = {
|
|
557
|
+
percentage: { rangeStart: 0, rangeEnd: 100 },
|
|
558
|
+
number: { rangeStart: 0, rangeEnd: 100 },
|
|
559
|
+
degree: { rangeStart: 0, rangeEnd: 100 }, // default 0; user can enter down to -273.15
|
|
560
|
+
};
|
|
561
|
+
const { rangeStart, rangeEnd } = defaults[linearType] ?? defaults.number;
|
|
562
|
+
|
|
563
|
+
answers.get('rangeStart')?.setValue(rangeStart);
|
|
564
|
+
answers.get('rangeEnd')?.setValue(rangeEnd);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
selectQuestion(sectionIndex: number, questionIndex: number, question: FormGroup<QuestionForm>) {
|
|
568
|
+
this.selectedQuestion = question
|
|
569
|
+
const elementId = `question-${sectionIndex}${questionIndex}`;
|
|
570
|
+
const element = document.getElementById(elementId);
|
|
571
|
+
if (element) {
|
|
572
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
573
|
+
} else {
|
|
574
|
+
console.warn(`Element with ID ${elementId} not found`);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
getTask(id: string) {
|
|
579
|
+
this.traxService.getTaskconfig(id, this.headerData?.client!).pipe(takeUntil(this.destroy$)).subscribe({
|
|
580
|
+
next: (res: any) => {
|
|
581
|
+
if (res.code === 200) {
|
|
582
|
+
this.taskDetails = res.data.checkListDetails
|
|
583
|
+
// if(this.taskDetails.publish){
|
|
584
|
+
// this.router.navigate(['manage/trax/task-configure'], { queryParams: {taskId:this.taskDetails._id} })
|
|
585
|
+
// }
|
|
586
|
+
this.updateForm()
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
error: (err: any) => {
|
|
590
|
+
this.toastService.getErrorToast(err?.error?.error?.message || 'Something went wrong')
|
|
591
|
+
}
|
|
592
|
+
})
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
onHover(question: FormGroup<QuestionForm>) {
|
|
596
|
+
this.selectedQuestion = question
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
onPopup(image:string){
|
|
600
|
+
let imageRef = this.dialog.open(TraxpopupComponent, { centered: true, size: "md" });
|
|
601
|
+
imageRef.componentInstance.data = {type:'image',image:this.environment.TraxAnswerCDN+image};
|
|
602
|
+
imageRef.result.then(() => {});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
onDownload() {
|
|
606
|
+
console.log('download icon clicked');
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
onDelete() {
|
|
610
|
+
console.log('Delete icon clicked');
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
}
|
|
614
|
+
|