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.
Files changed (470) hide show
  1. package/.eslintrc.json +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +12 -25
  4. package/src/lib/components/action-centre/action-centre.component.html +607 -0
  5. package/src/lib/components/action-centre/action-centre.component.scss +185 -0
  6. package/src/lib/components/action-centre/action-centre.component.spec.ts +23 -0
  7. package/src/lib/components/action-centre/action-centre.component.ts +279 -0
  8. package/src/lib/components/activity-log/activity-log.component.html +84 -0
  9. package/src/lib/components/activity-log/activity-log.component.scss +33 -0
  10. package/src/lib/components/activity-log/activity-log.component.spec.ts +23 -0
  11. package/src/lib/components/activity-log/activity-log.component.ts +137 -0
  12. package/src/lib/components/activity-log-v2/activity-log-v2.component.html +189 -0
  13. package/src/lib/components/activity-log-v2/activity-log-v2.component.scss +162 -0
  14. package/src/lib/components/activity-log-v2/activity-log-v2.component.spec.ts +23 -0
  15. package/src/lib/components/activity-log-v2/activity-log-v2.component.ts +517 -0
  16. package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.html +19 -0
  17. package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.scss +148 -0
  18. package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.spec.ts +23 -0
  19. package/src/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.ts +141 -0
  20. package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.html +42 -0
  21. package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.scss +49 -0
  22. package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.spec.ts +23 -0
  23. package/src/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.ts +22 -0
  24. package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.html +724 -0
  25. package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.scss +217 -0
  26. package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.spec.ts +23 -0
  27. package/src/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.ts +122 -0
  28. package/src/lib/components/add-checklist/add-checklist.component.html +1459 -0
  29. package/src/lib/components/add-checklist/add-checklist.component.scss +1205 -0
  30. package/src/lib/components/add-checklist/add-checklist.component.spec.ts +23 -0
  31. package/src/lib/components/add-checklist/add-checklist.component.ts +2460 -0
  32. package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.html +207 -0
  33. package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.scss +213 -0
  34. package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.spec.ts +23 -0
  35. package/src/lib/components/add-checklist/checklist-popup/checklist-popup.component.ts +621 -0
  36. package/src/lib/components/add-checklist/counter/counter.component.html +43 -0
  37. package/src/lib/components/add-checklist/counter/counter.component.scss +49 -0
  38. package/src/lib/components/add-checklist/counter/counter.component.spec.ts +23 -0
  39. package/src/lib/components/add-checklist/counter/counter.component.ts +123 -0
  40. package/src/lib/components/add-multitask/add-multitask.component.html +705 -0
  41. package/src/lib/components/add-multitask/add-multitask.component.scss +296 -0
  42. package/src/lib/components/add-multitask/add-multitask.component.spec.ts +23 -0
  43. package/src/lib/components/add-multitask/add-multitask.component.ts +611 -0
  44. package/src/lib/components/add-multitask/ascending-validator.ts +13 -0
  45. package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.html +197 -0
  46. package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.scss +31 -0
  47. package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.spec.ts +23 -0
  48. package/src/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.ts +285 -0
  49. package/src/lib/components/add-multitask/create-task.data.ts +374 -0
  50. package/src/lib/components/add-multitask/create-task.interface.ts +177 -0
  51. package/src/lib/components/add-multitask/unique-string-validator.ts +13 -0
  52. package/src/lib/components/add-multitask/whitespace-validator.ts +11 -0
  53. package/src/lib/components/add-task/add-task.component.html +654 -0
  54. package/src/lib/components/add-task/add-task.component.scss +536 -0
  55. package/src/lib/components/add-task/add-task.component.spec.ts +23 -0
  56. package/src/lib/components/add-task/add-task.component.ts +569 -0
  57. package/src/lib/components/add-task/ascending-validator.ts +13 -0
  58. package/src/lib/components/add-task/create-task.data.ts +374 -0
  59. package/src/lib/components/add-task/create-task.interface.ts +192 -0
  60. package/src/lib/components/add-task/unique-string-validator.ts +13 -0
  61. package/src/lib/components/add-task/whitespace-validator.ts +11 -0
  62. package/src/lib/components/approval-popup/approval-popup.component.html +25 -0
  63. package/src/lib/components/approval-popup/approval-popup.component.scss +3 -0
  64. package/src/lib/components/approval-popup/approval-popup.component.spec.ts +23 -0
  65. package/src/lib/components/approval-popup/approval-popup.component.ts +26 -0
  66. package/src/lib/components/checklist/checklist.component.html +330 -0
  67. package/src/lib/components/checklist/checklist.component.scss +112 -0
  68. package/src/lib/components/checklist/checklist.component.spec.ts +23 -0
  69. package/src/lib/components/checklist/checklist.component.ts +344 -0
  70. package/src/lib/components/checklist-configure/assign/assign.component.html +665 -0
  71. package/src/lib/components/checklist-configure/assign/assign.component.scss +219 -0
  72. package/src/lib/components/checklist-configure/assign/assign.component.spec.ts +23 -0
  73. package/src/lib/components/checklist-configure/assign/assign.component.ts +932 -0
  74. package/src/lib/components/checklist-configure/checklist-configure.component.html +4340 -0
  75. package/src/lib/components/checklist-configure/checklist-configure.component.scss +2338 -0
  76. package/src/lib/components/checklist-configure/checklist-configure.component.spec.ts +23 -0
  77. package/src/lib/components/checklist-configure/checklist-configure.component.ts +4659 -0
  78. package/src/lib/components/checklistlayout/checklistlayout.component.html +30 -0
  79. package/src/lib/components/checklistlayout/checklistlayout.component.scss +15 -0
  80. package/src/lib/components/checklistlayout/checklistlayout.component.spec.ts +23 -0
  81. package/src/lib/components/checklistlayout/checklistlayout.component.ts +47 -0
  82. package/src/lib/components/chip-dropdown/chip-dropdown.component.html +36 -0
  83. package/src/lib/components/chip-dropdown/chip-dropdown.component.scss +97 -0
  84. package/src/lib/components/chip-dropdown/chip-dropdown.component.spec.ts +23 -0
  85. package/src/lib/components/chip-dropdown/chip-dropdown.component.ts +125 -0
  86. package/src/lib/components/create-task/create-task.component.html +2003 -0
  87. package/src/lib/components/create-task/create-task.component.scss +272 -0
  88. package/src/lib/components/create-task/create-task.component.spec.ts +23 -0
  89. package/src/lib/components/create-task/create-task.component.ts +614 -0
  90. package/src/lib/components/create-task/create-task.data.ts +372 -0
  91. package/src/lib/components/create-task/create-task.interface.ts +182 -0
  92. package/src/lib/components/create-task/validators/ascending-validator.ts +13 -0
  93. package/src/lib/components/create-task/validators/unique-string-validator.ts +13 -0
  94. package/src/lib/components/create-task/validators/whitespace-validator.ts +11 -0
  95. package/src/lib/components/custom-select/custom-select.component.html +44 -0
  96. package/src/lib/components/custom-select/custom-select.component.scss +144 -0
  97. package/src/lib/components/custom-select/custom-select.component.spec.ts +23 -0
  98. package/src/lib/components/custom-select/custom-select.component.ts +265 -0
  99. package/src/lib/components/dashboard/dashboard.component.html +1076 -0
  100. package/src/lib/components/dashboard/dashboard.component.scss +237 -0
  101. package/src/lib/components/dashboard/dashboard.component.spec.ts +23 -0
  102. package/src/lib/components/dashboard/dashboard.component.ts +539 -0
  103. package/src/lib/components/dashboard-info/dashboard-info.component.html +1420 -0
  104. package/src/lib/components/dashboard-info/dashboard-info.component.scss +409 -0
  105. package/src/lib/components/dashboard-info/dashboard-info.component.spec.ts +23 -0
  106. package/src/lib/components/dashboard-info/dashboard-info.component.ts +772 -0
  107. package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.html +110 -0
  108. package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.scss +260 -0
  109. package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.spec.ts +23 -0
  110. package/src/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.ts +143 -0
  111. package/src/lib/components/dashboard-layout/dashboard-layout.component.html +1 -0
  112. package/src/lib/components/dashboard-layout/dashboard-layout.component.scss +0 -0
  113. package/src/lib/components/dashboard-layout/dashboard-layout.component.spec.ts +23 -0
  114. package/src/lib/components/dashboard-layout/dashboard-layout.component.ts +10 -0
  115. package/src/lib/components/disabled-select/disabled-select.component.html +44 -0
  116. package/src/lib/components/disabled-select/disabled-select.component.scss +149 -0
  117. package/src/lib/components/disabled-select/disabled-select.component.spec.ts +23 -0
  118. package/src/lib/components/disabled-select/disabled-select.component.ts +146 -0
  119. package/src/lib/components/export-gallery/export-gallery.component.html +175 -0
  120. package/src/lib/components/export-gallery/export-gallery.component.scss +200 -0
  121. package/src/lib/components/export-gallery/export-gallery.component.spec.ts +23 -0
  122. package/src/lib/components/export-gallery/export-gallery.component.ts +263 -0
  123. package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.html +36 -0
  124. package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.scss +97 -0
  125. package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.spec.ts +23 -0
  126. package/src/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.ts +104 -0
  127. package/src/lib/components/eye-test-audit/custom-select/custom-select.component.html +44 -0
  128. package/src/lib/components/eye-test-audit/custom-select/custom-select.component.scss +144 -0
  129. package/src/lib/components/eye-test-audit/custom-select/custom-select.component.spec.ts +23 -0
  130. package/src/lib/components/eye-test-audit/custom-select/custom-select.component.ts +265 -0
  131. package/src/lib/components/eye-test-audit/eye-test/eye-test.component.html +1804 -0
  132. package/src/lib/components/eye-test-audit/eye-test/eye-test.component.scss +806 -0
  133. package/src/lib/components/eye-test-audit/eye-test/eye-test.component.spec.ts +23 -0
  134. package/src/lib/components/eye-test-audit/eye-test/eye-test.component.ts +1890 -0
  135. package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.html +25 -0
  136. package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.scss +0 -0
  137. package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.spec.ts +23 -0
  138. package/src/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.ts +20 -0
  139. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.ts +26 -0
  140. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.html +1 -0
  141. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.scss +0 -0
  142. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.spec.ts +23 -0
  143. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.ts +24 -0
  144. package/src/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.ts +44 -0
  145. package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.html +490 -0
  146. package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.scss +721 -0
  147. package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.spec.ts +23 -0
  148. package/src/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.ts +1017 -0
  149. package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.html +708 -0
  150. package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.scss +247 -0
  151. package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.spec.ts +23 -0
  152. package/src/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.ts +446 -0
  153. package/src/lib/components/eye-test-audit/group-select/group-select.component.html +44 -0
  154. package/src/lib/components/eye-test-audit/group-select/group-select.component.scss +144 -0
  155. package/src/lib/components/eye-test-audit/group-select/group-select.component.spec.ts +23 -0
  156. package/src/lib/components/eye-test-audit/group-select/group-select.component.ts +147 -0
  157. package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.html +18 -0
  158. package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.scss +49 -0
  159. package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.spec.ts +23 -0
  160. package/src/lib/components/eye-test-audit/reactive-select/reactive-select.component.ts +104 -0
  161. package/src/lib/components/eye-test-audit/select-drop/select-drop.component.html +44 -0
  162. package/src/lib/components/eye-test-audit/select-drop/select-drop.component.scss +144 -0
  163. package/src/lib/components/eye-test-audit/select-drop/select-drop.component.spec.ts +23 -0
  164. package/src/lib/components/eye-test-audit/select-drop/select-drop.component.ts +152 -0
  165. package/src/lib/components/eye-test-audit/services/eye-test-audit.service.spec.ts +16 -0
  166. package/src/lib/components/eye-test-audit/services/eye-test-audit.service.ts +190 -0
  167. package/src/lib/components/flag-layout/flag-layout.component.html +1 -0
  168. package/src/lib/components/flag-layout/flag-layout.component.scss +0 -0
  169. package/src/lib/components/flag-layout/flag-layout.component.spec.ts +23 -0
  170. package/src/lib/components/flag-layout/flag-layout.component.ts +10 -0
  171. package/src/lib/components/flags/flags.component.html +473 -0
  172. package/src/lib/components/flags/flags.component.scss +86 -0
  173. package/src/lib/components/flags/flags.component.spec.ts +23 -0
  174. package/src/lib/components/flags/flags.component.ts +280 -0
  175. package/{lib/components/flags/flags.interface.d.ts → src/lib/components/flags/flags.interface.ts} +73 -65
  176. package/src/lib/components/flags-info/flags-info.component.html +6012 -0
  177. package/src/lib/components/flags-info/flags-info.component.scss +278 -0
  178. package/src/lib/components/flags-info/flags-info.component.spec.ts +23 -0
  179. package/src/lib/components/flags-info/flags-info.component.ts +490 -0
  180. package/src/lib/components/flags-info/flags-info.interface.ts +441 -0
  181. package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.html +1 -0
  182. package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.scss +4 -0
  183. package/src/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.ts +78 -0
  184. package/src/lib/components/flags-new/flags-new.component.html +904 -0
  185. package/src/lib/components/flags-new/flags-new.component.scss +121 -0
  186. package/src/lib/components/flags-new/flags-new.component.spec.ts +23 -0
  187. package/src/lib/components/flags-new/flags-new.component.ts +357 -0
  188. package/{lib/components/flags-new/flags-new.interface.d.ts → src/lib/components/flags-new/flags-new.interface.ts} +90 -81
  189. package/src/lib/components/gallery/gallery.component.html +3660 -0
  190. package/src/lib/components/gallery/gallery.component.scss +930 -0
  191. package/src/lib/components/gallery/gallery.component.ts +3527 -0
  192. package/src/lib/components/group-select/group-select.component.html +44 -0
  193. package/src/lib/components/group-select/group-select.component.scss +144 -0
  194. package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
  195. package/src/lib/components/group-select/group-select.component.ts +145 -0
  196. package/src/lib/components/image-popup/image-popup.component.html +11 -0
  197. package/src/lib/components/image-popup/image-popup.component.scss +5 -0
  198. package/src/lib/components/image-popup/image-popup.component.ts +18 -0
  199. package/src/lib/components/lib/custom-select/custom-select.component.html +42 -0
  200. package/src/lib/components/lib/custom-select/custom-select.component.scss +131 -0
  201. package/src/lib/components/lib/custom-select/custom-select.component.spec.ts +23 -0
  202. package/src/lib/components/lib/custom-select/custom-select.component.ts +151 -0
  203. package/src/lib/components/manage-task/manage-task.component.html +265 -0
  204. package/src/lib/components/manage-task/manage-task.component.scss +69 -0
  205. package/src/lib/components/manage-task/manage-task.component.spec.ts +23 -0
  206. package/src/lib/components/manage-task/manage-task.component.ts +267 -0
  207. package/src/lib/components/managechecklist/managechecklist.component.html +176 -0
  208. package/src/lib/components/managechecklist/managechecklist.component.scss +43 -0
  209. package/src/lib/components/managechecklist/managechecklist.component.spec.ts +23 -0
  210. package/src/lib/components/managechecklist/managechecklist.component.ts +176 -0
  211. package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.html +46 -0
  212. package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.scss +181 -0
  213. package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.spec.ts +23 -0
  214. package/src/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.ts +221 -0
  215. package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.html +36 -0
  216. package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.scss +89 -0
  217. package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.spec.ts +23 -0
  218. package/src/lib/components/multi-date-datepicker/multi-date-datepicker.component.ts +118 -0
  219. package/src/lib/components/orders/orders.component.html +203 -0
  220. package/src/lib/components/orders/orders.component.scss +180 -0
  221. package/src/lib/components/orders/orders.component.spec.ts +25 -0
  222. package/src/lib/components/orders/orders.component.ts +197 -0
  223. package/src/lib/components/pagination/pagination.component.html +28 -0
  224. package/src/lib/components/pagination/pagination.component.scss +6 -0
  225. package/src/lib/components/pagination/pagination.component.spec.ts +23 -0
  226. package/src/lib/components/pagination/pagination.component.ts +54 -0
  227. package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
  228. package/src/lib/components/reactive-select/reactive-select.component.scss +48 -0
  229. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
  230. package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
  231. package/src/lib/components/reports/date-picker/date-picker.component.html +54 -0
  232. package/src/lib/components/reports/date-picker/date-picker.component.scss +156 -0
  233. package/src/lib/components/reports/date-picker/date-picker.component.spec.ts +23 -0
  234. package/src/lib/components/reports/date-picker/date-picker.component.ts +60 -0
  235. package/src/lib/components/reports/reports.component.html +225 -0
  236. package/src/lib/components/reports/reports.component.scss +69 -0
  237. package/src/lib/components/reports/reports.component.spec.ts +23 -0
  238. package/src/lib/components/reports/reports.component.ts +334 -0
  239. package/{lib/components/reports/reports.interface.d.ts → src/lib/components/reports/reports.interface.ts} +50 -46
  240. package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.html +1 -0
  241. package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.scss +15 -0
  242. package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.spec.ts +23 -0
  243. package/src/lib/components/tango-analyse-trax/tango-analyse-trax.component.ts +31 -0
  244. package/src/lib/components/task/task.component.html +322 -0
  245. package/src/lib/components/task/task.component.scss +169 -0
  246. package/src/lib/components/task/task.component.spec.ts +23 -0
  247. package/src/lib/components/task/task.component.ts +340 -0
  248. package/src/lib/components/task-configure/task-configure.component.html +737 -0
  249. package/src/lib/components/task-configure/task-configure.component.scss +569 -0
  250. package/src/lib/components/task-configure/task-configure.component.spec.ts +23 -0
  251. package/src/lib/components/task-configure/task-configure.component.ts +1603 -0
  252. package/src/lib/components/task-configure/task-configure.interface.ts +138 -0
  253. package/src/lib/components/task-info/task-info.component.html +390 -0
  254. package/src/lib/components/task-info/task-info.component.scss +56 -0
  255. package/src/lib/components/task-info/task-info.component.spec.ts +23 -0
  256. package/src/lib/components/task-info/task-info.component.ts +400 -0
  257. package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.html +141 -0
  258. package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.scss +460 -0
  259. package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.spec.ts +23 -0
  260. package/src/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.ts +202 -0
  261. package/src/lib/components/task-layout/task-layout.component.html +1 -0
  262. package/src/lib/components/task-layout/task-layout.component.scss +0 -0
  263. package/src/lib/components/task-layout/task-layout.component.spec.ts +23 -0
  264. package/src/lib/components/task-layout/task-layout.component.ts +10 -0
  265. package/src/lib/components/task-logs/task-logs.component.html +97 -0
  266. package/src/lib/components/task-logs/task-logs.component.scss +301 -0
  267. package/src/lib/components/task-logs/task-logs.component.spec.ts +23 -0
  268. package/src/lib/components/task-logs/task-logs.component.ts +80 -0
  269. package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.html +84 -0
  270. package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.scss +229 -0
  271. package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.spec.ts +23 -0
  272. package/src/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.ts +111 -0
  273. package/src/lib/components/trax-store/trax-store.component.html +78 -0
  274. package/src/lib/components/trax-store/trax-store.component.scss +134 -0
  275. package/src/lib/components/trax-store/trax-store.component.spec.ts +23 -0
  276. package/src/lib/components/trax-store/trax-store.component.ts +172 -0
  277. package/src/lib/components/traxpopup/traxpopup.component.html +130 -0
  278. package/src/lib/components/traxpopup/traxpopup.component.scss +225 -0
  279. package/src/lib/components/traxpopup/traxpopup.component.spec.ts +23 -0
  280. package/src/lib/components/traxpopup/traxpopup.component.ts +71 -0
  281. package/src/lib/services/trax.service.spec.ts +16 -0
  282. package/src/lib/services/trax.service.ts +789 -0
  283. package/src/lib/tango-analyse-trax-routing.module.ts +151 -0
  284. package/src/lib/tango-analyse-trax.module.ts +140 -0
  285. package/{public-api.d.ts → src/public-api.ts} +6 -2
  286. package/tsconfig.lib.json +14 -0
  287. package/tsconfig.lib.prod.json +10 -0
  288. package/tsconfig.spec.json +14 -0
  289. package/esm2022/lib/components/action-centre/action-centre.component.mjs +0 -288
  290. package/esm2022/lib/components/activity-log/activity-log.component.mjs +0 -150
  291. package/esm2022/lib/components/activity-log-v2/activity-log-v2.component.mjs +0 -502
  292. package/esm2022/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.mjs +0 -114
  293. package/esm2022/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.mjs +0 -24
  294. package/esm2022/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.mjs +0 -126
  295. package/esm2022/lib/components/add-checklist/add-checklist.component.mjs +0 -2352
  296. package/esm2022/lib/components/add-checklist/checklist-popup/checklist-popup.component.mjs +0 -612
  297. package/esm2022/lib/components/add-checklist/counter/counter.component.mjs +0 -138
  298. package/esm2022/lib/components/add-multitask/add-multitask.component.mjs +0 -604
  299. package/esm2022/lib/components/add-multitask/ascending-validator.mjs +0 -11
  300. package/esm2022/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.mjs +0 -297
  301. package/esm2022/lib/components/add-multitask/create-task.data.mjs +0 -372
  302. package/esm2022/lib/components/add-multitask/create-task.interface.mjs +0 -2
  303. package/esm2022/lib/components/add-multitask/unique-string-validator.mjs +0 -10
  304. package/esm2022/lib/components/add-multitask/whitespace-validator.mjs +0 -10
  305. package/esm2022/lib/components/add-task/add-task.component.mjs +0 -561
  306. package/esm2022/lib/components/add-task/ascending-validator.mjs +0 -11
  307. package/esm2022/lib/components/add-task/create-task.data.mjs +0 -372
  308. package/esm2022/lib/components/add-task/create-task.interface.mjs +0 -2
  309. package/esm2022/lib/components/add-task/unique-string-validator.mjs +0 -10
  310. package/esm2022/lib/components/add-task/whitespace-validator.mjs +0 -10
  311. package/esm2022/lib/components/approval-popup/approval-popup.component.mjs +0 -30
  312. package/esm2022/lib/components/checklist/checklist.component.mjs +0 -327
  313. package/esm2022/lib/components/checklist-configure/assign/assign.component.mjs +0 -912
  314. package/esm2022/lib/components/checklist-configure/checklist-configure.component.mjs +0 -4161
  315. package/esm2022/lib/components/checklistlayout/checklistlayout.component.mjs +0 -44
  316. package/esm2022/lib/components/chip-dropdown/chip-dropdown.component.mjs +0 -120
  317. package/esm2022/lib/components/create-task/create-task.component.mjs +0 -585
  318. package/esm2022/lib/components/create-task/create-task.data.mjs +0 -372
  319. package/esm2022/lib/components/create-task/create-task.interface.mjs +0 -2
  320. package/esm2022/lib/components/create-task/validators/ascending-validator.mjs +0 -11
  321. package/esm2022/lib/components/create-task/validators/unique-string-validator.mjs +0 -10
  322. package/esm2022/lib/components/create-task/validators/whitespace-validator.mjs +0 -10
  323. package/esm2022/lib/components/custom-select/custom-select.component.mjs +0 -240
  324. package/esm2022/lib/components/dashboard/dashboard.component.mjs +0 -532
  325. package/esm2022/lib/components/dashboard-info/dashboard-info.component.mjs +0 -741
  326. package/esm2022/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.mjs +0 -155
  327. package/esm2022/lib/components/dashboard-layout/dashboard-layout.component.mjs +0 -12
  328. package/esm2022/lib/components/disabled-select/disabled-select.component.mjs +0 -158
  329. package/esm2022/lib/components/export-gallery/export-gallery.component.mjs +0 -266
  330. package/esm2022/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.mjs +0 -105
  331. package/esm2022/lib/components/eye-test-audit/custom-select/custom-select.component.mjs +0 -240
  332. package/esm2022/lib/components/eye-test-audit/eye-test/eye-test.component.mjs +0 -1733
  333. package/esm2022/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.mjs +0 -24
  334. package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.mjs +0 -34
  335. package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.mjs +0 -27
  336. package/esm2022/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.mjs +0 -71
  337. package/esm2022/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.mjs +0 -823
  338. package/esm2022/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.mjs +0 -412
  339. package/esm2022/lib/components/eye-test-audit/group-select/group-select.component.mjs +0 -157
  340. package/esm2022/lib/components/eye-test-audit/reactive-select/reactive-select.component.mjs +0 -105
  341. package/esm2022/lib/components/eye-test-audit/select-drop/select-drop.component.mjs +0 -162
  342. package/esm2022/lib/components/eye-test-audit/services/eye-test-audit.service.mjs +0 -166
  343. package/esm2022/lib/components/flag-layout/flag-layout.component.mjs +0 -12
  344. package/esm2022/lib/components/flags/flags.component.mjs +0 -263
  345. package/esm2022/lib/components/flags/flags.interface.mjs +0 -2
  346. package/esm2022/lib/components/flags-info/flags-info.component.mjs +0 -452
  347. package/esm2022/lib/components/flags-info/flags-info.interface.mjs +0 -2
  348. package/esm2022/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.mjs +0 -71
  349. package/esm2022/lib/components/flags-new/flags-new.component.mjs +0 -335
  350. package/esm2022/lib/components/flags-new/flags-new.interface.mjs +0 -2
  351. package/esm2022/lib/components/gallery/gallery.component.mjs +0 -3402
  352. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  353. package/esm2022/lib/components/image-popup/image-popup.component.mjs +0 -25
  354. package/esm2022/lib/components/lib/custom-select/custom-select.component.mjs +0 -158
  355. package/esm2022/lib/components/manage-task/manage-task.component.mjs +0 -264
  356. package/esm2022/lib/components/managechecklist/managechecklist.component.mjs +0 -186
  357. package/esm2022/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.mjs +0 -229
  358. package/esm2022/lib/components/multi-date-datepicker/multi-date-datepicker.component.mjs +0 -124
  359. package/esm2022/lib/components/orders/orders.component.mjs +0 -171
  360. package/esm2022/lib/components/pagination/pagination.component.mjs +0 -62
  361. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  362. package/esm2022/lib/components/reports/date-picker/date-picker.component.mjs +0 -60
  363. package/esm2022/lib/components/reports/reports.component.mjs +0 -300
  364. package/esm2022/lib/components/reports/reports.interface.mjs +0 -2
  365. package/esm2022/lib/components/tango-analyse-trax/tango-analyse-trax.component.mjs +0 -32
  366. package/esm2022/lib/components/task/task.component.mjs +0 -341
  367. package/esm2022/lib/components/task-configure/task-configure.component.mjs +0 -1532
  368. package/esm2022/lib/components/task-configure/task-configure.interface.mjs +0 -2
  369. package/esm2022/lib/components/task-info/task-info.component.mjs +0 -375
  370. package/esm2022/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.mjs +0 -208
  371. package/esm2022/lib/components/task-layout/task-layout.component.mjs +0 -12
  372. package/esm2022/lib/components/task-logs/task-logs.component.mjs +0 -104
  373. package/esm2022/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.mjs +0 -107
  374. package/esm2022/lib/components/trax-store/trax-store.component.mjs +0 -179
  375. package/esm2022/lib/components/traxpopup/traxpopup.component.mjs +0 -70
  376. package/esm2022/lib/services/trax.service.mjs +0 -559
  377. package/esm2022/lib/tango-analyse-trax-routing.module.mjs +0 -153
  378. package/esm2022/lib/tango-analyse-trax.module.mjs +0 -221
  379. package/esm2022/public-api.mjs +0 -6
  380. package/esm2022/tango-app-ui-analyse-trax.mjs +0 -5
  381. package/fesm2022/tango-app-ui-analyse-trax.mjs +0 -28896
  382. package/fesm2022/tango-app-ui-analyse-trax.mjs.map +0 -1
  383. package/index.d.ts +0 -5
  384. package/lib/components/action-centre/action-centre.component.d.ts +0 -68
  385. package/lib/components/activity-log/activity-log.component.d.ts +0 -39
  386. package/lib/components/activity-log-v2/activity-log-v2.component.d.ts +0 -78
  387. package/lib/components/activity-log-v2/log-view-popup/date-range-picker/date-range-picker.component.d.ts +0 -24
  388. package/lib/components/activity-log-v2/log-view-popup/store-user-dropdown/store-user-dropdown.component.d.ts +0 -9
  389. package/lib/components/activity-log-v2/log-view-popup/view-action/view-action.component.d.ts +0 -34
  390. package/lib/components/add-checklist/add-checklist.component.d.ts +0 -121
  391. package/lib/components/add-checklist/checklist-popup/checklist-popup.component.d.ts +0 -45
  392. package/lib/components/add-checklist/counter/counter.component.d.ts +0 -29
  393. package/lib/components/add-multitask/add-multitask.component.d.ts +0 -102
  394. package/lib/components/add-multitask/ascending-validator.d.ts +0 -2
  395. package/lib/components/add-multitask/bulkcreationmodel/bulkcreationmodel.component.d.ts +0 -45
  396. package/lib/components/add-multitask/create-task.data.d.ts +0 -293
  397. package/lib/components/add-multitask/create-task.interface.d.ts +0 -159
  398. package/lib/components/add-multitask/unique-string-validator.d.ts +0 -2
  399. package/lib/components/add-multitask/whitespace-validator.d.ts +0 -2
  400. package/lib/components/add-task/add-task.component.d.ts +0 -89
  401. package/lib/components/add-task/ascending-validator.d.ts +0 -2
  402. package/lib/components/add-task/create-task.data.d.ts +0 -293
  403. package/lib/components/add-task/create-task.interface.d.ts +0 -161
  404. package/lib/components/add-task/unique-string-validator.d.ts +0 -2
  405. package/lib/components/add-task/whitespace-validator.d.ts +0 -2
  406. package/lib/components/approval-popup/approval-popup.component.d.ts +0 -14
  407. package/lib/components/checklist/checklist.component.d.ts +0 -40
  408. package/lib/components/checklist-configure/assign/assign.component.d.ts +0 -105
  409. package/lib/components/checklist-configure/checklist-configure.component.d.ts +0 -325
  410. package/lib/components/checklistlayout/checklistlayout.component.d.ts +0 -15
  411. package/lib/components/chip-dropdown/chip-dropdown.component.d.ts +0 -28
  412. package/lib/components/create-task/create-task.component.d.ts +0 -76
  413. package/lib/components/create-task/create-task.data.d.ts +0 -293
  414. package/lib/components/create-task/create-task.interface.d.ts +0 -163
  415. package/lib/components/create-task/validators/ascending-validator.d.ts +0 -2
  416. package/lib/components/create-task/validators/unique-string-validator.d.ts +0 -2
  417. package/lib/components/create-task/validators/whitespace-validator.d.ts +0 -2
  418. package/lib/components/custom-select/custom-select.component.d.ts +0 -35
  419. package/lib/components/dashboard/dashboard.component.d.ts +0 -80
  420. package/lib/components/dashboard-info/dashboard-info.component.d.ts +0 -117
  421. package/lib/components/dashboard-info/monthlyperformance-datepicker/monthlyperformance-datepicker.component.d.ts +0 -41
  422. package/lib/components/dashboard-layout/dashboard-layout.component.d.ts +0 -5
  423. package/lib/components/disabled-select/disabled-select.component.d.ts +0 -34
  424. package/lib/components/export-gallery/export-gallery.component.d.ts +0 -44
  425. package/lib/components/eye-test-audit/chip-dropdown/chip-dropdown.component.d.ts +0 -26
  426. package/lib/components/eye-test-audit/custom-select/custom-select.component.d.ts +0 -35
  427. package/lib/components/eye-test-audit/eye-test/eye-test.component.d.ts +0 -218
  428. package/lib/components/eye-test-audit/eye-test/send-alert/send-alert.component.d.ts +0 -12
  429. package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit-routing.module.d.ts +0 -7
  430. package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.component.d.ts +0 -11
  431. package/lib/components/eye-test-audit/eye-test-audit/eye-test-audit.module.d.ts +0 -21
  432. package/lib/components/eye-test-audit/eye-test-audit/settings-audit/settings-audit.component.d.ts +0 -129
  433. package/lib/components/eye-test-audit/eye-test-audit/start-audit/start-audit.component.d.ts +0 -86
  434. package/lib/components/eye-test-audit/group-select/group-select.component.d.ts +0 -33
  435. package/lib/components/eye-test-audit/reactive-select/reactive-select.component.d.ts +0 -32
  436. package/lib/components/eye-test-audit/select-drop/select-drop.component.d.ts +0 -33
  437. package/lib/components/eye-test-audit/services/eye-test-audit.service.d.ts +0 -47
  438. package/lib/components/flag-layout/flag-layout.component.d.ts +0 -5
  439. package/lib/components/flags/flags.component.d.ts +0 -52
  440. package/lib/components/flags-info/flags-info.component.d.ts +0 -73
  441. package/lib/components/flags-info/flags-info.interface.d.ts +0 -430
  442. package/lib/components/flags-info/unattended-pie-chart/unattended-pie-chart.component.d.ts +0 -13
  443. package/lib/components/flags-new/flags-new.component.d.ts +0 -60
  444. package/lib/components/gallery/gallery.component.d.ts +0 -261
  445. package/lib/components/group-select/group-select.component.d.ts +0 -33
  446. package/lib/components/image-popup/image-popup.component.d.ts +0 -11
  447. package/lib/components/lib/custom-select/custom-select.component.d.ts +0 -33
  448. package/lib/components/manage-task/manage-task.component.d.ts +0 -47
  449. package/lib/components/managechecklist/managechecklist.component.d.ts +0 -33
  450. package/lib/components/multi-chip-dropdown/multi-chip-dropdown.component.d.ts +0 -40
  451. package/lib/components/multi-date-datepicker/multi-date-datepicker.component.d.ts +0 -27
  452. package/lib/components/orders/orders.component.d.ts +0 -38
  453. package/lib/components/pagination/pagination.component.d.ts +0 -16
  454. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  455. package/lib/components/reports/date-picker/date-picker.component.d.ts +0 -23
  456. package/lib/components/reports/reports.component.d.ts +0 -55
  457. package/lib/components/tango-analyse-trax/tango-analyse-trax.component.d.ts +0 -14
  458. package/lib/components/task/task.component.d.ts +0 -70
  459. package/lib/components/task-configure/task-configure.component.d.ts +0 -142
  460. package/lib/components/task-configure/task-configure.interface.d.ts +0 -128
  461. package/lib/components/task-info/task-info.component.d.ts +0 -76
  462. package/lib/components/task-info/taskinfo-edit/taskinfo-edit.component.d.ts +0 -61
  463. package/lib/components/task-layout/task-layout.component.d.ts +0 -5
  464. package/lib/components/task-logs/task-logs.component.d.ts +0 -27
  465. package/lib/components/trax-run-ai-popup/trax-run-ai-popup.component.d.ts +0 -26
  466. package/lib/components/trax-store/trax-store.component.d.ts +0 -45
  467. package/lib/components/traxpopup/traxpopup.component.d.ts +0 -24
  468. package/lib/services/trax.service.d.ts +0 -175
  469. package/lib/tango-analyse-trax-routing.module.d.ts +0 -7
  470. package/lib/tango-analyse-trax.module.d.ts +0 -68
@@ -0,0 +1,932 @@
1
+ import { Component, OnInit, ViewChild, ElementRef, ChangeDetectorRef, OnDestroy, Input, SimpleChanges, OnChanges, Output, EventEmitter,HostListener } from '@angular/core';
2
+ import dayjs from 'dayjs';
3
+ import { TraxService } from '../../../services/trax.service';
4
+ import { ToastService } from 'tango-app-ui-shared';
5
+ import { ActivatedRoute, Router } from '@angular/router';
6
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
7
+ import * as XLSX from 'xlsx';
8
+ import { Subject, takeUntil } from 'rxjs';
9
+
10
+ @Component({
11
+ selector: 'lib-assign',
12
+ templateUrl: './assign.component.html',
13
+ styleUrl: './assign.component.scss'
14
+ })
15
+ export class AssignComponent implements OnInit, OnDestroy, OnChanges {
16
+
17
+ @ViewChild('file') fileInput!: ElementRef;
18
+ @ViewChild('file1') fileInput1!: ElementRef;
19
+ @ViewChild('bulkupload') bulkupload: any;
20
+ @ViewChild('afterValidation') afterValidation: any;
21
+ @ViewChild('confirmUser') confirmUser: any;
22
+ @Input() configData: any;
23
+ @Input() uploadData: boolean;
24
+ @Input() configureType: any;
25
+ dayjs: any = dayjs;
26
+ tableData: any = [];
27
+ tableLoading: any = false;
28
+ pageValue: any = [];
29
+ offset: number = 0;
30
+ recordsTotal: any = 0;
31
+ sortColumn: any = '';
32
+ sortBy: any = -1;
33
+ assignType: any = 'store';
34
+ size: any = 5;
35
+ offsetvalue: number = 0;
36
+ recordsCount: any;
37
+ serData: any = [];
38
+ excelUserData: any = [];
39
+ showImage: boolean = true;
40
+ clientId: any;
41
+ type: string = 'custom';
42
+ obj: any;
43
+ tableFilter: any = '';
44
+ disabledQuestion: boolean = false;
45
+ assignSingle: any; assignGroup: any;
46
+ singleAssign: any;
47
+ groupAssign: any;
48
+ paginationSize = [5, 10, 15, 20];
49
+ userData: any = [];
50
+ idList: any = [];
51
+ tableArray: any = [];
52
+ storeList: any = [];
53
+ private detach = new Subject();
54
+ tableLoading1: boolean = false;
55
+ currentValue: any = 1;
56
+ showEdit: boolean = false;
57
+ upload: any;
58
+ reupload: boolean = false;
59
+ userCoverage: boolean = true;
60
+ storeCoverage: boolean = false;
61
+ configstore: any = [];
62
+ InialType: any;
63
+ checklistId: any;
64
+ @Output() dataToParent = new EventEmitter<boolean>();
65
+
66
+ constructor(private SopService: TraxService, private dialog: NgbModal, private router: ActivatedRoute, private route: Router, private toast: ToastService, private changedetector: ChangeDetectorRef) {
67
+ }
68
+
69
+ ngOnInit(): void {
70
+ this.configstore = this.configData.storeList;
71
+ this.InialType = this.configData.aiConfig.assignConfig;
72
+ let storageDetails = JSON.parse(localStorage.getItem('header-filters') || '{}');
73
+ if (!storageDetails?.client) {
74
+ storageDetails = JSON.parse(localStorage.getItem('client-details') || '{}');
75
+ storageDetails.client = storageDetails.clientId;
76
+ }
77
+ if (storageDetails?.client) {
78
+ this.clientId = storageDetails.client;
79
+ this.router.queryParams.subscribe(params => {
80
+ if (typeof params.type == 'undefined') {
81
+ this.obj = {
82
+ checkListId: params.checkListId,
83
+ clientId: this.clientId
84
+ }
85
+ this.showEdit = params.showEdit;
86
+ this.type = 'custom'
87
+ this.disabledQuestion = params.disabledQuestion;
88
+ }
89
+ else {
90
+ this.obj = {
91
+ type: params.type,
92
+ clientId: this.clientId
93
+ }
94
+ this.type = params.type;
95
+ }
96
+ })
97
+ }
98
+ this.getassignDropdown();
99
+ }
100
+
101
+ ngOnChanges(changes: SimpleChanges): void {
102
+
103
+ if (changes['uploadData']) {
104
+ if (this.uploadData) {
105
+ this.fileInput.nativeElement.click();
106
+ this.uploadData = false;
107
+ this.dataToParent.emit(this.uploadData);
108
+ }
109
+ }
110
+ if (changes['configureType']) {
111
+ if (typeof this.InialType != 'undefined' && typeof this.configureType != 'undefined' && this.InialType == this.configureType) {
112
+ this.assignSingle = this.configstore;
113
+ this.tableArray = this.configstore;
114
+ this.configData.storeList = this.configstore;
115
+ } else if (typeof this.configureType != 'undefined' && this.configureType == 'global') {
116
+ this.tableArray = [];
117
+ this.assignSingle = [];
118
+ this.configData.storeList = [];
119
+ }
120
+ this.upload = 'store';
121
+ this.getTableData();
122
+ }
123
+ }
124
+
125
+ coverage: any;
126
+
127
+ getConfigData() {
128
+ // console.log('assignConfig',this.configData.aiConfig.assignConfig)
129
+ // this.checklistId = this.configData.checkListDetails._id;
130
+ // this.type = this.configData.checkListDetails.checkListType;
131
+ // this.configData.aiConfig.storeList = [];
132
+ // this.coverage = this.configData.checkListDetails.coverage;
133
+ }
134
+
135
+ ngOnDestroy(): void {
136
+ this.detach.next(true);
137
+ this.detach.complete();
138
+ }
139
+
140
+ getInitialData(data: any, change?: any) {
141
+ // let tempId = data.map((el: any) => el?.id)
142
+ // let res = this.configData.storeList.filter((el: any) => tempId.includes(el?._id));
143
+ this.configData?.storeList.forEach((element: any) => element.isSelected = true);
144
+ // this.configData.aiConfig.storeList = res;
145
+ if (this.assignType === 'store') {
146
+ this.tableLoading = false;
147
+ this.tableLoading1 = false;
148
+ this.showImage = true;
149
+ // this.userDetails(),
150
+ // (this.assignType === 'store' && this.initialLoading) ? (this.initialLoading = false) : this.getTableData(change ? change : '');
151
+ this.idList = this.singleAssign;
152
+ } else {
153
+ this.idList = this.groupAssign;
154
+ this.userDetailsV2();
155
+ }
156
+ }
157
+
158
+ userDetailsV2(data?: any) {
159
+ const payload = {
160
+ "checklistId": this.checklistId,
161
+ "idList": this.idList,
162
+ "coverage": this.coverage, //["cluster","store","user","teams"]
163
+ "clientId": this.clientId,
164
+ "search": this.tableFilter
165
+ }
166
+ this.tableLoading = true;
167
+ this.tableLoading1 = true;
168
+ this.showImage = true;
169
+ this.tableArray = [];
170
+ this.tableData = [];
171
+ this.SopService.selectChips(payload).pipe(takeUntil(this.detach)).subscribe({
172
+ next: (res: any) => {
173
+ if (res && res?.code === 200) {
174
+ this.tableLoading = false;
175
+ this.tableLoading1 = false;
176
+ this.tableArray = res?.data?.uniqueArr;
177
+ this.assignGroup = this.tableArray;
178
+ this.recordsTotal = res.data.count;
179
+ this.recordsCount = this.tableData.length;
180
+ this.tableArray?.length ? this.showImage = false : this.showImage = true;
181
+ if (this.recordsTotal < 5) {
182
+ this.paginationSize = [this.recordsTotal];
183
+ this.size = this.recordsTotal;
184
+ }
185
+ else {
186
+ this.paginationSize = [5, 10, 15, 20];
187
+ this.size = 5;
188
+ }
189
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
190
+ }
191
+ else {
192
+ this.tableArray = [];
193
+ this.tableData = [];
194
+ this.showImage = true;
195
+ this.tableLoading = true;
196
+ }
197
+ // this.storeCoverage ? this.getInitialData(res?.data?.storeList) : this.getInitialData(res?.data?.userList);
198
+ },
199
+ error: (err: any) => {
200
+ this.tableLoading = false;
201
+ this.tableLoading1 = false;
202
+ this.showImage = false;
203
+ this.tableArray = [];
204
+ this.tableData = [];
205
+ this.toast.getErrorToast(err?.message)
206
+ },
207
+ })
208
+ }
209
+
210
+ getTableData(change?: any) {
211
+ let count = 0;
212
+ if (this.assignSingle?.length) {
213
+ if (this.configData.storeList.length != this.assignSingle.length) {
214
+ count++;
215
+ }
216
+ this.configData.storeList.forEach((assign: any) => {
217
+ let findList = this.assignSingle.filter((item: any) => item.storeId == assign.storeId);
218
+ if (findList.length) {
219
+ if (findList.length > 1) {
220
+ count++;
221
+ }
222
+ else {
223
+ // if (assign.userEmail.toLowerCase() != findList[0].userEmail.toLowerCase()) {
224
+ // assign.userEmail = findList[0].userEmail;
225
+ // assign.userName = findList[0].userName;
226
+ // count++;
227
+ // }
228
+ }
229
+ }
230
+ })
231
+ if (count) {
232
+ this.upload = change ? 'upload' : 'store';
233
+ }
234
+ }
235
+ // this.tableArray = this.assignSingle ? this.assignSingle : this.configData.storeList;
236
+
237
+ change ? this.tableArray = this.assignSingle : [];
238
+ if (this.upload === 'store') {
239
+ let table = [...this.tableArray, ...this.configData.storeList];
240
+ let uniqueTable = new Map();
241
+ // Convert objects to JSON strings for full comparison
242
+ table.forEach((item: any) => {
243
+ if (this.configData?.aiConfig?.assignConfig === 'store') {
244
+ item = {
245
+ storeName: item?.storeName,
246
+ storeId: item.storeId,
247
+ openTime: item.openTime,
248
+ closeTime: item.closeTime,
249
+ startTime1: item.startTime1,
250
+ startTime2: item.startTime2,
251
+ startTime3: item.startTime3,
252
+ configTime1: item.configTime1,
253
+ configTime2: item.configTime2,
254
+ configTime3: item.configTime3,
255
+ _id: item._id
256
+ }
257
+ } else {
258
+ item = {
259
+ storeName: item?.storeName,
260
+ storeId: item.storeId,
261
+ openTime: item.openTime,
262
+ closeTime: item.closeTime,
263
+ _id: item._id
264
+ }
265
+ }
266
+ let data = {
267
+ _id: item._id,
268
+ storeName: item?.storeName,
269
+ storeId: item.storeId
270
+ }
271
+ let key = JSON.stringify(data); // Convert entire object to string as a key
272
+ if (!uniqueTable.has(data)) {
273
+ uniqueTable.set(key, item); // Store the object only if it's completely unique
274
+ }
275
+ });
276
+ this.assignSingle = Array.from(uniqueTable.values());
277
+ if (this.configData?.aiConfig?.assignConfig === 'store') {
278
+ this.assignSingle = this.assignSingle.filter((el: any) => (el?.startTime1 || el?.startTime2 || el?.startTime3));
279
+ }
280
+ this.tableArray = this.assignSingle;
281
+ } else if (this.upload === 'upload') {
282
+ this.tableArray = this.assignSingle;
283
+ } else {
284
+ this.tableArray = this.configData.storeList;
285
+ this.assignSingle = this.tableArray;
286
+ }
287
+
288
+ this.tableArray?.length ? this.showImage = false : this.showImage = true;
289
+ this.recordsTotal = this.tableArray.length;
290
+ if (this.recordsTotal < 5) {
291
+ this.paginationSize = [this.recordsTotal];
292
+ this.size = this.recordsTotal;
293
+ }
294
+ else {
295
+ this.paginationSize = [5, 10, 15, 20];
296
+ this.size = 5;
297
+ }
298
+ this.tableLoading1 = false;
299
+ this.tableLoading = false;
300
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
301
+ }
302
+
303
+ excelData: any;
304
+ showStore: boolean = false;
305
+
306
+ onFileUpload(event: any, reupload?: any) {
307
+ this.validatedStore = [];
308
+ this.inactiveStores = [];
309
+ this.showStore = false;
310
+ this.showInactive = false;
311
+ this.currentValue = 1;
312
+ this.reupload = false;
313
+ this.upload = 'upload';
314
+ this.userData = this.excelUserData = [];
315
+ let data: any;
316
+ const target: DataTransfer = <DataTransfer>(event.target);
317
+ let isExcelFile = !!target.files[0].name.match(/(.xls|.xlsx)/);
318
+ let error: any = [];
319
+ let ValidationError: boolean = false;
320
+ if (isExcelFile) {
321
+ const reader: FileReader = new FileReader();
322
+ reader.readAsBinaryString(target.files[0]);
323
+ reader.onload = (e: any) => {
324
+ const bstr: string = e.target.result;
325
+ const wb: XLSX.WorkBook = XLSX.read(bstr, { type: 'binary' });
326
+ const wsname: string = wb.SheetNames[0];
327
+ const ws: XLSX.WorkSheet = wb.Sheets[wsname];
328
+ data = XLSX.utils.sheet_to_json(ws, { defval: '' });
329
+ this.excelData = data;
330
+ if (!data.length || (data.some((item: any) => 'userName' in item || 'userEmail' in item))) {
331
+ this.toast.getErrorToast('Please Upload a Valid file.')
332
+ return;
333
+ }
334
+
335
+ if (data.length && this.configData?.aiConfig?.assignConfig === 'store' && (data.every((item: any) => item['Huddle Start Time 1'] == '' && item['Configuration Time 1(mins)'] == ''))) {
336
+ this.toast.getErrorToast('Please Set Huddle Start Time 1 and Configuration Time 1(mins) for atleast one store')
337
+ return;
338
+ }
339
+
340
+ const requiredKeys = this.configData?.aiConfig?.assignConfig === 'store' ? ['Store Name', 'Open Time', 'Close Time', 'Huddle Start Time 1', 'Configuration Time 1(mins)', 'Huddle Start Time 2', 'Configuration Time 2(mins)', 'Huddle Start Time 3', 'Configuration Time 3(mins)'] : ['Store Name', 'Open Time', 'Close Time', 'Assigned Status(true)'];
341
+ const isValid = data.every((item: any) => {
342
+ const keys = Object.keys(item);
343
+ const hasRequiredKeys = requiredKeys.every(key => keys.includes(key));
344
+ const allKeysAreAllowed = keys.every(key =>
345
+ requiredKeys.includes(key)
346
+ );
347
+ return hasRequiredKeys && allKeysAreAllowed;
348
+ });
349
+
350
+ if (!isValid) {
351
+ this.toast.getErrorToast('Please Upload a Valid file.');
352
+ return;
353
+ }
354
+
355
+ data.forEach((element: any, index: any) => {
356
+ if ((element['Store Name'] && element['Store Name']?.trim() == '') || element['Store Name'] == null) {
357
+ error.push(`Invalid Store Name - A${index + 2}`)
358
+ }
359
+ if ((element['Store Name'] && element['Store Name']?.trim() != '') || element['Store Name'] != null) {
360
+ let findStore = this.storeList.find((ele: any) => ele.storeName.toLowerCase() == element?.['Store Name'].toLowerCase());
361
+
362
+ if (findStore) {
363
+ element['Open Time'] = findStore?.openTime
364
+ element['Close Time'] = findStore?.closeTime
365
+ }
366
+ else {
367
+ error.push(`New Store Name -A${index + 2},${element['Store Name']}`)
368
+ }
369
+ }
370
+ if (this.configData?.aiConfig?.assignConfig === 'store') {
371
+ if (element['Huddle Start Time 1'] && !element['Configuration Time 1(mins)']) {
372
+ error.push(`Invalid Configuration Time 1(mins) - D${index + 2}`)
373
+ }
374
+ if (element['Huddle Start Time 2'] && !element['Configuration Time 2(mins)']) {
375
+ error.push(`Invalid Configuration Time 2(mins) - E${index + 2}`)
376
+ }
377
+ if (element['Huddle Start Time 3'] && !element['Configuration Time 3(mins)']) {
378
+ error.push(`Invalid Configuration Time 3(mins) - F${index + 2}`)
379
+ }
380
+ }
381
+
382
+ if (this.configData?.aiConfig?.assignConfig === 'store') {
383
+ this.userData.push({
384
+ 'storeName': element['Store Name'],
385
+ 'openTime': element['Open Time'],
386
+ 'closeTime': element['Close Time'],
387
+ 'startTime1': formatExcelTime(element['Huddle Start Time 1']),
388
+ 'configTime1': element['Configuration Time 1(mins)'],
389
+ 'startTime2': formatExcelTime(element['Huddle Start Time 2']),
390
+ 'configTime2': element['Configuration Time 2(mins)'],
391
+ 'startTime3': formatExcelTime(element['Huddle Start Time 3']),
392
+ 'configTime3': element['Configuration Time 3(mins)']
393
+ })
394
+ } else {
395
+ this.userData.push({
396
+ 'storeName': element['Store Name'],
397
+ 'openTime': element['Open Time'],
398
+ 'closeTime': element['Close Time'],
399
+ 'isSelected': element['Assigned Status(true)']
400
+ })
401
+ }
402
+ })
403
+
404
+
405
+ if (error.length) {
406
+ this.dialog.dismissAll();
407
+ const popupcontent = {
408
+ displayprop: false,
409
+ 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>`,
410
+ title: `Invalid details!`,
411
+ content: `Please provide correct and complete store information.`,
412
+ buttontype: 'error',
413
+ error: error
414
+ }
415
+ this.afterUplload(popupcontent)
416
+ return;
417
+ }
418
+ else {
419
+ !ValidationError ? this.afterUplload() : '';
420
+ }
421
+ if (this.fileInput) {
422
+ this.fileInput.nativeElement.value = '';
423
+ }
424
+ if (this.fileInput1) {
425
+ this.fileInput1.nativeElement.value = '';
426
+ }
427
+ };
428
+ }
429
+ else {
430
+ if (this.fileInput) {
431
+ this.fileInput.nativeElement.value = '';
432
+ }
433
+ if (this.fileInput1) {
434
+ this.fileInput1.nativeElement.value = '';
435
+ }
436
+ this.toast.getErrorToast('Please Upload a Excel file.');
437
+ }
438
+ }
439
+
440
+ Reupload() {
441
+ // this.dialog.dismissAll();
442
+ this.validatedStore = [];
443
+ this.inactiveStores = [];
444
+ this.showStore = false;
445
+ this.showInactive = false;
446
+ if (this.fileInput) {
447
+ this.fileInput.nativeElement.value = '';
448
+ }
449
+ if (this.fileInput1) {
450
+ this.fileInput1.nativeElement.value = '';
451
+ }
452
+ let ele = document.getElementById('kt_account_team_size_select_2');
453
+ ele?.click();
454
+ this.changedetector.detectChanges();
455
+ }
456
+
457
+ validatedStore: any = [];
458
+ inactiveStores: any = [];
459
+ showInactive: any = false;
460
+
461
+ validateDetails() {
462
+ let params: any = {
463
+ checklistId: this.checklistId,
464
+ assignedUsers: this.userData,
465
+ clientId: this.clientId,
466
+ coverage: this.coverage
467
+ }
468
+ this.SopService.validateUserv1(params).pipe(takeUntil(this.detach)).subscribe({
469
+ next: (res: any) => {
470
+ if (res && res?.code == 200) {
471
+ if (this.upload === 'store') {
472
+ this.tableArray.unshift(...res?.data?.data);
473
+ this.configData.storeList = this.tableArray;
474
+ let data = this.tableArray.map((el: any) => {
475
+ return { id: el?._id, type: el?.type }
476
+ })
477
+ this.idList = data;
478
+ this.singleAssign = this.idList;
479
+ this.assignType === 'user' ? this.getassignDropdown('change') : '';
480
+ this.getTableData();
481
+ } else {
482
+ this.tableArray = [];
483
+ this.tableLoading = true;
484
+ this.tableArray = res?.data?.data;
485
+ this.assignSingle = res?.data?.data;
486
+ this.configData.storeList = this.tableArray;
487
+ let data = res?.data?.data.map((el: any) => {
488
+ return { id: el?._id, type: el?.type }
489
+ })
490
+ this.idList = data;
491
+ this.singleAssign = this.idList;
492
+ this.tableLoading = false;
493
+ this.assignType === 'user' ? this.getassignDropdown('change') : '';
494
+ this.getTableData();
495
+ }
496
+ this.dialog.dismissAll();
497
+ }
498
+ },
499
+ error: (err: any) => {
500
+ if (err?.error?.error && err?.error?.code == 400) {
501
+ let errorData = err?.error?.error;
502
+ this.excelData = errorData?.data;
503
+ this.userData = errorData?.data;
504
+ if (errorData.existEmail?.length) {
505
+ this.toast.getErrorToast(`Already ${errorData.existEmail.toString()} assigned to another client`)
506
+ } else if (errorData.store?.length && !errorData.existEmail?.length) {
507
+ this.validatedStore = errorData?.store;
508
+ this.showStore = true;
509
+ this.afterUplload();
510
+ } else if (errorData.store?.length && errorData.existEmail?.length) {
511
+ !errorData?.inActiveStores?.length ? this.dialog.dismissAll() : '';
512
+ this.toast.getErrorToast(`Already ${errorData.store.toString()} assigned to another client`)
513
+ } else if (errorData?.inActiveStores?.length) {
514
+ this.inactiveStores = errorData?.inActiveStores;
515
+ this.showInactive = true;
516
+ this.afterUplload();
517
+ } else if (errorData?.user?.length && !errorData?.existEmail?.length) {
518
+ if (this.upload === 'store') {
519
+ this.confirmUserpopup();
520
+ } else {
521
+ this.afterUplload();
522
+ }
523
+ } else if (errorData?.user?.length && errorData?.existEmail?.length) {
524
+ this.dialog.dismissAll();
525
+ this.toast.getErrorToast(`Already ${errorData?.user.toString()} assigned to another client`)
526
+ }
527
+ if (errorData?.duplicates?.length) {
528
+ this.dialog.dismissAll();
529
+ this.toast.getErrorToast(`${errorData?.duplicates?.toString()} - ${errorData?.message}`)
530
+ }
531
+ }
532
+ },
533
+ })
534
+
535
+ }
536
+
537
+ closeactivepopup() {
538
+ this.dialog.dismissAll();
539
+ }
540
+
541
+ searchKey: any = [];
542
+
543
+ getassignDropdown(change?: any) {
544
+
545
+ let data = {
546
+ "clientId": this.clientId,
547
+ "coverage": 'store',
548
+ "assignType": this.assignType
549
+ }
550
+ this.storeList = [];
551
+ this.SopService.getassignDropdown(data).pipe(takeUntil(this.detach)).subscribe((res: any) => {
552
+ if (res && res.code == 200 && res.data.data.length) {
553
+ this.storeList = res?.data?.data;
554
+ if (data?.coverage === 'store') {
555
+ this.searchKey = ['storeName', 'storeId']
556
+ }
557
+ !change ? this.getInitialData((this.assignType === 'store') ? this.singleAssign : this.groupAssign, change ? change : '') : '';
558
+ this.changedetector.detectChanges();
559
+ }
560
+ else {
561
+ this.storeList = [];
562
+ this.tableArray = [];
563
+ this.tableData = [];
564
+ this.tableLoading1 = false;
565
+ this.tableLoading = false;
566
+ }
567
+ });
568
+ }
569
+
570
+ getStoreCounts(data: any) {
571
+ console.log("🚀 ~ AssignComponent ~ getStoreCounts ~ data:", data)
572
+ // if (this.storeCoverage) {
573
+ const uniqueStoreNames = new Set(data?.map((item: any) => item['Store Name']));
574
+ console.log("🚀 ~ AssignComponent ~ getStoreCounts ~ uniqueStoreNames:", uniqueStoreNames)
575
+ return uniqueStoreNames.size;
576
+ // } else if (this.userCoverage) {
577
+ // const uniqueUserNames = new Set(data?.map((item:any) => item.userName));
578
+ // return uniqueUserNames.size;
579
+ // }
580
+ }
581
+
582
+ userDetails() {
583
+ this.size = 5;
584
+ this.tableLoading = true;
585
+ let params = {
586
+ id: this.checklistId,
587
+ clientId: this.clientId
588
+ }
589
+ this.SopService.getUserDetailsV1(params).pipe(takeUntil(this.detach)).subscribe((res: any) => {
590
+ this.tableLoading = false;
591
+ let count = 0;
592
+ if (res == null) {
593
+ this.showImage = true;
594
+ if (this.tableFilter.length)
595
+ this.showImage = false;
596
+ this.tableLoading1 = false;
597
+ this.tableArray = [];
598
+ this.tableData = [];
599
+ }
600
+ if (res && res.code == 200) {
601
+ this.showImage = false;
602
+ this.tableLoading = false;
603
+ this.tableLoading1 = false;
604
+ if (this.storeCoverage) {
605
+ this.tableArray = res.data.userDetails.filter((el: any) => el?.clusterName == '' && el?.storeId != '');
606
+ this.assignGroup = res.data.userDetails.filter((el: any) => el?.clusterName !== '');
607
+ } else if (this.userCoverage) {
608
+ this.tableArray = res.data.userDetails.filter((el: any) => el?.teamName == '' && el?.userName != '');
609
+ this.assignGroup = res.data.userDetails.filter((el: any) => el?.teamName !== '');
610
+ }
611
+ this.assignSingle = this.tableArray;
612
+ this.recordsTotal = this.tableArray.length;
613
+ // this.recordsTotal = res.data.count;
614
+ if (this.recordsTotal < 5) {
615
+ this.paginationSize = [this.recordsTotal];
616
+ this.size = this.recordsTotal;
617
+ }
618
+ else {
619
+ this.paginationSize = [5, 10, 15, 20];
620
+ this.size = 5;
621
+ }
622
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
623
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
624
+
625
+ // this.getInitialData();
626
+ }
627
+ })
628
+ }
629
+
630
+ downloadTemplateV2() {
631
+ let excelData: any = [];
632
+ this.storeList.forEach((el: any) => {
633
+ excelData.push({
634
+ 'Store Name': el.storeName,
635
+ 'Open Time': el.openTime,
636
+ 'Close Time': el.closeTime,
637
+ ...(this.configData?.aiConfig?.assignConfig === 'store') ? { 'Huddle Start Time 1': '', 'Configuration Time 1(mins)': '', 'Huddle Start Time 2': '', 'Configuration Time 2(mins)': '', 'Huddle Start Time 3': '', 'Configuration Time 3(mins)': '' } : { 'Assigned Status(true)': false }
638
+ })
639
+ });
640
+ if (this.tableArray.length) {
641
+ this.tableArray.forEach((element: any) => {
642
+ let findStore = excelData.findIndex((ele: any) => ele['Store Name'] == element.storeName);
643
+ if (findStore >= 0) {
644
+ if (this.configData?.aiConfig?.assignConfig === 'store') {
645
+ excelData[findStore]['Huddle Start Time 1'] = element.startTime1;
646
+ excelData[findStore]['Configuration Time 1(mins)'] = element.configTime1;
647
+ excelData[findStore]['Huddle Start Time 2'] = element.startTime2;
648
+ excelData[findStore]['Configuration Time 2(mins)'] = element.configTime2;
649
+ excelData[findStore]['Huddle Start Time 3'] = element.startTime3;
650
+ excelData[findStore]['Configuration Time 3(mins)'] = element.configTime3;
651
+ }
652
+ else {
653
+ excelData[findStore]['Assigned Status(true)'] = true;
654
+ }
655
+ }
656
+ });
657
+ }
658
+
659
+ // Create a worksheet from the data
660
+ const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(excelData);
661
+
662
+ // Get the range of the worksheet
663
+ const range = XLSX.utils.decode_range(worksheet['!ref'] as string);
664
+ for (let rowNum = range.s.r; rowNum <= range.e.r; rowNum++) {
665
+ for (let colNum = range.s.c; colNum <= range.e.c; colNum++) {
666
+ const cellAddress = XLSX.utils.encode_cell({ r: rowNum, c: colNum });
667
+
668
+ if (worksheet[cellAddress]) {
669
+ worksheet[cellAddress].s = worksheet[cellAddress].s || {};
670
+ worksheet[cellAddress].s.protection = { locked: false }; // ✅ editable
671
+ }
672
+ }
673
+ }
674
+ const readOnlyStyle = {
675
+ font: { bold: true, color: { rgb: "FF0000" } },
676
+ fill: { fgColor: { rgb: "F5F5F5" } },
677
+ border: {
678
+ top: { style: "thin", color: { rgb: "AAAAAA" } },
679
+ bottom: { style: "thin", color: { rgb: "AAAAAA" } },
680
+ left: { style: "thin", color: { rgb: "AAAAAA" } },
681
+ right: { style: "thin", color: { rgb: "AAAAAA" } },
682
+ },
683
+ protection: { locked: false }, // ✅ non-editable
684
+ };
685
+
686
+ // Start from row 2 (skip header row)
687
+ for (let rowNum = range.s.r + 1; rowNum <= range.e.r; rowNum++) {
688
+ const openCell = XLSX.utils.encode_cell({ r: rowNum, c: 1 }); // B
689
+ const closeCell = XLSX.utils.encode_cell({ r: rowNum, c: 2 }); // C
690
+
691
+ if (worksheet[openCell]) worksheet[openCell].s = readOnlyStyle;
692
+ if (worksheet[closeCell]) worksheet[closeCell].s = readOnlyStyle;
693
+ }
694
+
695
+
696
+ // Create a workbook and add the worksheet
697
+ const workbook: XLSX.WorkBook = {
698
+ Sheets: { Sheet1: worksheet },
699
+ SheetNames: ['Sheet1'],
700
+ };
701
+
702
+ // Generate and save the Excel file
703
+ const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
704
+
705
+
706
+ this.SopService.saveAsExcelFile(excelBuffer, `CheckList_${this.configData?.aiConfig?.assignConfig ? this.configData?.aiConfig?.assignConfig : this.type}_`);
707
+ }
708
+
709
+ onPageChange(event: any) {
710
+ this.tableData = [];
711
+ this.tableLoading = true;
712
+ this.currentValue = event;
713
+
714
+ if (this.tableFilter) {
715
+ // this.searchTableData();
716
+ this.recordsTotal = this.searchTable.length;
717
+ if (this.recordsTotal < 5) {
718
+ this.paginationSize = [this.recordsTotal];
719
+ this.size = this.recordsTotal;
720
+ }
721
+ else {
722
+ this.paginationSize = [5, 10, 15, 20];
723
+ this.size = 5;
724
+ }
725
+ this.tableData = this.searchTable.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
726
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
727
+ } else {
728
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
729
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
730
+ }
731
+ this.changedetector.detectChanges();
732
+ }
733
+
734
+ onPageSizeChange(event: any) {
735
+ this.size = event;
736
+ this.tableLoading = true;
737
+ this.tableData = [];
738
+ this.currentValue = 1;
739
+
740
+ if (this.tableFilter) {
741
+ this.recordsTotal = this.searchTable.length;
742
+ if (this.recordsTotal < 5) {
743
+ this.paginationSize = [this.recordsTotal];
744
+ this.size = this.recordsTotal;
745
+ }
746
+ else {
747
+ this.paginationSize = [5, 10, 15, 20];
748
+ }
749
+ this.tableData = this.searchTable.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
750
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
751
+
752
+ } else {
753
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
754
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
755
+ }
756
+ }
757
+
758
+ dropDown: boolean = false;
759
+ openDropdown(event: any) {
760
+ event.stopPropagation();
761
+ this.dropDown = !this.dropDown;
762
+ }
763
+ @HostListener('document:click')
764
+ closeDropdown() {
765
+ this.dropDown = false;
766
+ }
767
+
768
+ searchTable: any;
769
+ searchTableData() {
770
+ this.tableData = [];
771
+ this.size = 5;
772
+ this.currentValue = 1;
773
+ this.tableLoading = true;
774
+ let searchField: any = ['storeName', 'openTime', 'closeTime'];
775
+
776
+ if (!this.tableFilter) {
777
+ (this.assignType === 'store') ? this.getTableData() : this.userDetailsV2();
778
+ } else {
779
+ const searchData = this.tableFilter.toLowerCase();
780
+ const searchTerm = searchData.split(',').map((el: any) => el.trim());
781
+ this.searchTable = this.tableArray?.filter((item: any) =>
782
+ searchField.some((field: any) => searchTerm.some((term: any) => item[field]?.toLowerCase().includes(term))));
783
+ this.recordsTotal = this.searchTable.length;
784
+ if (this.recordsTotal < 5) {
785
+ this.paginationSize = [this.recordsTotal];
786
+ this.size = this.recordsTotal;
787
+ }
788
+ else {
789
+ this.paginationSize = [5, 10, 15, 20];
790
+ this.size = 5;
791
+ }
792
+ this.tableData = this.searchTable.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
793
+ }
794
+ this.tableData ? this.tableLoading = false : this.tableLoading = true;
795
+ }
796
+
797
+ sortData(value: any) {
798
+ this.sortColumn = value;
799
+ this.sortBy *= -1;
800
+ const sortBy = parseInt(this.sortBy, 10) === -1 ? -1 : 1;
801
+ this.tableArray.sort((a: any, b: any) => {
802
+ return sortBy * (a[this.sortColumn] || '').localeCompare(b[this.sortColumn] || '');
803
+ });
804
+
805
+ this.tableData = this.tableArray.slice((this.currentValue * this.size) - this.size, this.currentValue * this.size);
806
+ }
807
+
808
+ updateAssign(event: any) {
809
+ this.upload = '';
810
+ this.currentValue = 1;
811
+ this.configData.storeList = event;
812
+ // this.tableArray = event;
813
+ let data = event.map((el: any) => {
814
+ return { id: el?._id, type: el?.type }
815
+ })
816
+ this.idList = data;
817
+ this.tableFilter = '';
818
+ this.getTableData();
819
+ // this.configData?.aiConfig?.assignConfig === 'store' ? (this.singleAssign = this.idList, this.getTableData()) : (this.groupAssign = this.idList, this.userDetailsV2(event));
820
+ }
821
+
822
+ removedChip(event: any) {
823
+ this.tableArray = this.tableArray?.filter((item: any) => !event.includes(item._id))
824
+ this.configData.storeList = this.configData.storeList?.filter((item: any) => !event.includes(item._id))
825
+ // (this.assignType === 'store' || this.assignType === 'user') ? this.getTableData() :this.userDetailsV2();
826
+ }
827
+
828
+ bulkuploadModel() {
829
+ this.dropDown = false;
830
+ this.dialog.open(this.bulkupload, {
831
+ centered: true, backdrop: 'static'
832
+ })
833
+ }
834
+
835
+ excelError: any;
836
+
837
+ afterUplload(data?: any) {
838
+ this.excelError = data;
839
+ this.dialog.open(this.afterValidation, { centered: true, backdrop: 'static' })
840
+ }
841
+
842
+ confirmUserpopup() {
843
+ this.upload = 'upload';
844
+ this.tableArray = [];
845
+ this.tableLoading = true;
846
+ if (this.configData?.aiConfig?.assignConfig !== 'store') {
847
+ this.tableArray = this.userData.filter((item: any) => item.isSelected == true);
848
+ this.tableArray = this.storeList.filter((data: any) =>
849
+ this.tableArray.some((element: any) => element?.storeName === data?.storeName)
850
+ );
851
+
852
+ if (typeof (this.tableArray) == 'undefined' || this.tableArray == '[]') {
853
+ this.toast.getErrorToast('The store does not match')
854
+ return
855
+ }
856
+
857
+ this.tableArray.forEach((el: any) => el.isSelected = true)
858
+ this.assignSingle = this.tableArray;
859
+ this.configData.storeList = this.tableArray;
860
+ this.toast.getSuccessToast("file uploaded successfully")
861
+ this.getTableData('change');
862
+ } else {
863
+ this.tableArray = this.userData;
864
+ this.tableArray.forEach((data: any) => {
865
+ const match = this.storeList.find((element: any) => element?.storeName === data?.storeName);
866
+ if (match) {
867
+ data.storeId = match?.storeId;
868
+ data._id = match?._id;
869
+ }
870
+ });
871
+
872
+ if (typeof (this.tableArray) == 'undefined') {
873
+ this.toast.getErrorToast('The store does not match')
874
+ return
875
+ }
876
+
877
+ this.assignSingle = this.tableArray.filter((el: any) => (el?.startTime1 || el?.startTime2 || el?.startTime3));
878
+ this.configData.storeList = this.tableArray.filter((el: any) => (el?.startTime1 || el?.startTime2 || el?.startTime3));
879
+ this.toast.getSuccessToast("file uploaded successfully")
880
+ this.getTableData('change')
881
+ }
882
+
883
+ }
884
+
885
+ onDragLeave(event: DragEvent) {
886
+ event.preventDefault();
887
+ (event.target as HTMLElement).classList.remove('drag-over');
888
+ }
889
+
890
+ onDragOver(event: DragEvent) {
891
+ event.preventDefault();
892
+ event.stopPropagation();
893
+ // Add a visual effect to indicate drag is over the area
894
+ (event.target as HTMLElement).classList.add('drag-over');
895
+ }
896
+
897
+ onDrop(event: DragEvent) {
898
+ event.preventDefault();
899
+ (event.target as HTMLElement).classList.remove('drag-over');
900
+
901
+ if (event.dataTransfer?.files.length) {
902
+ const file = event.dataTransfer.files[0];
903
+ const fileInputElement = this.fileInput.nativeElement;
904
+
905
+ // Manually set the file to the input
906
+ const dataTransfer = new DataTransfer();
907
+ dataTransfer.items.add(file);
908
+ fileInputElement.files = dataTransfer.files;
909
+
910
+ // Trigger the change event manually
911
+ fileInputElement.dispatchEvent(new Event('change'));
912
+ }
913
+
914
+ }
915
+
916
+ }
917
+
918
+ function formatExcelTime(value: any): string {
919
+ if (typeof value === 'number') {
920
+
921
+ const date = XLSX.SSF.parse_date_code(value);
922
+ const hours = date.H;
923
+ const minutes = date.M;
924
+ const seconds = date.S;
925
+
926
+ return `${hours.toString().padStart(2, '0')}:${minutes
927
+ .toString()
928
+ .padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
929
+ }
930
+
931
+ return value;
932
+ }