arco-support-request 0.0.88 → 0.0.89

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 (408) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +18 -0
  3. package/package.json +11 -22
  4. package/src/lib/Pipe/allpipe.pipe.ts +127 -0
  5. package/src/lib/Pipe/handlebar-helper-register.ts +249 -0
  6. package/src/lib/Pipe/translate.pipe.ts +32 -0
  7. package/src/lib/all-routing.ts +61 -0
  8. package/src/lib/arco-support-request.component.spec.ts +25 -0
  9. package/src/lib/arco-support-request.component.ts +20 -0
  10. package/src/lib/arco-support-request.module.ts +19 -0
  11. package/src/lib/arco-support-request.service.spec.ts +16 -0
  12. package/src/lib/arco-support-request.service.ts +16 -0
  13. package/src/lib/commonstyles/new-style-rtl.css +380 -0
  14. package/src/lib/commonstyles/styles.scss +4334 -0
  15. package/src/lib/core/encodeurl.service.ts +23 -0
  16. package/src/lib/core/global.service.ts +1859 -0
  17. package/src/lib/core/handlebar-helper-register.ts +247 -0
  18. package/src/lib/core/httpcancel.service.ts +21 -0
  19. package/src/lib/core/loader.service.ts +19 -0
  20. package/src/lib/core/loading-provider.service.ts +64 -0
  21. package/src/lib/core/managehttp.interceptor.ts +49 -0
  22. package/src/lib/core/static/jwt.ts +7 -0
  23. package/src/lib/core/token.service.ts +37 -0
  24. package/src/lib/entity-type-setup/activities-create/activities-create.component.html +69 -0
  25. package/src/lib/entity-type-setup/activities-create/activities-create.component.scss +13 -0
  26. package/src/lib/entity-type-setup/activities-create/activities-create.component.spec.ts +25 -0
  27. package/src/lib/entity-type-setup/activities-create/activities-create.component.ts +143 -0
  28. package/src/lib/entity-type-setup/activities-view/activities-view.component.html +19 -0
  29. package/src/lib/entity-type-setup/activities-view/activities-view.component.scss +3 -0
  30. package/src/lib/entity-type-setup/activities-view/activities-view.component.spec.ts +25 -0
  31. package/src/lib/entity-type-setup/activities-view/activities-view.component.ts +53 -0
  32. package/src/lib/entity-type-setup/activity-template/activity-template.component.html +73 -0
  33. package/src/lib/entity-type-setup/activity-template/activity-template.component.scss +0 -0
  34. package/src/lib/entity-type-setup/activity-template/activity-template.component.spec.ts +25 -0
  35. package/src/lib/entity-type-setup/activity-template/activity-template.component.ts +208 -0
  36. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.html +356 -0
  37. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.scss +50 -0
  38. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.spec.ts +25 -0
  39. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.ts +346 -0
  40. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.html +92 -0
  41. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.scss +90 -0
  42. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.spec.ts +25 -0
  43. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.ts +74 -0
  44. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.html +57 -0
  45. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.scss +16 -0
  46. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.spec.ts +25 -0
  47. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.ts +59 -0
  48. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.html +102 -0
  49. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.scss +3 -0
  50. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.spec.ts +25 -0
  51. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.ts +498 -0
  52. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.html +408 -0
  53. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.scss +123 -0
  54. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.spec.ts +25 -0
  55. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.ts +1073 -0
  56. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.ts +84 -0
  57. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.html +194 -0
  58. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.scss +81 -0
  59. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.spec.ts +25 -0
  60. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.ts +1526 -0
  61. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.html +137 -0
  62. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.scss +0 -0
  63. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.spec.ts +25 -0
  64. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.ts +1353 -0
  65. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.html +329 -0
  66. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.scss +0 -0
  67. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.spec.ts +25 -0
  68. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.ts +520 -0
  69. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.html +609 -0
  70. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.scss +99 -0
  71. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.spec.ts +25 -0
  72. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.ts +784 -0
  73. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.html +632 -0
  74. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.scss +261 -0
  75. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.spec.ts +25 -0
  76. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.ts +765 -0
  77. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.html +368 -0
  78. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.scss +0 -0
  79. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.spec.ts +25 -0
  80. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.ts +334 -0
  81. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.html +500 -0
  82. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.scss +0 -0
  83. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.spec.ts +25 -0
  84. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.ts +862 -0
  85. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.html +139 -0
  86. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.scss +14 -0
  87. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.spec.ts +25 -0
  88. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.ts +347 -0
  89. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.html +150 -0
  90. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.scss +27 -0
  91. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.ts +384 -0
  92. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.html +305 -0
  93. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.scss +31 -0
  94. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.ts +572 -0
  95. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.html +610 -0
  96. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.scss +50 -0
  97. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.spec.ts +25 -0
  98. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.ts +633 -0
  99. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.html +609 -0
  100. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.scss +4 -0
  101. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.ts +702 -0
  102. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.html +530 -0
  103. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.scss +12 -0
  104. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.ts +767 -0
  105. package/src/lib/entity-type-setup/entity-type-setup-routing.module.ts +92 -0
  106. package/src/lib/entity-type-setup/entity-type-setup.module.ts +114 -0
  107. package/src/lib/entity-type-setup/events/events.component.html +211 -0
  108. package/src/lib/entity-type-setup/events/events.component.scss +61 -0
  109. package/src/lib/entity-type-setup/events/events.component.spec.ts +25 -0
  110. package/src/lib/entity-type-setup/events/events.component.ts +517 -0
  111. package/src/lib/entity-type-setup/field-type/field-type.component.html +447 -0
  112. package/src/lib/entity-type-setup/field-type/field-type.component.scss +0 -0
  113. package/src/lib/entity-type-setup/field-type/field-type.component.spec.ts +25 -0
  114. package/src/lib/entity-type-setup/field-type/field-type.component.ts +531 -0
  115. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.html +152 -0
  116. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.scss +24 -0
  117. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.spec.ts +25 -0
  118. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.ts +35 -0
  119. package/src/lib/entity-type-setup/instruction/instruction.component.html +239 -0
  120. package/src/lib/entity-type-setup/instruction/instruction.component.scss +18 -0
  121. package/src/lib/entity-type-setup/instruction/instruction.component.ts +450 -0
  122. package/src/lib/entity-type-setup/interface/entityTypeInterface.ts +1046 -0
  123. package/src/lib/entity-type-setup/interface/eventEnum.ts +191 -0
  124. package/src/lib/entity-type-setup/issue-group/issue-group.component.html +77 -0
  125. package/src/lib/entity-type-setup/issue-group/issue-group.component.scss +0 -0
  126. package/src/lib/entity-type-setup/issue-group/issue-group.component.ts +221 -0
  127. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.html +192 -0
  128. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.scss +10 -0
  129. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.ts +418 -0
  130. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.html +42 -0
  131. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.scss +8 -0
  132. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.ts +52 -0
  133. package/src/lib/entity-type-setup/my-task/my-task.component.html +599 -0
  134. package/src/lib/entity-type-setup/my-task/my-task.component.scss +0 -0
  135. package/src/lib/entity-type-setup/my-task/my-task.component.spec.ts +25 -0
  136. package/src/lib/entity-type-setup/my-task/my-task.component.ts +770 -0
  137. package/src/lib/entity-type-setup/page-form-instance.ts +73 -0
  138. package/src/lib/entity-type-setup/page.interface.classes.ts +43 -0
  139. package/src/lib/entity-type-setup/service/dropdown.directive.ts +12 -0
  140. package/src/lib/entity-type-setup/service/entity-type-setup.service.ts +2901 -0
  141. package/src/lib/entity-type-setup/task-crete/task-crete.component.html +61 -0
  142. package/src/lib/entity-type-setup/task-crete/task-crete.component.scss +0 -0
  143. package/src/lib/entity-type-setup/task-crete/task-crete.component.ts +117 -0
  144. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.html +95 -0
  145. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.scss +23 -0
  146. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.spec.ts +25 -0
  147. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.ts +213 -0
  148. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.html +240 -0
  149. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.scss +14 -0
  150. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.spec.ts +25 -0
  151. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.ts +404 -0
  152. package/src/lib/search.pipe.spec.ts +8 -0
  153. package/src/lib/search.pipe.ts +21 -0
  154. package/src/lib/support-request/action/action.component.html +122 -0
  155. package/src/lib/support-request/action/action.component.scss +6 -0
  156. package/src/lib/support-request/action/action.component.ts +179 -0
  157. package/src/lib/support-request/case-list/case-list.component.html +280 -0
  158. package/src/lib/support-request/case-list/case-list.component.scss +187 -0
  159. package/src/lib/support-request/case-list/case-list.component.ts +519 -0
  160. package/src/lib/support-request/home/home.component.html +16 -0
  161. package/src/lib/support-request/home/home.component.scss +4 -0
  162. package/src/lib/support-request/home/home.component.ts +23 -0
  163. package/src/lib/support-request/pagination/pagination.component.html +71 -0
  164. package/src/lib/support-request/pagination/pagination.component.scss +77 -0
  165. package/src/lib/support-request/pagination/pagination.component.ts +29 -0
  166. package/src/lib/support-request/request-flow/request-flow.component.html +536 -0
  167. package/src/lib/support-request/request-flow/request-flow.component.scss +2 -0
  168. package/src/lib/support-request/request-flow/request-flow.component.ts +914 -0
  169. package/src/lib/support-request/self-service-flow/self-service-flow.component.html +64 -0
  170. package/src/lib/support-request/self-service-flow/self-service-flow.component.scss +2 -0
  171. package/src/lib/support-request/self-service-flow/self-service-flow.component.ts +105 -0
  172. package/src/lib/support-request/support-request-create/support-request-create.component.html +105 -0
  173. package/src/lib/support-request/support-request-create/support-request-create.component.scss +54 -0
  174. package/src/lib/support-request/support-request-create/support-request-create.component.ts +319 -0
  175. package/src/lib/support-request/support-request-details/support-request-details.component.html +553 -0
  176. package/src/lib/support-request/support-request-details/support-request-details.component.scss +338 -0
  177. package/src/lib/support-request/support-request-details/support-request-details.component.ts +849 -0
  178. package/src/lib/support-request/support-request-index/support-request-index.component.html +4 -0
  179. package/src/lib/support-request/support-request-index/support-request-index.component.scss +0 -0
  180. package/src/lib/support-request/support-request-index/support-request-index.component.ts +16 -0
  181. package/src/lib/support-request/support-request-list/support-request-list.component.html +455 -0
  182. package/src/lib/support-request/support-request-list/support-request-list.component.scss +0 -0
  183. package/src/lib/support-request/support-request-list/support-request-list.component.ts +869 -0
  184. package/src/lib/support-request/support-request-routing.module.ts +21 -0
  185. package/src/lib/support-request/support-request.module.ts +103 -0
  186. package/src/lib/support-request/support-request.service.ts +148 -0
  187. package/src/lib/support-request/supportRequestInterface.ts +6 -0
  188. package/src/lib/task/Interfaces/TaskInterface.ts +164 -0
  189. package/src/lib/task/Services/task.service.spec.ts +16 -0
  190. package/src/lib/task/Services/task.service.ts +354 -0
  191. package/src/lib/task/task-routing.module.ts +12 -0
  192. package/src/lib/task/task.module.ts +23 -0
  193. package/src/lib/template/template.component.html +22 -0
  194. package/src/lib/template/template.component.scss +0 -0
  195. package/src/lib/template/template.component.spec.ts +25 -0
  196. package/src/lib/template/template.component.ts +24 -0
  197. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.html +83 -0
  198. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.scss +0 -0
  199. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.ts +120 -0
  200. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.html +134 -0
  201. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.scss +0 -0
  202. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.ts +185 -0
  203. package/src/lib/templates/attachmentsetup/attachment-api.ts +55 -0
  204. package/src/lib/templates/attachmentsetup/attachment-interface.ts +100 -0
  205. package/src/lib/templates/attachmentsetup/attachment.service.ts +233 -0
  206. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.html +97 -0
  207. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.scss +10 -0
  208. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.ts +367 -0
  209. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.html +49 -0
  210. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.scss +0 -0
  211. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.ts +226 -0
  212. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.html +140 -0
  213. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.scss +8 -0
  214. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.ts +176 -0
  215. package/src/lib/templates/card/card.component.html +56 -0
  216. package/src/lib/templates/card/card.component.scss +0 -0
  217. package/src/lib/templates/card/card.component.spec.ts +25 -0
  218. package/src/lib/templates/card/card.component.ts +306 -0
  219. package/src/lib/templates/dashboard/dashboard.component.html +333 -0
  220. package/src/lib/templates/dashboard/dashboard.component.scss +16 -0
  221. package/src/lib/templates/dashboard/dashboard.component.ts +2290 -0
  222. package/src/lib/templates/details/details.component.html +233 -0
  223. package/src/lib/templates/details/details.component.scss +0 -0
  224. package/src/lib/templates/details/details.component.spec.ts +25 -0
  225. package/src/lib/templates/details/details.component.ts +15 -0
  226. package/src/lib/templates/detailstwo/detailstwo.component.html +694 -0
  227. package/src/lib/templates/detailstwo/detailstwo.component.scss +0 -0
  228. package/src/lib/templates/detailstwo/detailstwo.component.spec.ts +25 -0
  229. package/src/lib/templates/detailstwo/detailstwo.component.ts +15 -0
  230. package/src/lib/templates/dyanamic-page/dyanamic-page.component.html +1 -0
  231. package/src/lib/templates/dyanamic-page/dyanamic-page.component.scss +0 -0
  232. package/src/lib/templates/dyanamic-page/dyanamic-page.component.spec.ts +25 -0
  233. package/src/lib/templates/dyanamic-page/dyanamic-page.component.ts +15 -0
  234. package/src/lib/templates/grid/grid-datatype/grid-datatype.component.ts +39 -0
  235. package/src/lib/templates/grid/grid-service.service.ts +236 -0
  236. package/src/lib/templates/grid/grid.component.html +358 -0
  237. package/src/lib/templates/grid/grid.component.scss +118 -0
  238. package/src/lib/templates/grid/grid.component.spec.ts +25 -0
  239. package/src/lib/templates/grid/grid.component.ts +638 -0
  240. package/src/lib/templates/grid/inner-grid/inner-grid.component.html +1 -0
  241. package/src/lib/templates/grid/inner-grid/inner-grid.component.scss +0 -0
  242. package/src/lib/templates/grid/inner-grid/inner-grid.component.spec.ts +25 -0
  243. package/src/lib/templates/grid/inner-grid/inner-grid.component.ts +15 -0
  244. package/src/lib/templates/home/home.component.html +251 -0
  245. package/src/lib/templates/home/home.component.scss +20 -0
  246. package/src/lib/templates/home/home.component.spec.ts +25 -0
  247. package/src/lib/templates/home/home.component.ts +15 -0
  248. package/src/lib/templates/interface_enum/common-Interface.ts +114 -0
  249. package/src/lib/templates/interface_enum/common-enum.ts +159 -0
  250. package/src/lib/templates/interface_enum/icon-class.ts +1149 -0
  251. package/src/lib/templates/leftside/leftside.component.html +77 -0
  252. package/src/lib/templates/leftside/leftside.component.scss +0 -0
  253. package/src/lib/templates/leftside/leftside.component.spec.ts +25 -0
  254. package/src/lib/templates/leftside/leftside.component.ts +238 -0
  255. package/src/lib/templates/login/login.component.html +93 -0
  256. package/src/lib/templates/login/login.component.scss +110 -0
  257. package/src/lib/templates/login/login.component.spec.ts +25 -0
  258. package/src/lib/templates/login/login.component.ts +142 -0
  259. package/src/lib/templates/main-content/main-content.component.html +31 -0
  260. package/src/lib/templates/main-content/main-content.component.scss +6 -0
  261. package/src/lib/templates/main-content/main-content.component.spec.ts +25 -0
  262. package/src/lib/templates/main-content/main-content.component.ts +24 -0
  263. package/src/lib/templates/menu-item/child-menu/child-menu.component.html +5 -0
  264. package/src/lib/templates/menu-item/child-menu/child-menu.component.scss +3 -0
  265. package/src/lib/templates/menu-item/child-menu/child-menu.component.ts +22 -0
  266. package/src/lib/templates/menu-item/menu-item.component.html +25 -0
  267. package/src/lib/templates/menu-item/menu-item.component.scss +11 -0
  268. package/src/lib/templates/menu-item/menu-item.component.ts +29 -0
  269. package/src/lib/templates/pagination/pagination.component.html +71 -0
  270. package/src/lib/templates/pagination/pagination.component.scss +73 -0
  271. package/src/lib/templates/pagination/pagination.component.ts +29 -0
  272. package/src/lib/templates/pie-chart/pie-chart.component.html +0 -0
  273. package/src/lib/templates/pie-chart/pie-chart.component.scss +0 -0
  274. package/src/lib/templates/pie-chart/pie-chart.component.ts +14 -0
  275. package/src/lib/templates/pipe/multiple-search.pipe.ts +28 -0
  276. package/src/lib/templates/pipe/simple-search.pipe.ts +18 -0
  277. package/src/lib/templates/pipe/translate.pipe.ts +31 -0
  278. package/src/lib/templates/request-flow-dash/request-flow-dash.component.html +16 -0
  279. package/src/lib/templates/request-flow-dash/request-flow-dash.component.scss +0 -0
  280. package/src/lib/templates/request-flow-dash/request-flow-dash.component.spec.ts +25 -0
  281. package/src/lib/templates/request-flow-dash/request-flow-dash.component.ts +59 -0
  282. package/src/lib/templates/table/table.component.html +310 -0
  283. package/src/lib/templates/table/table.component.scss +0 -0
  284. package/src/lib/templates/table/table.component.spec.ts +25 -0
  285. package/src/lib/templates/table/table.component.ts +52 -0
  286. package/src/lib/templates/template.service.ts +43 -0
  287. package/src/lib/templates/templates-routing.module.ts +21 -0
  288. package/src/lib/templates/templates.module.ts +80 -0
  289. package/src/lib/templates/topnav/topnav.component.html +172 -0
  290. package/src/lib/templates/topnav/topnav.component.scss +10 -0
  291. package/src/lib/templates/topnav/topnav.component.spec.ts +25 -0
  292. package/src/lib/templates/topnav/topnav.component.ts +59 -0
  293. package/src/lib/ticket/_interfaces/master-models.ts +66 -0
  294. package/src/lib/ticket/_interfaces/model.ts +252 -0
  295. package/src/lib/ticket/_ticket-services/ticket-api.service.ts +319 -0
  296. package/src/lib/ticket/_ticket-services/ticket-master-api.service.ts +169 -0
  297. package/src/lib/ticket/_ticket-services/ticket-priority.service.ts +86 -0
  298. package/src/lib/ticket/_ticket-services/ticketchannel.service.ts +107 -0
  299. package/src/lib/ticket/ticket-routing.module.ts +12 -0
  300. package/src/lib/ticket/ticket.module.ts +29 -0
  301. package/{public-api.d.ts → src/public-api.ts} +6 -1
  302. package/src/test.ts +26 -0
  303. package/tsconfig.lib.json +25 -0
  304. package/tsconfig.lib.prod.json +10 -0
  305. package/tsconfig.spec.json +17 -0
  306. package/tslint.json +17 -0
  307. package/arco-support-request.d.ts +0 -32
  308. package/arco-support-request.metadata.json +0 -1
  309. package/bundles/arco-support-request.umd.js +0 -11689
  310. package/bundles/arco-support-request.umd.js.map +0 -1
  311. package/bundles/arco-support-request.umd.min.js +0 -2
  312. package/bundles/arco-support-request.umd.min.js.map +0 -1
  313. package/esm2015/arco-support-request.js +0 -33
  314. package/esm2015/lib/Pipe/allpipe.pipe.js +0 -110
  315. package/esm2015/lib/Pipe/translate.pipe.js +0 -31
  316. package/esm2015/lib/arco-support-request.component.js +0 -18
  317. package/esm2015/lib/arco-support-request.module.js +0 -20
  318. package/esm2015/lib/arco-support-request.service.js +0 -19
  319. package/esm2015/lib/core/global.service.js +0 -1783
  320. package/esm2015/lib/core/handlebar-helper-register.js +0 -188
  321. package/esm2015/lib/core/static/jwt.js +0 -8
  322. package/esm2015/lib/entity-type-setup/activities-create/activities-create.component.js +0 -126
  323. package/esm2015/lib/entity-type-setup/activities-view/activities-view.component.js +0 -46
  324. package/esm2015/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.js +0 -367
  325. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.js +0 -867
  326. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.js +0 -85
  327. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.js +0 -1056
  328. package/esm2015/lib/entity-type-setup/interface/entityTypeInterface.js +0 -51
  329. package/esm2015/lib/entity-type-setup/interface/eventEnum.js +0 -84
  330. package/esm2015/lib/entity-type-setup/page-form-instance.js +0 -65
  331. package/esm2015/lib/entity-type-setup/page.interface.classes.js +0 -40
  332. package/esm2015/lib/entity-type-setup/service/entity-type-setup.service.js +0 -1871
  333. package/esm2015/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.js +0 -320
  334. package/esm2015/lib/search.pipe.js +0 -19
  335. package/esm2015/lib/support-request/action/action.component.js +0 -104
  336. package/esm2015/lib/support-request/case-list/case-list.component.js +0 -449
  337. package/esm2015/lib/support-request/home/home.component.js +0 -23
  338. package/esm2015/lib/support-request/pagination/pagination.component.js +0 -34
  339. package/esm2015/lib/support-request/request-flow/request-flow.component.js +0 -739
  340. package/esm2015/lib/support-request/self-service-flow/self-service-flow.component.js +0 -88
  341. package/esm2015/lib/support-request/support-request-create/support-request-create.component.js +0 -270
  342. package/esm2015/lib/support-request/support-request-details/support-request-details.component.js +0 -659
  343. package/esm2015/lib/support-request/support-request-index/support-request-index.component.js +0 -16
  344. package/esm2015/lib/support-request/support-request-routing.module.js +0 -22
  345. package/esm2015/lib/support-request/support-request.module.js +0 -98
  346. package/esm2015/lib/support-request/support-request.service.js +0 -107
  347. package/esm2015/lib/support-request/supportRequestInterface.js +0 -2
  348. package/esm2015/lib/task/Interfaces/TaskInterface.js +0 -7
  349. package/esm2015/lib/task/Services/task.service.js +0 -251
  350. package/esm2015/lib/templates/attachmentsetup/attachment-interface.js +0 -2
  351. package/esm2015/lib/templates/attachmentsetup/attachment.service.js +0 -196
  352. package/esm2015/lib/templates/grid/grid-datatype/grid-datatype.component.js +0 -37
  353. package/esm2015/lib/templates/grid/grid-service.service.js +0 -151
  354. package/esm2015/lib/templates/grid/grid.component.js +0 -604
  355. package/esm2015/lib/templates/grid/inner-grid/inner-grid.component.js +0 -15
  356. package/esm2015/lib/templates/interface_enum/common-Interface.js +0 -2
  357. package/esm2015/lib/templates/interface_enum/common-enum.js +0 -164
  358. package/esm2015/lib/ticket/_interfaces/model.js +0 -2
  359. package/esm2015/lib/ticket/_ticket-services/ticket-api.service.js +0 -232
  360. package/esm2015/public-api.js +0 -9
  361. package/fesm2015/arco-support-request.js +0 -11082
  362. package/fesm2015/arco-support-request.js.map +0 -1
  363. package/lib/Pipe/allpipe.pipe.d.ts +0 -19
  364. package/lib/Pipe/translate.pipe.d.ts +0 -7
  365. package/lib/arco-support-request.component.d.ts +0 -5
  366. package/lib/arco-support-request.module.d.ts +0 -2
  367. package/lib/arco-support-request.service.d.ts +0 -9
  368. package/lib/core/global.service.d.ts +0 -99
  369. package/lib/core/handlebar-helper-register.d.ts +0 -1
  370. package/lib/core/static/jwt.d.ts +0 -7
  371. package/lib/entity-type-setup/activities-create/activities-create.component.d.ts +0 -30
  372. package/lib/entity-type-setup/activities-view/activities-view.component.d.ts +0 -16
  373. package/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.d.ts +0 -67
  374. package/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.d.ts +0 -88
  375. package/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.d.ts +0 -11
  376. package/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.d.ts +0 -70
  377. package/lib/entity-type-setup/interface/entityTypeInterface.d.ts +0 -917
  378. package/lib/entity-type-setup/interface/eventEnum.d.ts +0 -161
  379. package/lib/entity-type-setup/page-form-instance.d.ts +0 -13
  380. package/lib/entity-type-setup/page.interface.classes.d.ts +0 -33
  381. package/lib/entity-type-setup/service/entity-type-setup.service.d.ts +0 -615
  382. package/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.d.ts +0 -86
  383. package/lib/search.pipe.d.ts +0 -4
  384. package/lib/support-request/action/action.component.d.ts +0 -31
  385. package/lib/support-request/case-list/case-list.component.d.ts +0 -100
  386. package/lib/support-request/home/home.component.d.ts +0 -6
  387. package/lib/support-request/pagination/pagination.component.d.ts +0 -18
  388. package/lib/support-request/request-flow/request-flow.component.d.ts +0 -152
  389. package/lib/support-request/self-service-flow/self-service-flow.component.d.ts +0 -32
  390. package/lib/support-request/support-request-create/support-request-create.component.d.ts +0 -55
  391. package/lib/support-request/support-request-details/support-request-details.component.d.ts +0 -138
  392. package/lib/support-request/support-request-index/support-request-index.component.d.ts +0 -5
  393. package/lib/support-request/support-request-routing.module.d.ts +0 -2
  394. package/lib/support-request/support-request.module.d.ts +0 -2
  395. package/lib/support-request/support-request.service.d.ts +0 -35
  396. package/lib/support-request/supportRequestInterface.d.ts +0 -6
  397. package/lib/task/Interfaces/TaskInterface.d.ts +0 -132
  398. package/lib/task/Services/task.service.d.ts +0 -75
  399. package/lib/templates/attachmentsetup/attachment-interface.d.ts +0 -90
  400. package/lib/templates/attachmentsetup/attachment.service.d.ts +0 -61
  401. package/lib/templates/grid/grid-datatype/grid-datatype.component.d.ts +0 -11
  402. package/lib/templates/grid/grid-service.service.d.ts +0 -45
  403. package/lib/templates/grid/grid.component.d.ts +0 -218
  404. package/lib/templates/grid/inner-grid/inner-grid.component.d.ts +0 -5
  405. package/lib/templates/interface_enum/common-Interface.d.ts +0 -96
  406. package/lib/templates/interface_enum/common-enum.d.ts +0 -134
  407. package/lib/ticket/_interfaces/model.d.ts +0 -192
  408. package/lib/ticket/_ticket-services/ticket-api.service.d.ts +0 -81
@@ -0,0 +1,1353 @@
1
+ import { Component, OnInit, Output,Input,EventEmitter } from '@angular/core';
2
+ import { Validators } from '@angular/forms';
3
+ import { FormGroup,FormBuilder } from '@angular/forms';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
+ import { Observable, of } from 'rxjs';
6
+ import { E_DataType } from '../../../templates/interface_enum/common-enum';
7
+ import Swal from 'sweetalert2';
8
+ import { EntityTypeFieldVM, EntityTypeFormVM, FieldValidators } from '../../interface/entityTypeInterface';
9
+ import { PageForm } from '../../page-form-instance';
10
+ import { PageDetailsRow } from '../../page.interface.classes';
11
+ import { EntityTypeSetupService } from '../../service/entity-type-setup.service';
12
+ import * as handlebars from 'handlebars';
13
+ import { errorMessageType, GlobalService } from '../../../core/global.service';
14
+
15
+ import { TranslatePipe } from '../../../Pipe/translate.pipe';
16
+ import { registerHandlebarHelperMethods } from '../../../core/handlebar-helper-register';
17
+ import { GetFormattedDateWithTime } from '../../../templates/grid/grid-service.service';
18
+ // import { TranslatePipe } from 'src/app/Pipe/translate.pipe';
19
+
20
+ @Component({
21
+ selector: 'app-entity-dynamic-view',
22
+ templateUrl: './entity-dynamic-view.component.html',
23
+ styleUrls: ['./entity-dynamic-view.component.scss']
24
+ })
25
+ export class EntityDynamicViewComponent implements OnInit {
26
+
27
+ constructor(
28
+ private entityTypeSetup: EntityTypeSetupService,
29
+ private router: Router,
30
+ private fb: FormBuilder,
31
+ private route: ActivatedRoute,
32
+ private globalService: GlobalService,
33
+ ) { }
34
+
35
+ ngOnInit(): void {
36
+ this._handlebars = handlebars;
37
+ registerHandlebarHelperMethods(this._handlebars);
38
+ this.getEntityForm()
39
+ }
40
+
41
+ _handlebars:any;
42
+
43
+ @Input() RequestorField: any = null;
44
+ @Input() RequestorFieldValue: any = null;
45
+
46
+
47
+ @Input() EntityFormId: number;
48
+ @Input() Type:any;
49
+ @Input() ViewFrom:string="";
50
+ @Input() ModalSize:any ="modal-lg";
51
+ @Output() closeDynamicViewPopup: any = new EventEmitter();
52
+ @Output() submitFormValue: any = new EventEmitter<{ formdata: any,pageForm:any,forms?:any,CurrentFormPageGroupObjects?:any }>();
53
+ @Input() PageGroupValues:any ={};
54
+ CurrentFormPageGroupObjects:any ={};
55
+
56
+ @Input() ParameterData:any=null;
57
+
58
+ closePopup() {
59
+ this.closeDynamicViewPopup.emit();
60
+ }
61
+
62
+ _submitFormValue() {
63
+ let formvalue = this._PageForm.form.value;
64
+ let _forms = {
65
+ PageGroup: this.pageGroups,
66
+ defaultPageGroups: this.defaultPageGroups,
67
+ PageGroupValues: formvalue,
68
+ EntityFormId:this.EntityFormId,
69
+ OnSaveRules: this.OnSaveRules,
70
+ }
71
+ this.submitFormValue.emit({formdata:formvalue,pageForm:this._PageForm.form,forms:_forms,CurrentFormPageGroupObjects:this.CurrentFormPageGroupObjects});
72
+ }
73
+
74
+
75
+ OnSaveRules:any;
76
+ EntityTypeForm: EntityTypeFormVM;
77
+ pageGroups: PageDetailsRow[] = [];
78
+ defaultPageGroups: PageDetailsRow[] = [];
79
+ // PageGroupValues:any ={};
80
+
81
+
82
+ EntityTypeTemplateId =null;
83
+ getEntityForm() {
84
+ // alert("aa");
85
+
86
+ this.entityTypeSetup.getSingleEntityTypeFormById(this.EntityFormId).subscribe(
87
+ (res: any) => {
88
+ // alert("bb");
89
+
90
+ this.EntityTypeForm = res;
91
+ if (this.EntityTypeForm.FormData) {
92
+ let _FormData = JSON.parse(this.EntityTypeForm.FormData)
93
+
94
+ if (_FormData.PageGroupValues) {
95
+ this.CurrentFormPageGroupObjects = _FormData.PageGroupValues
96
+ }
97
+
98
+ if (_FormData.PageGroup) {
99
+ if (Array.isArray(_FormData.PageGroup)) {
100
+ this.pageGroups = _FormData.PageGroup;
101
+ // this.setDDLValueOnEditMode();
102
+ }
103
+ }
104
+ if (_FormData.defaultPageGroups) {
105
+ this.EntityTypeTemplateId = _FormData.defaultPageGroups;
106
+ this.getAllDefaultEntityTypeForm(_FormData.defaultPageGroups);
107
+ }
108
+ else
109
+ this.defaultPageGroups = [];
110
+
111
+ // if (_FormData.defaultPageGroups) {
112
+ // if (Array.isArray(_FormData.defaultPageGroups)) {
113
+ // this.defaultPageGroups = _FormData.defaultPageGroups;
114
+ // }
115
+ // }
116
+
117
+ if (this.Type != 'Edit' && this.Type !="Workflow") {
118
+
119
+ if (_FormData.PageGroupValues)
120
+ this.PageGroupValues = _FormData.PageGroupValues;
121
+ else if (!this.PageGroupValues || (typeof this.PageGroupValues != 'object'))
122
+ this.PageGroupValues = {};
123
+ }
124
+ }
125
+
126
+ this.getAllRules(this.EntityTypeForm.EntityTypeId);
127
+
128
+ this.getFieldListByEntityType(this.EntityTypeForm.EntityTypeId);
129
+
130
+
131
+ },
132
+ (error) => {
133
+
134
+ console.log(error);
135
+ }
136
+ )
137
+ }
138
+
139
+
140
+ EntityFieldList: EntityTypeFieldVM[] = [];
141
+ getFieldListByEntityType(EntityTypeId) {
142
+
143
+
144
+ this.entityTypeSetup.getAllEntityTypeField(null, EntityTypeId)
145
+ .subscribe((res: any) => {
146
+
147
+ this.EntityFieldList = res.Data;
148
+ this.buildReactiveForm();
149
+ // this.TempFieldValidators();
150
+ },
151
+ (error) => {
152
+
153
+ console.log(error);
154
+ });
155
+ }
156
+
157
+ getAllDefaultEntityTypeForm(EntityTypeId) {
158
+
159
+ this.entityTypeSetup.getActiveEntityFormByDetails(EntityTypeId).subscribe(
160
+ (res: any) => {
161
+
162
+
163
+ if (res && res.FormData) {
164
+ let _FormData = JSON.parse(res.FormData);
165
+
166
+ if (_FormData.PageGroup){
167
+ if(Array.isArray(_FormData.PageGroup)) {
168
+ this.defaultPageGroups = _FormData.PageGroup;
169
+ }
170
+ }
171
+
172
+ this.buildReactiveForm()
173
+ }
174
+
175
+ },
176
+ (error) => {
177
+
178
+ Swal.fire({
179
+ title: this.translatePipe.transform('Template form not found'),
180
+ });
181
+ console.log(error);
182
+ }
183
+ )
184
+ }
185
+
186
+
187
+
188
+
189
+ _PageForm: PageForm = new PageForm(new FormGroup({}));
190
+ dynamicFormGroup: FormGroup;
191
+ submitted: boolean;
192
+
193
+
194
+
195
+ validationError(name: string, errorName: string) {
196
+ if (name && errorName)
197
+ return this.dynamicFormGroup.get(name).errors[errorName]
198
+ ? true : false
199
+ else
200
+ return this.dynamicFormGroup.get(name).errors
201
+ ? true : false
202
+ }
203
+
204
+ getType(_dataType: E_DataType | number) {
205
+ switch (_dataType) {
206
+ case E_DataType.int:
207
+ case E_DataType.decimal:
208
+ return "number";
209
+ case E_DataType.date:
210
+ return "date";
211
+ case E_DataType.dateTime:
212
+ return "datetime-local";
213
+ case E_DataType.timespan:
214
+ return "time";
215
+ case E_DataType.bool:
216
+ return "checkbox";
217
+ case E_DataType.string:
218
+ return "text";
219
+ case E_DataType.image:
220
+ return "file";
221
+
222
+ default:
223
+ return "text";
224
+ }
225
+ }
226
+
227
+
228
+
229
+ getAllFields() {
230
+
231
+ let fields:EntityTypeFieldVM[] =[];
232
+
233
+ for (let index = 0; index < this.pageGroups.length; index++) {
234
+ let Groups = this.pageGroups[index].Groups;
235
+ for (let i = 0; i < Groups.length; i++) {
236
+ fields.push(...Groups[i].Fields)
237
+ }
238
+ }
239
+
240
+ for (let index = 0; index < this.defaultPageGroups.length; index++) {
241
+ let Groups = this.defaultPageGroups[index].Groups;
242
+ for (let i = 0; i < Groups.length; i++) {
243
+ fields.push(...Groups[i].Fields)
244
+ }
245
+ }
246
+ return fields;
247
+
248
+ }
249
+
250
+
251
+ buildReactiveForm() {
252
+
253
+ let fields: EntityTypeFieldVM[] =this.getAllFields();
254
+
255
+ this._PageForm = new PageForm(this.createFormGroup(fields));
256
+ this.BindDesignFormData()
257
+
258
+ if(this.ViewFrom=="Details"){
259
+ this._submitFormValue();
260
+ }
261
+ this.setFieldsInPageGroupsForm()
262
+
263
+ if (this.Type != 'Edit') {
264
+
265
+ if (this.ParameterData) {
266
+
267
+ for (var key in this._PageForm.form.value) {
268
+ if (this.ParameterData[key]) {
269
+ this._PageForm.form.get(key).setValue(this.ParameterData[key], { onlySelf: false,entitySelf:true });
270
+ }
271
+ }
272
+ }
273
+
274
+ if (this.RequestorField && this.RequestorFieldValue) {
275
+
276
+ if(this._PageForm.form.get(this.RequestorField))
277
+ this._PageForm.form.get(this.RequestorField).setValue(this.RequestorFieldValue, { onlySelf: false,entitySelf:true });
278
+ }
279
+
280
+ this.onFormInit(this.EntityTypeForm);
281
+ }
282
+ this.onFormSave(this.EntityTypeForm);
283
+
284
+ this.setDDLValueOnEditMode();
285
+ }
286
+
287
+
288
+ setFieldsInPageGroupsForm() {
289
+
290
+ if (!(this.EntityFieldList && this.EntityFieldList.length > 0))
291
+ return
292
+
293
+ this.pageGroups.map((PG) => {
294
+ PG.Groups.map((group) => {
295
+ group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
296
+ })
297
+ })
298
+ this.defaultPageGroups.map((PG) => {
299
+ PG.Groups.map((group) => {
300
+ group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
301
+ })
302
+ })
303
+ }
304
+
305
+
306
+ setDDLValueOnEditMode() {
307
+ if (this.PageGroupValues && this.PageGroupValues.RecId) {
308
+
309
+ this.pageGroups.map((PG) => {
310
+ PG.Groups.map((group) => {
311
+ group.Fields.map((x) => {
312
+ if (x.DataType == E_DataType.dropdown) {
313
+
314
+ let _field = x.Description + "_Desc"
315
+ if (_field in this.PageGroupValues) {
316
+
317
+ x.showSelectedValues = this.PageGroupValues[_field];
318
+ }
319
+ else {
320
+ x.showSelectedValues = this.PageGroupValues[x.Description];
321
+ }
322
+ }
323
+ });
324
+
325
+ })
326
+ })
327
+ this.defaultPageGroups.map((PG) => {
328
+ PG.Groups.map((group) => {
329
+ group.Fields.map((x) => {
330
+ if (x.DataType == E_DataType.dropdown) {
331
+
332
+ let _field = x.Description + "_Desc"
333
+ if (_field in this.PageGroupValues) {
334
+
335
+ x.showSelectedValues = this.PageGroupValues[_field];
336
+ }
337
+ else {
338
+ x.showSelectedValues = this.PageGroupValues[x.Description];
339
+ }
340
+ }
341
+ });
342
+
343
+ })
344
+ })
345
+
346
+ }
347
+ }
348
+
349
+
350
+
351
+ createFormGroup(fields: EntityTypeFieldVM[]) {
352
+ let form = this.fb.group({});
353
+ if (Array.isArray(fields) && fields.length > 0) {
354
+ for (const field of fields) {
355
+ const value = null;
356
+ if(field.IsMandatory)
357
+ form.addControl(field.Description,this.fb.control(value, Validators.required));
358
+ else
359
+ form.addControl(field.Description,this.fb.control(value));
360
+ }
361
+ }
362
+
363
+ if (this.EntityFieldList && this.EntityFieldList.length > 0) {
364
+ for (const field of this.EntityFieldList) {
365
+ const value = null;
366
+ if (!(field.Description in form.value))
367
+ form.addControl(field.Description, this.fb.control(value));
368
+ }
369
+ }
370
+
371
+ return form;
372
+ }
373
+
374
+ BindDesignFormData() {
375
+
376
+ this._PageForm.form.patchValue(this.PageGroupValues);
377
+ }
378
+
379
+ FieldChangeEvent(FieldData:EntityTypeFieldVM,RestData:any) {
380
+
381
+
382
+ this._submitFormValue()
383
+
384
+ let _rulesField = null;
385
+ if (this.AllRules && this.AllRules.FieldRules) {
386
+ _rulesField = this.AllRules.FieldRules;
387
+ _rulesField = _rulesField.filter(x=>(x.EntityTypeRecId ==this.EntityTypeForm.EntityTypeId || x.EntityTypeRecId ==this.EntityTypeTemplateId));
388
+ }
389
+ else {
390
+ return
391
+ }
392
+ let _currentFieldRule = _rulesField.filter(x=>x.Field==FieldData.Description)[0]
393
+
394
+ if (_currentFieldRule && _currentFieldRule.Rules) {
395
+ let rulesData = JSON.parse(_currentFieldRule.Rules);
396
+
397
+ if (Array.isArray(rulesData)) {
398
+
399
+
400
+ let _rulesData = rulesData.filter((x) => {
401
+ if (x.CurrentEntityTypeId) {
402
+ if (x.CurrentEntityTypeId.includes(this.EntityTypeForm.EntityTypeId))
403
+ return x;
404
+ }
405
+ else
406
+ return x;
407
+ });
408
+
409
+
410
+ for (let rI = 0; rI < _rulesData.length; rI++) {
411
+ this._fieldrulesImplement(_rulesData[rI],RestData,FieldData)
412
+ }
413
+ }
414
+ else
415
+ this._fieldrulesImplement(rulesData,RestData,FieldData)
416
+
417
+
418
+ }
419
+
420
+ }
421
+
422
+ _fieldrulesImplement(rulesData,RestData:any,FieldData) {
423
+
424
+ if (!rulesData || !rulesData.Condtion) {
425
+ return
426
+ }
427
+
428
+ let _condition = true;
429
+
430
+ for (let index = 0; index < rulesData.Condtion.length; index++) {
431
+
432
+
433
+ let _con = rulesData.Condtion[index];
434
+
435
+ let _Icondition = false;
436
+
437
+ let _fieldValue = this._PageForm.form.value[_con.Field];
438
+ if (FieldData.DataType == E_DataType.bool)
439
+ _fieldValue = _fieldValue.toString()
440
+
441
+ if (_con.FieldType && _con.FieldType == "Value") {
442
+ let _handleData = this._PageForm.form.value;
443
+ _handleData.data = RestData;
444
+ _handleData.currentLang = this.globalService.CurrentLanguage;
445
+ if (this.ParameterData)
446
+ _handleData.params = this.ParameterData;
447
+ _fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
448
+ }
449
+
450
+ let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo)
451
+
452
+ switch (_con.Type) {
453
+ case "Equal": {
454
+ _Icondition = (_fieldValue == value ? true : false)
455
+ break
456
+ }
457
+ case "NotEqual": {
458
+ _Icondition = (_fieldValue != value ? true : false)
459
+ break
460
+ }
461
+ case "LessThen": {
462
+ _Icondition = (_fieldValue < value ? true : false)
463
+ break
464
+ }
465
+ case "LessThenEqual": {
466
+ _Icondition = (_fieldValue <= value ? true : false)
467
+ break
468
+ }
469
+ case "GreaterThen": {
470
+ _Icondition = (_fieldValue > value ? true : false)
471
+ break
472
+ }
473
+ case "GreaterThenEqual": {
474
+ _Icondition = (_fieldValue >= value ? true : false)
475
+ break
476
+ }
477
+ case "IsNull": {
478
+ _Icondition = (_fieldValue == null ? true : false)
479
+ break
480
+ }
481
+ case "IsNotNull": {
482
+ _Icondition = (_fieldValue != null ? true : false)
483
+ break
484
+ }
485
+ case "IsEmpty": {
486
+ _Icondition = (_fieldValue == '' ? true : false)
487
+ break
488
+ }
489
+ case "IsNotEmpty": {
490
+ _Icondition = (_fieldValue != '' ? true : false)
491
+ break
492
+ }
493
+
494
+ // String Data
495
+ case "Length": {
496
+ _Icondition = (_fieldValue.length == value ? true : false)
497
+ break
498
+ }
499
+ case "Contains": { //Contains
500
+ _Icondition = (_fieldValue.includes(value) ? true : false)
501
+ break
502
+ }
503
+ case "NotContains": { //Contains
504
+ _Icondition = (!(_fieldValue.includes(value)) ? true : false)
505
+ break
506
+ }
507
+ case "StartsWith": {
508
+ _Icondition = (_fieldValue.startsWith(value) ? true : false)
509
+ break
510
+ }
511
+ case "EndsWith": {
512
+ _Icondition = (_fieldValue.endsWith(value) ? true : false)
513
+ break
514
+ }
515
+
516
+ default:
517
+ _Icondition = false
518
+ break
519
+ }
520
+
521
+
522
+ if (index > 0) {
523
+ if (rulesData.CondtionOperator == 1) {
524
+ _condition = (_condition && _Icondition ? true : false)
525
+ }
526
+ else {
527
+ _condition = (_condition || _Icondition ? true : false)
528
+ }
529
+ }
530
+ else {
531
+ _condition = _Icondition;
532
+ }
533
+
534
+ }
535
+
536
+
537
+
538
+ if (_condition) {
539
+
540
+ this.OnRulesApply(rulesData, RestData)
541
+ }
542
+
543
+ }
544
+
545
+
546
+ onFormSave(FormData) {
547
+
548
+ if (FormData.RulesData) {
549
+ let _formInitRule = JSON.parse(FormData.RulesData);
550
+ this.OnSaveRules = _formInitRule.filter(x => x.Type == "OnSave");
551
+ }
552
+ }
553
+
554
+ onFormInit(FormData,RestData?:any) {
555
+
556
+
557
+ if (FormData.RulesData) {
558
+ let _formInitRule = JSON.parse(FormData.RulesData);
559
+
560
+ let onInitRules = _formInitRule.filter(x => x.Type == "OnInit")
561
+
562
+ for (let index = 0; index < onInitRules.length; index++) {
563
+
564
+ // let rulesData = _formInitRule.filter(x => x.Type == "OnInit")[0];
565
+ let rulesData = onInitRules[index];
566
+
567
+
568
+ if (!rulesData) {
569
+ return
570
+ }
571
+
572
+ let _condition = true;
573
+
574
+ for (let index = 0; index < rulesData.Condtion.length; index++) {
575
+
576
+
577
+ let _con = rulesData.Condtion[index];
578
+
579
+ let _Icondition = false;
580
+
581
+ let _fieldValue = this._PageForm.form.value[_con.Field];
582
+ if (_con.FieldType && _con.FieldType == "Value") {
583
+ let _handleData = this._PageForm.form.value;
584
+ _handleData.data = RestData;
585
+ _handleData.currentLang = this.globalService.CurrentLanguage;
586
+ if (this.ParameterData)
587
+ _handleData.params = this.ParameterData;
588
+ _fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
589
+ }
590
+
591
+ let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo)
592
+
593
+ switch (_con.Type) {
594
+ case "Equal": {
595
+ _Icondition = (_fieldValue == value ? true : false)
596
+ break
597
+ }
598
+ case "NotEqual": {
599
+ _Icondition = (_fieldValue != value ? true : false)
600
+ break
601
+ }
602
+ case "LessThen": {
603
+ _Icondition = (_fieldValue < value ? true : false)
604
+ break
605
+ }
606
+ case "LessThenEqual": {
607
+ _Icondition = (_fieldValue <= value ? true : false)
608
+ break
609
+ }
610
+ case "GreaterThen": {
611
+ _Icondition = (_fieldValue > + value ? true : false)
612
+ break
613
+ }
614
+ case "GreaterThenEqual": {
615
+ _Icondition = (_fieldValue >= value ? true : false)
616
+ break
617
+ }
618
+ case "IsNull": {
619
+ _Icondition = (_fieldValue == null ? true : false)
620
+ break
621
+ }
622
+ case "IsNotNull": {
623
+ _Icondition = (_fieldValue != null ? true : false)
624
+ break
625
+ }
626
+ case "IsEmpty": {
627
+ _Icondition = (_fieldValue == '' ? true : false)
628
+ break
629
+ }
630
+ case "IsNotEmpty": {
631
+ _Icondition = (_fieldValue != '' ? true : false)
632
+ break
633
+ }
634
+
635
+ // String Data
636
+ case "Length": {
637
+ _Icondition = (_fieldValue.length == value ? true : false)
638
+ break
639
+ }
640
+ case "Contains": { //Contains
641
+ _Icondition = (_fieldValue.includes(value) ? true : false)
642
+ break
643
+ }
644
+ case "NotContains": { //Contains
645
+ _Icondition = (!(_fieldValue.includes(value)) ? true : false)
646
+ break
647
+ }
648
+ case "StartsWith": {
649
+ _Icondition = (_fieldValue.startsWith(value) ? true : false)
650
+ break
651
+ }
652
+ case "EndsWith": {
653
+ _Icondition = (_fieldValue.endsWith(value) ? true : false)
654
+ break
655
+ }
656
+
657
+ default:
658
+ _Icondition = false
659
+ break
660
+ }
661
+
662
+
663
+ if (index > 0) {
664
+ if (rulesData.CondtionOperator == 1) {
665
+ _condition = (_condition && _Icondition ? true : false)
666
+ }
667
+ else {
668
+ _condition = (_condition || _Icondition ? true : false)
669
+ }
670
+ }
671
+ else {
672
+ _condition = _Icondition;
673
+ }
674
+
675
+ }
676
+
677
+
678
+
679
+ if (_condition) {
680
+ this.OnRulesApply(rulesData, RestData)
681
+ }
682
+ }
683
+
684
+ }
685
+ }
686
+
687
+ OnRulesApply(rulesData, RestData) {
688
+ let rulesList = rulesData;
689
+ if (rulesData.action)
690
+ rulesList = rulesData.action;
691
+
692
+ for (let index = 0; index < rulesList.length; index++) {
693
+
694
+ let rules = rulesList[index];
695
+
696
+
697
+ if (rules.Condition == 'ClearFieldValue') {
698
+ this._PageForm.form.get(rules.Field).setValue('', { entitySelf:true });
699
+ this.setDDLFieldDesc(rules.Field,"");
700
+ }
701
+
702
+ if (rules.Condition == 'SetFieldValue') {
703
+ let _rulesValue = rules.Value
704
+ try {
705
+ let _handleData = this._PageForm.form.value;
706
+ _handleData.data = RestData;
707
+ _handleData.currentLang = this.globalService.CurrentLanguage;
708
+ if (this.ParameterData)
709
+ _handleData.params = this.ParameterData;
710
+ let _rulesValueArr:any[] =rules.Value.split('<br>');
711
+
712
+ _rulesValue = this.hanbleBarHtml(_rulesValueArr[0], _handleData)
713
+ this._PageForm.form.get(rules.Field).setValue(_rulesValue, { entitySelf:true });
714
+
715
+ let _currentfield = this.EntityFieldList.filter(y => y.Description == rules.Field)[0];
716
+ if(_rulesValue &&(_currentfield.DataType == E_DataType.date || _currentfield.DataType == E_DataType.dateTime)){
717
+ this._PageForm.form.get(rules.Field).setValue(new Date(_rulesValue), { entitySelf:true });
718
+ }
719
+
720
+ if(_rulesValueArr.length>1) {
721
+ let _rulesValueDes = this.hanbleBarHtml(_rulesValueArr[1], _handleData)
722
+ this.setDDLFieldDesc(rules.Field,_rulesValueDes)
723
+ }
724
+ }
725
+ catch (err) {
726
+ alert("SetFieldValueerr -"+ err);
727
+ console.log(err);
728
+ // this._PageForm.form.get(rules.Field).setValue(_rulesValue, { onlySelf: true });
729
+ }
730
+ }
731
+
732
+ if (rules.Condition == 'CopyFieldValue') {
733
+ if (rules.Value)
734
+ this._PageForm.form.get(rules.Value).setValue(this._PageForm.form.get(rules.Field).value, { entitySelf:true });
735
+ }
736
+
737
+ if (rules.Condition == 'RemoveValidation') {
738
+ this._PageForm.form.controls[rules.Field].setValidators([]);
739
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity();
740
+
741
+ this.fieldValidation.map(x => {
742
+ if (x.Field == rules.Field) {
743
+ x.Validators =[];
744
+ }
745
+ });
746
+
747
+
748
+ }
749
+
750
+ if (rules.Condition == 'AddValidation') {
751
+
752
+ if (rules.Type == 'Required') {
753
+ this._PageForm.form.controls[rules.Field].setValidators([Validators.required]);
754
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
755
+ }
756
+ if (rules.Type == 'MinMax') {
757
+
758
+ let validateArry = [Validators.required];
759
+ if (rules.Value)
760
+ validateArry.push(Validators.min(rules.Value))
761
+ if (rules.ValueTwo)
762
+ validateArry.push(Validators.max(rules.ValueTwo))
763
+
764
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
765
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
766
+ }
767
+
768
+ if (rules.Type == 'MinLength') {
769
+
770
+ let validateArry = [Validators.required];
771
+ if (rules.Value)
772
+ validateArry.push(Validators.minLength(rules.Value))
773
+
774
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
775
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
776
+ }
777
+ if (rules.Type == 'MaxLength') {
778
+
779
+ let validateArry = [Validators.required];
780
+ if (rules.Value)
781
+ validateArry.push(Validators.maxLength(rules.Value))
782
+
783
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
784
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
785
+ }
786
+ if (rules.Type == 'Pattern') {
787
+ this._PageForm.form.controls[rules.Field].setValidators([Validators.pattern(rules.Value)]);
788
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
789
+ }
790
+ this.setValidationOnField(rules.Field,rules.ValidationMessage,rules.ValidationMessageAr,rules.Type)
791
+
792
+ if (this.fieldValidation.filter(x => x.Field == rules.Field).length < 1) {
793
+ this.fieldValidation.push({ Field: rules.Field, Validators: [] })
794
+ }
795
+ this.fieldValidation.map(x => {
796
+ if (x.Field == rules.Field) {
797
+ if (rules.Type == 'Required') {
798
+ x.Validators.push(Validators.required);
799
+ }
800
+ else if (rules.Type == 'MinMax') {
801
+ if (rules.Value)
802
+ x.Validators.push(Validators.min(rules.Value));
803
+ if (rules.ValueTwo)
804
+ x.Validators.push(Validators.max(rules.ValueTwo));
805
+ }
806
+ else if (rules.Type == 'MinLength') {
807
+ if (rules.Value)
808
+ x.Validators.push(Validators.minLength(rules.Value));
809
+ }
810
+ else if (rules.Type == 'MaxLength') {
811
+ if (rules.Value)
812
+ x.Validators.push(Validators.maxLength(rules.Value));
813
+ }
814
+ else if (rules.Type == 'Pattern') {
815
+ if (rules.Value)
816
+ x.Validators.push(Validators.pattern(rules.Value));
817
+ }
818
+ }
819
+ });
820
+
821
+ let _Validators = this.fieldValidation.filter(x=>x.Field==rules.Field)[0].Validators;
822
+
823
+
824
+ this._PageForm.form.controls[rules.Field].setValidators(_Validators);
825
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity();
826
+
827
+
828
+ }
829
+
830
+ if (rules.Condition == 'IsEditable') {
831
+ if (rules.Value == 'true') {
832
+ this.setReadOnlyOnField(rules.Field,true)
833
+ }
834
+ else if (rules.Value == 'false') {
835
+ this.setReadOnlyOnField(rules.Field,false)
836
+ }
837
+ }
838
+ if (rules.Condition == 'IsVisible') {
839
+ if (rules.Value == 'true') {
840
+ this.setIsHideOnField(rules.Field, false)
841
+ }
842
+ else if (rules.Value == 'false') {
843
+ this.setIsHideOnField(rules.Field, true)
844
+ }
845
+ }
846
+ if (rules.Condition == 'Datasource') {
847
+ this.getDatasoureData(rules.Value,rules.ValueTwo,rules.ValueThree);
848
+ }
849
+
850
+ }
851
+ }
852
+
853
+ getDatasoureData(EntityFormId,Fields,Triggr){
854
+
855
+ this.entityTypeSetup.getSingleEntityTypeFormById(EntityFormId)
856
+ .subscribe(
857
+ (res: any) => {
858
+
859
+ let _EntityTypeForm = res;
860
+ if(_EntityTypeForm.DataSource) {
861
+ let RestData =JSON.parse( _EntityTypeForm.DataSource)
862
+
863
+ let _hanbleBardata:any ={};
864
+ _hanbleBardata.FormData = this._PageForm.form.value;
865
+
866
+ for (let key in _hanbleBardata.FormData) {
867
+ if (Object.prototype.toString.call(_hanbleBardata.FormData[key]) === '[object Date]') {
868
+ _hanbleBardata.FormData[key] = GetFormattedDateWithTime(_hanbleBardata.FormData[key]);
869
+ }
870
+ }
871
+
872
+ RestData.URL = this.hanbleBarHtml(RestData.URL,_hanbleBardata);
873
+ RestData.Body = this.hanbleBarHtml(RestData.Body,_hanbleBardata);
874
+ RestData.QueryStrings = RestData.QueryStrings.map(x => {
875
+
876
+ x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
877
+
878
+ if(x.Value)
879
+ return x
880
+ });
881
+
882
+ RestData.Headers = RestData.Headers.map(x => {
883
+ x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
884
+ return x
885
+ });
886
+
887
+ this.entityTypeSetup.dynamicAPi(RestData)
888
+ .subscribe((res: any) => {
889
+
890
+ let _data: any = res;
891
+ if (RestData.ResponseView) {
892
+ let _rview = RestData.ResponseView.split(".");
893
+ _rview.forEach(x => {
894
+ _data = _data[x];
895
+ });
896
+ }
897
+
898
+ try {
899
+ if(Fields){
900
+ let _Fields = JSON.parse(JSON.parse(Fields));
901
+ _Fields.forEach(x => {
902
+ let _valuedata = RestData.ResponseType=="text"?_data : _data[x.Value];
903
+
904
+ let _value = _valuedata;
905
+ let currentfield = this.EntityFieldList.filter(y => y.Description == x.Field)[0];
906
+
907
+ if(currentfield.DataType == E_DataType.date || currentfield.DataType == E_DataType.dateTime){
908
+ _value = new Date(_data[x.Value]);
909
+ }
910
+ let _handleData = this._PageForm.form.value;
911
+ for (let key in _handleData) {
912
+ if (Object.prototype.toString.call(_handleData[key]) === '[object Date]') {
913
+ _handleData[key] = GetFormattedDateWithTime(_handleData[key]);
914
+ }
915
+ }
916
+ _handleData.data = _data;
917
+ _handleData.currentLang = this.globalService.CurrentLanguage;
918
+ _value = this.hanbleBarHtml(_value, _handleData);
919
+ this._PageForm.form.get(x.Field).setValue(_value, { entitySelf: true });
920
+
921
+ });
922
+ }
923
+ if(Triggr){
924
+ let _TriggrFields = JSON.parse(JSON.parse(Triggr));
925
+ _TriggrFields.forEach(x => {
926
+
927
+ let _Triggrfield = this.EntityFieldList.filter(y => y.Description == x.Field)[0]
928
+ if (_Triggrfield)
929
+ this.FieldChangeEvent(_Triggrfield, null)
930
+
931
+ });
932
+ }
933
+
934
+ }
935
+ catch (err) {
936
+
937
+ alert(err)
938
+ }
939
+
940
+ },
941
+ (error) => {
942
+
943
+ console.log(error);
944
+ Swal.fire(errorMessageType(error));
945
+ });
946
+ }
947
+ },
948
+
949
+ (error) => {
950
+
951
+ console.log(error);
952
+ }
953
+ );
954
+
955
+ }
956
+
957
+
958
+ AllRules:any =null;
959
+ getAllRules(EntityTypeId) {
960
+
961
+ this.entityTypeSetup.getAllRulesWithTemplateData(EntityTypeId).subscribe(
962
+ (res: any) => {
963
+
964
+ this.AllRules = res;
965
+
966
+ },
967
+ (error)=>{
968
+
969
+ }
970
+ )
971
+ }
972
+
973
+ hanbleBarHtml(_code, data?) {
974
+
975
+ if (!data || (typeof data != 'object'))
976
+ data = {};
977
+ data.Local = localStorage;
978
+ if (data.Local.userInfo && (typeof data.Local.userInfo == 'string'))
979
+ data.LocalUserInfo = JSON.parse(data.Local.userInfo);
980
+ data.Cookies = this.Cookies;
981
+ data.System = this.globalService.SystemConfigs;
982
+ if (_code && data) {
983
+ let template = handlebars.compile(_code);
984
+ let result = template(data);
985
+ return result
986
+ }
987
+ else {
988
+ return _code
989
+ }
990
+
991
+ }
992
+
993
+ get Cookies() {
994
+ let cookies = document.cookie.split(';');
995
+ let cookie = {};
996
+ for (let i = 0; i < cookies.length; i++) {
997
+ let hash = (cookies[i].split('='));
998
+ let _key = hash[0].toString().replace(" ", "");
999
+ cookie[_key] = hash[1];
1000
+ }
1001
+ return cookie;
1002
+ }
1003
+
1004
+ setValidationOnField(Field,ValidationMessage,ValidationMessageAr,Type) {
1005
+ this.pageGroups.map((PG) => {
1006
+
1007
+ PG.Groups.map((group) => {
1008
+ group.Fields.map((PGF) => {
1009
+ if (PGF.Description == Field) {
1010
+ let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr,Type:Type }
1011
+ if (PGF.ValidationMessage) {
1012
+ if (PGF.ValidationMessage.filter(x => (x.Type==temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
1013
+ PGF.ValidationMessage.push(temp)
1014
+ }
1015
+ else
1016
+ PGF.ValidationMessage = [temp];
1017
+
1018
+ }
1019
+ })
1020
+ })
1021
+
1022
+ })
1023
+ this.defaultPageGroups.map((PG) => {
1024
+
1025
+ PG.Groups.map((group) => {
1026
+ group.Fields.map((PGF) => {
1027
+ if (PGF.Description == Field) {
1028
+ let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr,Type:Type }
1029
+ if (PGF.ValidationMessage) {
1030
+ if (PGF.ValidationMessage.filter(x => (x.Type==temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
1031
+ PGF.ValidationMessage.push(temp)
1032
+ }
1033
+ else
1034
+ PGF.ValidationMessage = [temp];
1035
+
1036
+ }
1037
+ })
1038
+ })
1039
+
1040
+ })
1041
+ }
1042
+
1043
+ setDDLFieldDesc(Field, value) {
1044
+ this.pageGroups.map((PG) => {
1045
+
1046
+ PG.Groups.map((group) => {
1047
+ group.Fields.map((PGF) => {
1048
+ if (PGF.Description == Field) {
1049
+ PGF.showSelectedValues = value
1050
+ }
1051
+
1052
+ })
1053
+ })
1054
+
1055
+ })
1056
+ this.defaultPageGroups.map((PG) => {
1057
+
1058
+ PG.Groups.map((group) => {
1059
+ group.Fields.map((PGF) => {
1060
+ if (PGF.Description == Field) {
1061
+ PGF.showSelectedValues = value
1062
+ }
1063
+
1064
+ })
1065
+ })
1066
+
1067
+ })
1068
+ }
1069
+
1070
+ setReadOnlyOnField(Field,IsReadonly:boolean) {
1071
+ this.pageGroups.map((PG) => {
1072
+
1073
+ PG.Groups.map((group) => {
1074
+ group.Fields.map((PGF) => {
1075
+ if(PGF.Description ==Field) {
1076
+ PGF.IsReadonly = IsReadonly
1077
+ }
1078
+
1079
+ })
1080
+ })
1081
+
1082
+ })
1083
+ this.defaultPageGroups.map((PG) => {
1084
+
1085
+ PG.Groups.map((group) => {
1086
+ group.Fields.map((PGF) => {
1087
+ if(PGF.Description ==Field) {
1088
+ PGF.IsReadonly = IsReadonly
1089
+ }
1090
+
1091
+ })
1092
+ })
1093
+
1094
+ })
1095
+ }
1096
+ setIsHideOnField(Field, IsHide: boolean) {
1097
+ this.pageGroups.map((PG) => {
1098
+
1099
+ PG.Groups.map((group) => {
1100
+ group.Fields.map((PGF) => {
1101
+ if (PGF.Description == Field) {
1102
+ PGF.IsHide = IsHide
1103
+ }
1104
+
1105
+ })
1106
+ })
1107
+
1108
+ })
1109
+ this.defaultPageGroups.map((PG) => {
1110
+
1111
+ PG.Groups.map((group) => {
1112
+ group.Fields.map((PGF) => {
1113
+ if (PGF.Description == Field) {
1114
+ PGF.IsHide = IsHide
1115
+ }
1116
+
1117
+ })
1118
+ })
1119
+
1120
+ })
1121
+ }
1122
+
1123
+ fieldValidation:FieldValidators[] =[];
1124
+
1125
+ // TempFieldValidators() {
1126
+ // this.EntityFieldList.map((field)=> {
1127
+ // if(field.IsMandatory ) {
1128
+ // this.fieldValidation.push({Field:field.Description,Validators:[Validators.required]})
1129
+ // }
1130
+ // });
1131
+ // }
1132
+
1133
+ translatePipe = new TranslatePipe(this.globalService);
1134
+ }
1135
+
1136
+
1137
+ export function registerHandlebarHelperMethodsNew(handlebarObj) {
1138
+
1139
+
1140
+ handlebarObj.registerHelper('isNotNullAndNotUndefined', function (value) {
1141
+ if (value == null || value == undefined) return false
1142
+ else return true
1143
+ })
1144
+
1145
+ handlebarObj.registerHelper('MoneyPipe', function (value, prefix = '$', count = 2) {
1146
+ if (isNaN(parseFloat(value))) {
1147
+ return null
1148
+ } else
1149
+ return `${prefix}${parseFloat(value).toFixed(count)}`; // $2312.00
1150
+ })
1151
+
1152
+ handlebarObj.registerHelper('BoolPile', function (value) {
1153
+ return value == true ? "YES" : "NO"
1154
+ })
1155
+
1156
+ handlebarObj.registerHelper('NillPipe', function (value, cond) {
1157
+ if (value) {
1158
+ return value
1159
+ }
1160
+ else {
1161
+ if (cond == "0") {
1162
+ return "0"
1163
+ }
1164
+ else
1165
+ return "NIL"
1166
+ }
1167
+ })
1168
+
1169
+
1170
+ /* #region Date */
1171
+
1172
+ handlebarObj.registerHelper('TodayDatePipe', function (formate) {
1173
+ let date = new Date();
1174
+
1175
+ switch (formate) {
1176
+ case "DATE":
1177
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1178
+ case "DATE_TIME":
1179
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1180
+ case "DATE_TIME_FULL":
1181
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1182
+ case "TIME":
1183
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1184
+ case "TIME_FULL":
1185
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1186
+ default:
1187
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1188
+ }
1189
+
1190
+ })
1191
+ handlebarObj.registerHelper('DatePipe', function (date, formate) {
1192
+ if (date) {
1193
+ switch (formate) {
1194
+ case "DATE":
1195
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1196
+ case "DATE_TIME":
1197
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1198
+ case "DATE_TIME_FULL":
1199
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1200
+ case "TIME":
1201
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1202
+ case "TIME_FULL":
1203
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1204
+ default:
1205
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1206
+ }
1207
+ }
1208
+ else {
1209
+ return date
1210
+ }
1211
+ })
1212
+
1213
+ handlebarObj.registerHelper('AddtionalDatePipe', function (curdate, day, formate) {
1214
+
1215
+ if (curdate && day) {
1216
+
1217
+ var date = new Date(curdate);
1218
+ date.setDate(date.getDate() + parseInt(day));
1219
+ if (formate) {
1220
+
1221
+ switch (formate) {
1222
+ case "DATE":
1223
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1224
+ case "DATE_TIME":
1225
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1226
+ case "DATE_TIME_FULL":
1227
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1228
+ case "TIME":
1229
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1230
+ case "TIME_FULL":
1231
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1232
+ default:
1233
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1234
+ }
1235
+ }
1236
+ else {
1237
+ return date
1238
+ }
1239
+ }
1240
+ else {
1241
+ return date
1242
+ }
1243
+ })
1244
+
1245
+ handlebarObj.registerHelper('SubDatePipe', function (curdate, day, formate) {
1246
+ if (curdate && day) {
1247
+
1248
+ var date = new Date(curdate);
1249
+ date.setDate(date.getDate() - parseInt(day));
1250
+ if (formate) {
1251
+
1252
+ switch (formate) {
1253
+ case "DATE":
1254
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1255
+ case "DATE_TIME":
1256
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1257
+ case "DATE_TIME_FULL":
1258
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1259
+ case "TIME":
1260
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1261
+ case "TIME_FULL":
1262
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1263
+ default:
1264
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1265
+ }
1266
+ }
1267
+ else {
1268
+ return date
1269
+ }
1270
+ }
1271
+ else {
1272
+ return date
1273
+ }
1274
+ })
1275
+
1276
+ /* #endregion */
1277
+
1278
+ /* #region Arithmetic */
1279
+
1280
+ handlebarObj.registerHelper('Addition', function (value, value2) {
1281
+
1282
+ let val = value + value2;
1283
+ if (!isNaN(value) && !isNaN(value2))
1284
+ val = Number(value) + Number(value2);
1285
+ return val
1286
+ })
1287
+
1288
+ handlebarObj.registerHelper('Subtraction', function (value, value2) {
1289
+ let val = value - value2;
1290
+ if (!isNaN(value) && !isNaN(value2))
1291
+ val = Number(value) - Number(value2);
1292
+ return val
1293
+ })
1294
+ handlebarObj.registerHelper('Multiplication', function (value, value2, value3?) {
1295
+
1296
+ if (!isNaN(value) && !isNaN(value2)) {
1297
+ let val = Number(value) * Number(value2);
1298
+ if (!isNaN(value3))
1299
+ val = Number(value) * Number(value2) * Number(value3);
1300
+ return val
1301
+ }
1302
+ else {
1303
+ return "";
1304
+ }
1305
+ })
1306
+
1307
+ handlebarObj.registerHelper('Division', function (value, value2) {
1308
+
1309
+ if (!isNaN(value) && !isNaN(value2)) {
1310
+ let val = Number(value) / Number(value2);
1311
+ return val
1312
+ }
1313
+ else {
1314
+ return "";
1315
+ }
1316
+ })
1317
+
1318
+ handlebarObj.registerHelper('Remainder', function (value, value2) {
1319
+
1320
+ if (isNaN(value) && isNaN(value2)) {
1321
+ let val = value % value2;
1322
+ return val
1323
+ }
1324
+ else {
1325
+ return "";
1326
+ }
1327
+ })
1328
+
1329
+
1330
+ handlebarObj.registerHelper('lengthGreaterThen0', function (value: any[]) {
1331
+ if (value && Array.isArray(value) && value.length > 0)
1332
+ return true
1333
+ else return false
1334
+ })
1335
+
1336
+ handlebarObj.registerHelper('isNullOrUndefined', function (value: any[]) {
1337
+ if (value == null || value == undefined) return true
1338
+ else return false
1339
+ })
1340
+
1341
+ handlebarObj.registerHelper('isEqual', function (value, value2) {
1342
+
1343
+ return value == value2 ? true : false
1344
+ })
1345
+ /* #endregion */
1346
+
1347
+ handlebarObj.registerHelper('SetFieldByLang', function (Lang, value, value2,) {
1348
+
1349
+ return Lang == "Ar" ? value2 : value
1350
+ })
1351
+
1352
+
1353
+ }