cat-qw-lib 0.64.17 → 1.0.0

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 (460) hide show
  1. package/ng-package.json +10 -0
  2. package/package.json +16 -25
  3. package/src/lib/admin/action-admin/action-admin.module.ts +25 -0
  4. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.html +113 -0
  5. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.scss +4 -0
  6. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.spec.ts +119 -0
  7. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.ts +79 -0
  8. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.html +5 -0
  9. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.scss +0 -0
  10. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.spec.ts +36 -0
  11. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.ts +33 -0
  12. package/src/lib/admin/action-admin/models/admin-action.model.ts +14 -0
  13. package/src/lib/admin/action-admin/state/admin-action.query.ts +11 -0
  14. package/src/lib/admin/action-admin/state/admin-action.service.spec.ts +66 -0
  15. package/src/lib/admin/action-admin/state/admin-action.service.ts +29 -0
  16. package/src/lib/admin/action-admin/state/admin-action.state.ts +14 -0
  17. package/src/lib/admin/action-admin/state/admin-action.store.ts +14 -0
  18. package/src/lib/admin/admin.module.ts +22 -0
  19. package/src/lib/admin/api-admin/api-admin.module.ts +37 -0
  20. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.html +157 -0
  21. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.scss +12 -0
  22. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.spec.ts +134 -0
  23. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.ts +110 -0
  24. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.html +5 -0
  25. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.scss +0 -0
  26. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.spec.ts +38 -0
  27. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.ts +28 -0
  28. package/src/lib/admin/api-admin/models/api-config.model.ts +14 -0
  29. package/src/lib/admin/api-admin/state/api-admin.query.ts +16 -0
  30. package/src/lib/admin/api-admin/state/api-admin.service.ts +34 -0
  31. package/src/lib/admin/api-admin/state/api-admin.state.ts +14 -0
  32. package/src/lib/admin/api-admin/state/api-admin.store.ts +13 -0
  33. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.html +115 -0
  34. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.scss +4 -0
  35. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.spec.ts +100 -0
  36. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.ts +105 -0
  37. package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.html +64 -0
  38. package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.scss +0 -0
  39. package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.spec.ts +108 -0
  40. package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.ts +96 -0
  41. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.html +5 -0
  42. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.scss +0 -0
  43. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.spec.ts +34 -0
  44. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.ts +27 -0
  45. package/src/lib/admin/dd-admin/dd-admin.module.ts +34 -0
  46. package/src/lib/admin/dd-admin/models/api-property.model.ts +7 -0
  47. package/src/lib/admin/dd-admin/models/dd-attribute-sidebar-view.model.ts +6 -0
  48. package/src/lib/admin/dd-admin/models/dictionary.model.ts +16 -0
  49. package/src/lib/admin/dd-admin/state/dictionary.query.ts +30 -0
  50. package/src/lib/admin/dd-admin/state/dictionary.service.ts +37 -0
  51. package/src/lib/admin/dd-admin/state/dictionary.state.ts +30 -0
  52. package/src/lib/admin/dd-admin/state/dictionary.store.ts +22 -0
  53. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.html +115 -0
  54. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.scss +71 -0
  55. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.spec.ts +22 -0
  56. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.ts +185 -0
  57. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.html +24 -0
  58. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.scss +33 -0
  59. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.spec.ts +23 -0
  60. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.ts +46 -0
  61. package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.html +69 -0
  62. package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.scss +84 -0
  63. package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.spec.ts +21 -0
  64. package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.ts +93 -0
  65. package/src/lib/admin/queue-admin/models/queue.model.ts +15 -0
  66. package/src/lib/admin/queue-admin/queue-admin-routing.module.ts +17 -0
  67. package/src/lib/admin/queue-admin/queue-admin.module.ts +26 -0
  68. package/src/lib/admin/queue-admin/state/queue.query.ts +11 -0
  69. package/src/lib/admin/queue-admin/state/queue.service.ts +34 -0
  70. package/{lib/admin/queue-admin/state/queue.state.d.ts → src/lib/admin/queue-admin/state/queue.state.ts} +14 -6
  71. package/src/lib/admin/queue-admin/state/queue.store.ts +13 -0
  72. package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.html +99 -0
  73. package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.scss +3 -0
  74. package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.spec.ts +23 -0
  75. package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.ts +82 -0
  76. package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.html +41 -0
  77. package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.scss +30 -0
  78. package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.spec.ts +23 -0
  79. package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.ts +34 -0
  80. package/src/lib/admin/template-admin/models/template.model.ts +12 -0
  81. package/src/lib/admin/template-admin/state/template-admin.query.ts +17 -0
  82. package/src/lib/admin/template-admin/state/template-admin.service.ts +45 -0
  83. package/src/lib/admin/template-admin/state/template-admin.state.ts +14 -0
  84. package/src/lib/admin/template-admin/state/template-admin.store.ts +15 -0
  85. package/src/lib/admin/template-admin/template-admin.module.ts +40 -0
  86. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.html +170 -0
  87. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.scss +4 -0
  88. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.spec.ts +23 -0
  89. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.ts +139 -0
  90. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.html +5 -0
  91. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.scss +0 -0
  92. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.spec.ts +23 -0
  93. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.ts +28 -0
  94. package/src/lib/admin/widget-admin/models/widget.model.ts +35 -0
  95. package/src/lib/admin/widget-admin/state/widget-admin.query.ts +17 -0
  96. package/src/lib/admin/widget-admin/state/widget-admin.service.ts +72 -0
  97. package/src/lib/admin/widget-admin/state/widget-admin.state.ts +14 -0
  98. package/src/lib/admin/widget-admin/state/widget-admin.store.ts +15 -0
  99. package/src/lib/admin/widget-admin/widget-admin.module.ts +30 -0
  100. package/src/lib/queue/ASSIGNMENT_FUNCTIONALITY.md +114 -0
  101. package/src/lib/queue/CHECKBOX_SELECTION_EXAMPLE.md +240 -0
  102. package/src/lib/queue/CONTENT_PROJECTION_GUIDE.md +163 -0
  103. package/src/lib/queue/components/queue-container/queue-container.component.html +37 -0
  104. package/src/lib/queue/components/queue-container/queue-container.component.scss +7 -0
  105. package/src/lib/queue/components/queue-container/queue-container.component.ts +155 -0
  106. package/src/lib/queue/components/queue-item/queue-item.component.html +37 -0
  107. package/src/lib/queue/components/queue-item/queue-item.component.scss +105 -0
  108. package/src/lib/queue/components/queue-item/queue-item.component.spec.ts +104 -0
  109. package/src/lib/queue/components/queue-item/queue-item.component.ts +67 -0
  110. package/src/lib/queue/components/queue-list/queue-list.component.html +4 -0
  111. package/src/lib/queue/components/queue-list/queue-list.component.scss +0 -0
  112. package/src/lib/queue/components/queue-list/queue-list.component.spec.ts +46 -0
  113. package/src/lib/queue/components/queue-list/queue-list.component.ts +18 -0
  114. package/src/lib/queue/components/queue-record-table/queue-record-table.component.html +14 -0
  115. package/src/lib/queue/components/queue-record-table/queue-record-table.component.scss +1 -0
  116. package/src/lib/queue/components/queue-record-table/queue-record-table.component.ts +241 -0
  117. package/src/lib/queue/components/queue-search/queue-search.component.html +11 -0
  118. package/src/lib/queue/components/queue-search/queue-search.component.scss +36 -0
  119. package/src/lib/queue/components/queue-search/queue-search.component.spec.ts +121 -0
  120. package/src/lib/queue/components/queue-search/queue-search.component.ts +77 -0
  121. package/src/lib/queue/models/queue.model.ts +11 -0
  122. package/src/lib/queue/queue-routing.module.ts +21 -0
  123. package/src/lib/queue/queue.module.ts +48 -0
  124. package/src/lib/queue/services/application-assignment.service.ts +27 -0
  125. package/src/lib/queue/services/queue-record-table-builder.service.ts +66 -0
  126. package/src/lib/queue/state/queue.service.ts +85 -0
  127. package/src/lib/queue/state/queue.state.ts +13 -0
  128. package/src/lib/queue/state/queue.store.ts +14 -0
  129. package/src/lib/shared/_base/base-container/base-container.component.html +1 -0
  130. package/src/lib/shared/_base/base-container/base-container.component.scss +0 -0
  131. package/src/lib/shared/_base/base-container/base-container.component.spec.ts +21 -0
  132. package/src/lib/shared/_base/base-container/base-container.component.ts +19 -0
  133. package/src/lib/shared/_base/base-control/base-control.component.html +1 -0
  134. package/src/lib/shared/_base/base-control/base-control.component.scss +0 -0
  135. package/src/lib/shared/_base/base-control/base-control.component.spec.ts +21 -0
  136. package/src/lib/shared/_base/base-control/base-control.component.ts +91 -0
  137. package/src/lib/shared/_base/base-form/base-form.component.html +1 -0
  138. package/src/lib/shared/_base/base-form/base-form.component.scss +0 -0
  139. package/src/lib/shared/_base/base-form/base-form.component.spec.ts +133 -0
  140. package/src/lib/shared/_base/base-form/base-form.component.ts +203 -0
  141. package/src/lib/shared/_base/base-list/base-list.component.html +1 -0
  142. package/src/lib/shared/_base/base-list/base-list.component.scss +0 -0
  143. package/src/lib/shared/_base/base-list/base-list.component.spec.ts +21 -0
  144. package/src/lib/shared/_base/base-list/base-list.component.ts +47 -0
  145. package/src/lib/shared/components/form-container/form-container.component.html +54 -0
  146. package/src/lib/shared/components/form-container/form-container.component.scss +94 -0
  147. package/src/lib/shared/components/form-container/form-container.component.spec.ts +21 -0
  148. package/src/lib/shared/components/form-container/form-container.component.ts +75 -0
  149. package/src/lib/shared/components/list/block-list.component.html +44 -0
  150. package/src/lib/shared/components/list/block-list.component.scss +46 -0
  151. package/src/lib/shared/components/list/block-list.component.spec.ts +21 -0
  152. package/src/lib/shared/components/list/block-list.component.ts +57 -0
  153. package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.html +24 -0
  154. package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.scss +36 -0
  155. package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.spec.ts +21 -0
  156. package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.ts +25 -0
  157. package/src/lib/shared/components/sidebar/sidebar.component.html +13 -0
  158. package/src/lib/shared/components/sidebar/sidebar.component.scss +42 -0
  159. package/src/lib/shared/components/sidebar/sidebar.component.spec.ts +24 -0
  160. package/src/lib/shared/components/sidebar/sidebar.component.ts +26 -0
  161. package/src/lib/shared/constant/CSS.ts +9 -0
  162. package/src/lib/shared/constant/DATASOURCES.ts +19 -0
  163. package/src/lib/shared/constant/ERROR.ts +17 -0
  164. package/src/lib/shared/constant/HEADERS.ts +4 -0
  165. package/src/lib/shared/constant/LIST-CONFIG.ts +28 -0
  166. package/src/lib/shared/constant/LOOKUPS.ts +3 -0
  167. package/src/lib/shared/constant/MESSAGES.ts +7 -0
  168. package/src/lib/shared/constant/PERMISSION.ts +16 -0
  169. package/src/lib/shared/constant/ROUTES.ts +16 -0
  170. package/src/lib/shared/constant/SHARED.ts +420 -0
  171. package/src/lib/shared/constant/URLS.ts +7 -0
  172. package/src/lib/shared/controls/button/button.component.html +25 -0
  173. package/src/lib/shared/controls/button/button.component.scss +0 -0
  174. package/src/lib/shared/controls/button/button.component.spec.ts +21 -0
  175. package/src/lib/shared/controls/button/button.component.ts +15 -0
  176. package/src/lib/shared/controls/check-box/check-box.component.html +22 -0
  177. package/src/lib/shared/controls/check-box/check-box.component.scss +32 -0
  178. package/src/lib/shared/controls/check-box/check-box.component.spec.ts +26 -0
  179. package/src/lib/shared/controls/check-box/check-box.component.ts +19 -0
  180. package/src/lib/shared/controls/date/date.component.html +43 -0
  181. package/src/lib/shared/controls/date/date.component.scss +0 -0
  182. package/src/lib/shared/controls/date/date.component.spec.ts +21 -0
  183. package/src/lib/shared/controls/date/date.component.ts +44 -0
  184. package/src/lib/shared/controls/dropdown/dropdown.component.html +32 -0
  185. package/src/lib/shared/controls/dropdown/dropdown.component.scss +12 -0
  186. package/src/lib/shared/controls/dropdown/dropdown.component.ts +79 -0
  187. package/src/lib/shared/controls/file-upload/file-upload.component.html +18 -0
  188. package/src/lib/shared/controls/file-upload/file-upload.component.scss +0 -0
  189. package/src/lib/shared/controls/file-upload/file-upload.component.spec.ts +21 -0
  190. package/src/lib/shared/controls/file-upload/file-upload.component.ts +19 -0
  191. package/src/lib/shared/controls/number-feild/number-feild.component.html +39 -0
  192. package/src/lib/shared/controls/number-feild/number-feild.component.scss +13 -0
  193. package/src/lib/shared/controls/number-feild/number-feild.component.spec.ts +21 -0
  194. package/src/lib/shared/controls/number-feild/number-feild.component.ts +35 -0
  195. package/src/lib/shared/controls/password/password.component.html +25 -0
  196. package/src/lib/shared/controls/password/password.component.scss +0 -0
  197. package/src/lib/shared/controls/password/password.component.spec.ts +28 -0
  198. package/src/lib/shared/controls/password/password.component.ts +26 -0
  199. package/src/lib/shared/controls/text-area/text-area.component.html +38 -0
  200. package/src/lib/shared/controls/text-area/text-area.component.scss +22 -0
  201. package/src/lib/shared/controls/text-area/text-area.component.spec.ts +23 -0
  202. package/src/lib/shared/controls/text-area/text-area.component.ts +25 -0
  203. package/src/lib/shared/controls/text-box/text-box.component.html +39 -0
  204. package/src/lib/shared/controls/text-box/text-box.component.scss +25 -0
  205. package/src/lib/shared/controls/text-box/text-box.component.spec.ts +30 -0
  206. package/src/lib/shared/controls/text-box/text-box.component.ts +26 -0
  207. package/src/lib/shared/controls/username/username.component.html +20 -0
  208. package/src/lib/shared/controls/username/username.component.scss +0 -0
  209. package/src/lib/shared/controls/username/username.component.spec.ts +29 -0
  210. package/src/lib/shared/controls/username/username.component.ts +17 -0
  211. package/src/lib/shared/directives/permission.directive.spec.ts +60 -0
  212. package/src/lib/shared/directives/permission.directive.ts +39 -0
  213. package/{lib/shared/index.d.ts → src/lib/shared/index.ts} +39 -34
  214. package/src/lib/shared/models/attribute.model.ts +44 -0
  215. package/src/lib/shared/models/base.model.ts +4 -0
  216. package/{lib/widget/models/custom-widget.model.d.ts → src/lib/shared/models/custom-widget.model.ts} +14 -13
  217. package/src/lib/shared/models/list.model.ts +27 -0
  218. package/src/lib/shared/models/message.model.ts +4 -0
  219. package/src/lib/shared/models/meta-data.model.ts +6 -0
  220. package/src/lib/shared/pipe/capitalize-words.pipe.spec.ts +8 -0
  221. package/src/lib/shared/pipe/capitalize-words.pipe.ts +17 -0
  222. package/src/lib/shared/services/app-config.service.spec.ts +16 -0
  223. package/src/lib/shared/services/app-config.service.ts +56 -0
  224. package/src/lib/shared/services/auth/auth.guard.spec.ts +47 -0
  225. package/src/lib/shared/services/auth/auth.guard.ts +25 -0
  226. package/src/lib/shared/services/custom-widget.service.ts +29 -0
  227. package/src/lib/shared/services/data-transformer.service.spec.ts +16 -0
  228. package/src/lib/shared/services/data-transformer.service.ts +41 -0
  229. package/src/lib/shared/services/date-parser.service.spec.ts +16 -0
  230. package/src/lib/shared/services/date-parser.service.ts +54 -0
  231. package/src/lib/shared/services/form-state.service.spec.ts +16 -0
  232. package/src/lib/shared/services/form-state.service.ts +50 -0
  233. package/src/lib/shared/services/list.service.spec.ts +16 -0
  234. package/src/lib/shared/services/list.service.ts +54 -0
  235. package/src/lib/shared/services/session.service.spec.ts +16 -0
  236. package/src/lib/shared/services/session.service.ts +44 -0
  237. package/src/lib/shared/services/style-builder.service.spec.ts +16 -0
  238. package/src/lib/shared/services/style-builder.service.ts +61 -0
  239. package/src/lib/shared/services/table.builder.ts +43 -0
  240. package/src/lib/shared/services/validator.service.spec.ts +16 -0
  241. package/src/lib/shared/services/validator.service.ts +13 -0
  242. package/src/lib/shared/shared.module.ts +68 -0
  243. package/src/lib/shared/state/base.query.ts +73 -0
  244. package/src/lib/shared/state/base.service.ts +104 -0
  245. package/{lib/shared/state/base.state.d.ts → src/lib/shared/state/base.state.ts} +10 -10
  246. package/src/lib/shared/state/base.store.ts +89 -0
  247. package/src/lib/shared/table-primary/components/table-primary.component.html +99 -0
  248. package/src/lib/shared/table-primary/components/table-primary.component.scss +226 -0
  249. package/src/lib/shared/table-primary/components/table-primary.component.spec.ts +21 -0
  250. package/src/lib/shared/table-primary/components/table-primary.component.ts +191 -0
  251. package/src/lib/shared/table-primary/models/table-primary-header.model.ts +7 -0
  252. package/src/lib/shared/table-primary/models/table-primary.model.ts +13 -0
  253. package/src/lib/shared/table-secondary/components/table-secondary.component.html +162 -0
  254. package/src/lib/shared/table-secondary/components/table-secondary.component.scss +406 -0
  255. package/src/lib/shared/table-secondary/components/table-secondary.component.spec.ts +95 -0
  256. package/src/lib/shared/table-secondary/components/table-secondary.component.ts +235 -0
  257. package/src/lib/shared/table-secondary/index.ts +3 -0
  258. package/src/lib/shared/table-secondary/models/table-secondary-form.model.ts +12 -0
  259. package/src/lib/shared/table-secondary/models/table-secondary-header.model.ts +7 -0
  260. package/src/lib/shared/table-secondary/models/table-secondary.model.ts +20 -0
  261. package/src/lib/widget/components/custom-widget/custom-widget.component.html +71 -0
  262. package/src/lib/widget/components/custom-widget/custom-widget.component.scss +43 -0
  263. package/src/lib/widget/components/custom-widget/custom-widget.component.spec.ts +23 -0
  264. package/src/lib/widget/components/custom-widget/custom-widget.component.ts +27 -0
  265. package/src/lib/widget/components/widget-body/widget-body.component.html +14 -0
  266. package/src/lib/widget/components/widget-body/widget-body.component.scss +16 -0
  267. package/src/lib/widget/components/widget-body/widget-body.component.spec.ts +23 -0
  268. package/src/lib/widget/components/widget-body/widget-body.component.ts +39 -0
  269. package/src/lib/widget/components/widget-container/widget-container.component.html +21 -0
  270. package/src/lib/widget/components/widget-container/widget-container.component.scss +86 -0
  271. package/src/lib/widget/components/widget-container/widget-container.component.spec.ts +56 -0
  272. package/src/lib/widget/components/widget-container/widget-container.component.ts +47 -0
  273. package/src/lib/widget/components/widget-footer/widget-footer.component.html +10 -0
  274. package/src/lib/widget/components/widget-footer/widget-footer.component.scss +0 -0
  275. package/src/lib/widget/components/widget-footer/widget-footer.component.spec.ts +23 -0
  276. package/src/lib/widget/components/widget-footer/widget-footer.component.ts +25 -0
  277. package/src/lib/widget/components/widget-header/widget-header.component.html +13 -0
  278. package/src/lib/widget/components/widget-header/widget-header.component.scss +25 -0
  279. package/src/lib/widget/components/widget-header/widget-header.component.spec.ts +108 -0
  280. package/src/lib/widget/components/widget-header/widget-header.component.ts +31 -0
  281. package/src/lib/widget/components/widget-item/widget-item.component.html +60 -0
  282. package/src/lib/widget/components/widget-item/widget-item.component.scss +83 -0
  283. package/src/lib/widget/components/widget-item/widget-item.component.spec.ts +159 -0
  284. package/src/lib/widget/components/widget-item/widget-item.component.ts +119 -0
  285. package/src/lib/widget/components/widget-main/widget-main.component.html +9 -0
  286. package/src/lib/widget/components/widget-main/widget-main.component.scss +0 -0
  287. package/src/lib/widget/components/widget-main/widget-main.component.spec.ts +60 -0
  288. package/src/lib/widget/components/widget-main/widget-main.component.ts +30 -0
  289. package/src/lib/widget/components/widget-menu/widget-menu.component.html +28 -0
  290. package/src/lib/widget/components/widget-menu/widget-menu.component.scss +0 -0
  291. package/src/lib/widget/components/widget-menu/widget-menu.component.spec.ts +251 -0
  292. package/src/lib/widget/components/widget-menu/widget-menu.component.ts +139 -0
  293. package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.html +15 -0
  294. package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.scss +11 -0
  295. package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.spec.ts +23 -0
  296. package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.ts +12 -0
  297. package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.html +28 -0
  298. package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.scss +66 -0
  299. package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.spec.ts +23 -0
  300. package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.ts +172 -0
  301. package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.html +24 -0
  302. package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.scss +19 -0
  303. package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.spec.ts +23 -0
  304. package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.ts +14 -0
  305. package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.html +30 -0
  306. package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.scss +32 -0
  307. package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.spec.ts +23 -0
  308. package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.ts +69 -0
  309. package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.html +22 -0
  310. package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.scss +0 -0
  311. package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.spec.ts +69 -0
  312. package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.ts +54 -0
  313. package/{lib/shared/models/custom-widget.model.d.ts → src/lib/widget/models/custom-widget.model.ts} +14 -13
  314. package/src/lib/widget/models/progress-chart.model.ts +11 -0
  315. package/src/lib/widget/models/widget.model.ts +51 -0
  316. package/src/lib/widget/state/widget.query.ts +45 -0
  317. package/src/lib/widget/state/widget.service.ts +46 -0
  318. package/src/lib/widget/state/widget.state.ts +18 -0
  319. package/src/lib/widget/state/widget.store.ts +59 -0
  320. package/src/lib/widget/widget.module.ts +39 -0
  321. package/{public-api.d.ts → src/public-api.ts} +36 -26
  322. package/tsconfig.lib.json +15 -0
  323. package/tsconfig.lib.prod.json +11 -0
  324. package/tsconfig.spec.json +15 -0
  325. package/fesm2022/cat-qw-lib.mjs +0 -6155
  326. package/fesm2022/cat-qw-lib.mjs.map +0 -1
  327. package/index.d.ts +0 -5
  328. package/lib/admin/action-admin/action-admin.module.d.ts +0 -15
  329. package/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.d.ts +0 -31
  330. package/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.d.ts +0 -18
  331. package/lib/admin/action-admin/models/admin-action.model.d.ts +0 -12
  332. package/lib/admin/action-admin/state/admin-action.service.d.ts +0 -16
  333. package/lib/admin/action-admin/state/admin-action.store.d.ts +0 -8
  334. package/lib/admin/api-admin/api-admin.module.d.ts +0 -18
  335. package/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.d.ts +0 -36
  336. package/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.d.ts +0 -18
  337. package/lib/admin/api-admin/models/api-config.model.d.ts +0 -13
  338. package/lib/admin/api-admin/state/api-admin.service.d.ts +0 -19
  339. package/lib/admin/api-admin/state/api-admin.store.d.ts +0 -8
  340. package/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.d.ts +0 -40
  341. package/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.d.ts +0 -35
  342. package/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.d.ts +0 -16
  343. package/lib/admin/dd-admin/dd-admin.module.d.ts +0 -20
  344. package/lib/admin/dd-admin/models/api-property.model.d.ts +0 -6
  345. package/lib/admin/dd-admin/models/dd-attribute-sidebar-view.model.d.ts +0 -4
  346. package/lib/admin/dd-admin/models/dictionary.model.d.ts +0 -14
  347. package/lib/admin/dd-admin/state/dictionary.query.d.ts +0 -20
  348. package/lib/admin/dd-admin/state/dictionary.service.d.ts +0 -17
  349. package/lib/admin/dd-admin/state/dictionary.store.d.ts +0 -14
  350. package/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.d.ts +0 -42
  351. package/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.d.ts +0 -18
  352. package/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.d.ts +0 -28
  353. package/lib/admin/queue-admin/models/queue.model.d.ts +0 -14
  354. package/lib/admin/queue-admin/queue-admin-routing.module.d.ts +0 -7
  355. package/lib/admin/queue-admin/queue-admin.module.d.ts +0 -16
  356. package/lib/admin/queue-admin/state/queue.query.d.ts +0 -10
  357. package/lib/admin/queue-admin/state/queue.service.d.ts +0 -16
  358. package/lib/admin/queue-admin/state/queue.store.d.ts +0 -8
  359. package/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.d.ts +0 -34
  360. package/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.d.ts +0 -18
  361. package/lib/admin/template-admin/models/template.model.d.ts +0 -11
  362. package/lib/admin/template-admin/state/template-admin.query.d.ts +0 -13
  363. package/lib/admin/template-admin/state/template-admin.service.d.ts +0 -17
  364. package/lib/admin/template-admin/state/template-admin.store.d.ts +0 -11
  365. package/lib/admin/template-admin/template-admin.module.d.ts +0 -17
  366. package/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.d.ts +0 -43
  367. package/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.d.ts +0 -17
  368. package/lib/admin/widget-admin/models/widget.model.d.ts +0 -31
  369. package/lib/admin/widget-admin/state/widget-admin.query.d.ts +0 -13
  370. package/lib/admin/widget-admin/state/widget-admin.service.d.ts +0 -23
  371. package/lib/admin/widget-admin/state/widget-admin.store.d.ts +0 -11
  372. package/lib/admin/widget-admin/widget-admin.module.d.ts +0 -20
  373. package/lib/queue/components/queue-container/queue-container.component.d.ts +0 -97
  374. package/lib/queue/components/queue-item/queue-item.component.d.ts +0 -25
  375. package/lib/queue/components/queue-list/queue-list.component.d.ts +0 -9
  376. package/lib/queue/components/queue-record-table/queue-record-table.component.d.ts +0 -80
  377. package/lib/queue/components/queue-search/queue-search.component.d.ts +0 -40
  378. package/lib/queue/models/queue.model.d.ts +0 -10
  379. package/lib/queue/queue-routing.module.d.ts +0 -7
  380. package/lib/queue/queue.module.d.ts +0 -23
  381. package/lib/queue/services/application-assignment.service.d.ts +0 -18
  382. package/lib/queue/services/queue-record-table-builder.service.d.ts +0 -10
  383. package/lib/queue/state/queue.service.d.ts +0 -45
  384. package/lib/queue/state/queue.state.d.ts +0 -4
  385. package/lib/queue/state/queue.store.d.ts +0 -8
  386. package/lib/shared/_base/base-container/base-container.component.d.ts +0 -10
  387. package/lib/shared/_base/base-control/base-control.component.d.ts +0 -34
  388. package/lib/shared/_base/base-form/base-form.component.d.ts +0 -48
  389. package/lib/shared/_base/base-list/base-list.component.d.ts +0 -26
  390. package/lib/shared/components/form-container/form-container.component.d.ts +0 -28
  391. package/lib/shared/components/list/block-list.component.d.ts +0 -16
  392. package/lib/shared/components/queue-search-customer/queue-search-customer.component.d.ts +0 -10
  393. package/lib/shared/components/sidebar/sidebar.component.d.ts +0 -13
  394. package/lib/shared/constant/CSS.d.ts +0 -11
  395. package/lib/shared/constant/DATASOURCES.d.ts +0 -18
  396. package/lib/shared/constant/ERROR.d.ts +0 -17
  397. package/lib/shared/constant/HEADERS.d.ts +0 -4
  398. package/lib/shared/constant/LIST-CONFIG.d.ts +0 -7
  399. package/lib/shared/constant/LOOKUPS.d.ts +0 -3
  400. package/lib/shared/constant/MESSAGES.d.ts +0 -7
  401. package/lib/shared/constant/PERMISSION.d.ts +0 -16
  402. package/lib/shared/constant/ROUTES.d.ts +0 -16
  403. package/lib/shared/constant/SHARED.d.ts +0 -261
  404. package/lib/shared/constant/URLS.d.ts +0 -6
  405. package/lib/shared/controls/button/button.component.d.ts +0 -6
  406. package/lib/shared/controls/check-box/check-box.component.d.ts +0 -9
  407. package/lib/shared/controls/date/date.component.d.ts +0 -14
  408. package/lib/shared/controls/dropdown/dropdown.component.d.ts +0 -24
  409. package/lib/shared/controls/file-upload/file-upload.component.d.ts +0 -7
  410. package/lib/shared/controls/password/password.component.d.ts +0 -11
  411. package/lib/shared/controls/text-area/text-area.component.d.ts +0 -8
  412. package/lib/shared/controls/text-box/text-box.component.d.ts +0 -7
  413. package/lib/shared/controls/username/username.component.d.ts +0 -6
  414. package/lib/shared/directives/permission.directive.d.ts +0 -14
  415. package/lib/shared/models/attribute.model.d.ts +0 -43
  416. package/lib/shared/models/base.model.d.ts +0 -4
  417. package/lib/shared/models/list.model.d.ts +0 -11
  418. package/lib/shared/models/meta-data.model.d.ts +0 -6
  419. package/lib/shared/pipe/capitalize-words.pipe.d.ts +0 -7
  420. package/lib/shared/services/app-config.service.d.ts +0 -19
  421. package/lib/shared/services/auth/auth.guard.d.ts +0 -12
  422. package/lib/shared/services/custom-widget.service.d.ts +0 -10
  423. package/lib/shared/services/data-transformer.service.d.ts +0 -8
  424. package/lib/shared/services/date-parser.service.d.ts +0 -7
  425. package/lib/shared/services/form-state.service.d.ts +0 -17
  426. package/lib/shared/services/list.service.d.ts +0 -13
  427. package/lib/shared/services/session.service.d.ts +0 -14
  428. package/lib/shared/services/style-builder.service.d.ts +0 -14
  429. package/lib/shared/services/table.builder.d.ts +0 -14
  430. package/lib/shared/services/validator.service.d.ts +0 -7
  431. package/lib/shared/shared.module.d.ts +0 -36
  432. package/lib/shared/state/base.query.d.ts +0 -29
  433. package/lib/shared/state/base.service.d.ts +0 -29
  434. package/lib/shared/state/base.store.d.ts +0 -36
  435. package/lib/shared/table-primary/components/table-primary.component.d.ts +0 -60
  436. package/lib/shared/table-primary/models/table-primary-header.model.d.ts +0 -6
  437. package/lib/shared/table-primary/models/table-primary.model.d.ts +0 -10
  438. package/lib/shared/table-secondary/components/table-secondary.component.d.ts +0 -132
  439. package/lib/shared/table-secondary/models/table-secondary-header.model.d.ts +0 -6
  440. package/lib/shared/table-secondary/models/table-secondary.model.d.ts +0 -17
  441. package/lib/widget/components/custom-widget/custom-widget.component.d.ts +0 -13
  442. package/lib/widget/components/widget-body/widget-body.component.d.ts +0 -17
  443. package/lib/widget/components/widget-container/widget-container.component.d.ts +0 -26
  444. package/lib/widget/components/widget-footer/widget-footer.component.d.ts +0 -16
  445. package/lib/widget/components/widget-header/widget-header.component.d.ts +0 -22
  446. package/lib/widget/components/widget-item/widget-item.component.d.ts +0 -57
  447. package/lib/widget/components/widget-main/widget-main.component.d.ts +0 -22
  448. package/lib/widget/components/widget-menu/widget-menu.component.d.ts +0 -36
  449. package/lib/widget/components/widget-menu-body/widget-menu-body.component.d.ts +0 -7
  450. package/lib/widget/components/widget-menu-container/widget-menu-container.component.d.ts +0 -48
  451. package/lib/widget/components/widget-menu-header/widget-menu-header.component.d.ts +0 -9
  452. package/lib/widget/components/widget-menu-item/widget-menu-item.component.d.ts +0 -23
  453. package/lib/widget/components/widget-row-tile/widget-row-tile.component.d.ts +0 -24
  454. package/lib/widget/models/progress-chart.model.d.ts +0 -9
  455. package/lib/widget/models/widget.model.d.ts +0 -47
  456. package/lib/widget/state/widget.query.d.ts +0 -22
  457. package/lib/widget/state/widget.service.d.ts +0 -20
  458. package/lib/widget/state/widget.store.d.ts +0 -25
  459. package/lib/widget/widget.module.d.ts +0 -27
  460. package/src/assets/icons/confirm-icon.svg +0 -4
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/cat-qw-lib",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "assets": [
8
+ "src/assets"
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,25 +1,16 @@
1
- {
2
- "name": "cat-qw-lib",
3
- "version": "0.64.17",
4
- "peerDependencies": {
5
- "@angular/common": "^19.0.0",
6
- "@angular/core": "^19.0.0"
7
- },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "typings": "index.d.ts",
12
- "main": "bundles/cat-qw-lib.umd.js",
13
- "module": "fesm2022/cat-qw-lib.mjs",
14
- "es2015": "fesm2015/cat-qw-lib.js",
15
- "sideEffects": false,
16
- "exports": {
17
- "./package.json": {
18
- "default": "./package.json"
19
- },
20
- ".": {
21
- "types": "./index.d.ts",
22
- "default": "./fesm2022/cat-qw-lib.mjs"
23
- }
24
- }
25
- }
1
+ {
2
+ "name": "cat-qw-lib",
3
+ "version": "1.0.0",
4
+ "peerDependencies": {
5
+ "@angular/common": "^19.0.0",
6
+ "@angular/core": "^19.0.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "typings": "index.d.ts",
12
+ "main": "bundles/cat-qw-lib.umd.js",
13
+ "module": "fesm2015/cat-qw-lib.js",
14
+ "es2015": "fesm2015/cat-qw-lib.js",
15
+ "sideEffects": false
16
+ }
@@ -0,0 +1,25 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { AdminActionListComponent } from './components/admin-action-list/admin-action-list.component';
4
+ import { CheckBoxComponent, SharedModule, TablePrimaryComponent } from '../../shared';
5
+ import { AdminActionFormComponent } from './components/admin-action-form/admin-action-form.component';
6
+ import { FormsModule } from '@angular/forms';
7
+ import { TextAreaComponent } from '../../shared/controls/text-area/text-area.component';
8
+ import { ButtonModule } from 'primeng/button';
9
+
10
+
11
+
12
+ @NgModule({
13
+ declarations: [AdminActionListComponent, AdminActionFormComponent],
14
+ imports: [
15
+ CommonModule,
16
+ FormsModule,
17
+ SharedModule,
18
+ TablePrimaryComponent,
19
+ TextAreaComponent,
20
+ ButtonModule,
21
+ CheckBoxComponent
22
+ ],
23
+ exports: [AdminActionListComponent, AdminActionFormComponent]
24
+ })
25
+ export class ActionAdminModule { }
@@ -0,0 +1,113 @@
1
+ <form-container
2
+ [record]="record"
3
+ [headerText]="'Actions / Actions Form'"
4
+ [messages]="messages"
5
+ (onSave)="handleSubmit()"
6
+ [showSave]="true"
7
+ (onCancel)="handleCancel()"
8
+ >
9
+ <div class="card p-fluid p-formgrid grid ">
10
+ <h4 class="font-bold col-12 md:col-12">Actions Form</h4>
11
+ <div class="col-12 md:col-5">
12
+ <text-box
13
+ [store]="adminActionStore"
14
+ [record]="record"
15
+ [attributeModel]="{
16
+ readonly: false,
17
+ name: 'name',
18
+ isRequired: true,
19
+ displayText: 'Action Name',
20
+ placeholder: 'Enter Action Name'
21
+ }"
22
+ ></text-box>
23
+ </div>
24
+
25
+ <div class="col-12 md:col-5">
26
+ <dropdown
27
+ [store]="adminActionStore"
28
+ [record]="record"
29
+ [attributeModel]="{
30
+ name: 'apiConfigId',
31
+ readonly: false,
32
+ isRequired: true,
33
+ displayText: 'End Point',
34
+ placeholder: 'Select End Point'
35
+ }"></dropdown>
36
+ </div>
37
+
38
+ <div class="col-2 md:col-2 mt-5">
39
+ <check-box [store]="adminActionStore" [record]="record" [attributeModel]="{
40
+ name:'isActive',
41
+ displayText : 'Active',
42
+ }">
43
+ </check-box>
44
+ </div>
45
+
46
+ <div class="col-12 md:col-6">
47
+ <dropdown
48
+ [store]="adminActionStore"
49
+ [record]="record"
50
+ [attributeModel]="{
51
+ name:'queueId',
52
+ isRequired: true,
53
+ displayText : 'Queue',
54
+ placeholder: 'Select Queue',
55
+ readonly: false
56
+ }"></dropdown>
57
+ </div>
58
+
59
+ <div class="col-12 md:col-6">
60
+ <text-box
61
+ [store]="adminActionStore"
62
+ [record]="record"
63
+ [attributeModel]="{
64
+ readonly: false,
65
+ name: 'apiDocsUrl',
66
+ isRequired: false,
67
+ displayText: 'API Docs URL',
68
+ placeholder: 'Enter API Docs URL'
69
+ }"
70
+ ></text-box>
71
+ </div>
72
+
73
+ <div class="col-12 md:col-12">
74
+ <text-area
75
+ [store]="adminActionStore"
76
+ [record]="record"
77
+ [attributeModel]="{
78
+ readonly: false,
79
+ name: 'prompt',
80
+ isRequired: true,
81
+ displayText: 'Prompt',
82
+ placeholder: 'Enter prompt'
83
+ }"
84
+ ></text-area>
85
+ </div>
86
+
87
+ <div class="w-full flex justify-content-end px-2 mt-2">
88
+ <button
89
+ pButton
90
+ pRipple
91
+ type="button"
92
+ label="Validate"
93
+ class="p-button-raised validate-btn-wrapper"
94
+ (click)="handleValidateAction()"
95
+ ></button>
96
+ </div>
97
+
98
+ <div class="col-12 md:col-12">
99
+ <text-area
100
+ [store]="adminActionStore"
101
+ [record]="record"
102
+ [attributeModel]="{
103
+ readonly: false,
104
+ name: 'formFields',
105
+ isRequired: true,
106
+ displayText: 'Form Configuration',
107
+ placeholder: 'Enter form fields'
108
+ }"
109
+ ></text-area>
110
+ </div>
111
+ </div>
112
+
113
+ </form-container>
@@ -0,0 +1,4 @@
1
+ .validate-btn-wrapper{
2
+ width: 15%;
3
+ padding: 0.8rem 1rem !important;
4
+ }
@@ -0,0 +1,119 @@
1
+ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
2
+ import { AdminActionFormComponent } from './admin-action-form.component';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { AppConfigService, BaseService, ERROR, ROUTES, SHARED, TextBoxComponent } from '../../../../shared';
5
+ import { FormContainerComponent } from '../../../../shared/components/form-container/form-container.component';
6
+ import { DropdownComponent } from '../../../../shared/controls/dropdown/dropdown.component';
7
+ import { HttpClientTestingModule } from '@angular/common/http/testing';
8
+ import { TextAreaComponent } from '../../../../shared/controls/text-area/text-area.component';
9
+ import { AdminActionService } from '../../state/admin-action.service';
10
+ import { MESSAGE } from '../../../../shared/constant/MESSAGES';
11
+ import { of, throwError } from 'rxjs';
12
+ import { AdminActionModel } from '../../models/admin-action.model';
13
+ import { ValidatorService } from '../../../../shared/services/validator.service';
14
+ import { NO_ERRORS_SCHEMA } from '@angular/core';
15
+
16
+ describe('AdminActionFormComponent', () => {
17
+ let component: AdminActionFormComponent;
18
+ let fixture: ComponentFixture<AdminActionFormComponent>;
19
+ let adminActionService: jasmine.SpyObj<AdminActionService>;
20
+ let appConfigService: jasmine.SpyObj<AppConfigService>;
21
+ let activatedRouteMock: any;
22
+ let baseService: jasmine.SpyObj<BaseService<any>>;
23
+ let validatorService: jasmine.SpyObj<any>;
24
+
25
+ beforeEach(async () => {
26
+ const adminActionServiceSpy = jasmine.createSpyObj('AdminActionService', ['handleValidateAction', 'handleSubmit', 'initList']);
27
+ const appConfigServiceSpy = jasmine.createSpyObj('AppConfigService', ['swaggerUrl']);
28
+ const baseServiceSpy = jasmine.createSpyObj('BaseService', ['create', 'update']);
29
+ const validatorServiceSpy = jasmine.createSpyObj('ValidatorService', ['handleValidateRecords']);
30
+ await TestBed.configureTestingModule({
31
+ declarations: [AdminActionFormComponent],
32
+ imports: [HttpClientTestingModule, FormContainerComponent, TextBoxComponent, DropdownComponent, TextAreaComponent],
33
+ providers: [
34
+ { provide: ActivatedRoute, useValue: activatedRouteMock },
35
+ { provide: AdminActionService, useValue: adminActionServiceSpy },
36
+ { provide: AppConfigService, useValue: appConfigServiceSpy },
37
+ { provide: BaseService, useValue: baseServiceSpy },
38
+ { provide: ValidatorService, useValue: validatorServiceSpy }
39
+ ],
40
+ schemas: [NO_ERRORS_SCHEMA]
41
+ }).compileComponents();
42
+
43
+ component = TestBed.createComponent(AdminActionFormComponent).componentInstance;
44
+ adminActionService = TestBed.inject(AdminActionService) as jasmine.SpyObj<AdminActionService>;
45
+ baseService = TestBed.inject(BaseService) as jasmine.SpyObj<BaseService<any>>;
46
+ validatorService = TestBed.inject(ValidatorService) as jasmine.SpyObj<any>;
47
+ appConfigService = TestBed.inject(AppConfigService) as jasmine.SpyObj<AppConfigService>;
48
+ Object.defineProperty(appConfigService, 'swaggerUrl', {
49
+ get: () => 'mock-url',
50
+ configurable: true
51
+ });
52
+ adminActionService.initList.and.returnValue(Promise.resolve());
53
+ fixture = TestBed.createComponent(AdminActionFormComponent);
54
+ component = fixture.componentInstance;
55
+ fixture.detectChanges();
56
+ });
57
+
58
+ it('should create the component', () => {
59
+ expect(component).toBeTruthy();
60
+ });
61
+
62
+ it('should call handleValidateAction and set success message when response is successful', fakeAsync(() => {
63
+ const mockResponse: AdminActionModel[] = [
64
+ {
65
+ name: 'Action 1', apiConfigId: '1', prompt: 'Prompt 1', queueId: 'Q1', formFields: 'Field1', status: 'Enable', isActive: true,
66
+
67
+ apiDocsUrl: 'test'
68
+ },
69
+ {
70
+ name: 'Action 2', apiConfigId: '2', prompt: 'Prompt 2', queueId: 'Q2', formFields: 'Field2', status: 'Disable', isActive: false,
71
+
72
+ apiDocsUrl: 'test'
73
+ }
74
+ ];
75
+ adminActionService.handleValidateAction.and.returnValue(of(mockResponse));
76
+ component.record = { name: 'Action 1', apiConfigId: '123', prompt: 'Prompt 1', queueId: 'Q1',apiDocsUrl:'', formFields: 'Field1', status: 'Enable', isActive: true }
77
+ component.handleValidateAction();
78
+
79
+ expect(adminActionService.handleValidateAction).toHaveBeenCalledOnceWith(
80
+ ROUTES.VALIDATE_ACTIONS, '123', { path: 'mock-url' }
81
+ );
82
+ expect(component.messages).toEqual([
83
+ { severity: SHARED.SUCCESS, detail: MESSAGE.VALIDATE_ACTION_SUCCESS_MESSAGE }
84
+ ]);
85
+
86
+ tick(3000);
87
+ expect(component.messages).toEqual(SHARED.EMPTYARRAY);
88
+ }));
89
+
90
+ it('should call handleValidateAction and set error message when response fails', fakeAsync(() => {
91
+ const errorResponse = { message: 'Error' };
92
+ adminActionService.handleValidateAction.and.returnValue(throwError(() => errorResponse));
93
+ component.record = { apiConfigId: '1', name: 'Action 1', prompt: 'Prompt 1', queueId: 'Q1', formFields: 'Field1', status: 'Enable', isActive: true, apiDocsUrl:'test' };
94
+ component.handleValidateAction();
95
+
96
+ expect(adminActionService.handleValidateAction).toHaveBeenCalledOnceWith(
97
+ ROUTES.VALIDATE_ACTIONS, '1', { path: 'mock-url' }
98
+ );
99
+
100
+ expect(component.messages).toEqual([
101
+ { severity: SHARED.ERROR, detail: ERROR.VALIDATE_ACTION_API_FAILED }
102
+ ]);
103
+
104
+ tick(3000);
105
+ expect(component.messages).toEqual(SHARED.EMPTYARRAY);
106
+ }));
107
+
108
+ it('should stringify formFields and call super.handleSubmit', () => {
109
+ component.record = { _id: null, apiConfigId: '1', name: 'Action 1', formFields: 'testing', status: 'Enable', isActive: true, prompt: 'test', queueId: '123', apiDocsUrl:'test' };
110
+ const mockFormFields = 'testing';
111
+ spyOn(component, 'handleSubmit').and.callThrough();
112
+
113
+ baseService.create.and.returnValue(of({ ...component.record, _id: '123' }));
114
+ component.handleSubmit();
115
+
116
+ expect(component.record.formFields).toEqual(JSON.stringify(mockFormFields));
117
+ expect(component.handleSubmit).toHaveBeenCalled();
118
+ });
119
+ });
@@ -0,0 +1,79 @@
1
+ import { Component, OnDestroy, OnInit } from '@angular/core';
2
+ import { BaseFormComponent } from '../../../../shared/_base/base-form/base-form.component';
3
+ import { AdminActionModel } from '../../models/admin-action.model';
4
+ import { Message } from 'primeng/api';
5
+ import { SHARED } from '../../../../shared/constant/SHARED';
6
+ import { AdminActionService } from '../../state/admin-action.service';
7
+ import { ValidatorService } from '../../../../shared/services/validator.service';
8
+ import { ActivatedRoute, Router } from '@angular/router';
9
+ import { AdminActionStore } from '../../state/admin-action.store';
10
+ import { AppConfigService, BaseQuery, BaseStore, ROUTES } from '../../../../shared';
11
+ import { MESSAGE } from '../../../../shared/constant/MESSAGES';
12
+
13
+ @Component({
14
+ selector: 'lib-admin-action-form',
15
+ standalone : false,
16
+ templateUrl: './admin-action-form.component.html',
17
+ styleUrl: './admin-action-form.component.scss'
18
+ })
19
+ export class AdminActionFormComponent extends BaseFormComponent<AdminActionModel> implements OnInit, OnDestroy{
20
+ messages: Message[] = SHARED.EMPTYARRAY;
21
+ apiConfigList: any[] = [];
22
+ queueList: any[] = [];
23
+
24
+ constructor(public adminActionService: AdminActionService, override validatorService: ValidatorService, override router: Router, override activatedRoute: ActivatedRoute, public adminActionStore: AdminActionStore, private appConfigService: AppConfigService, override baseStore: BaseStore<AdminActionModel>, override baseQuery: BaseQuery<AdminActionModel>) {
25
+ super(adminActionService, validatorService, router, activatedRoute)
26
+ this.record = new AdminActionModel();
27
+ this.record.isActive = true;
28
+ }
29
+
30
+ ngOnInit() {
31
+ this.init();
32
+ this.baseStore.setIsApiValidated(null);
33
+ }
34
+
35
+ handleValidateAction() {
36
+ const payload = {path: this.record.apiDocsUrl};
37
+ this.adminActionService.handleValidateAction(ROUTES.VALIDATE_ACTIONS,this.record.apiConfigId,payload)
38
+ .subscribe({
39
+ next: (res: any) => {
40
+ if (res) {
41
+ if (typeof res !== SHARED.STRING) {
42
+ this.record.formFields = JSON.stringify(res);
43
+ } else {
44
+ this.record.formFields = res;
45
+ }
46
+ this.messages = [{ severity: SHARED.SUCCESS, detail: MESSAGE.VALIDATE_ACTION_SUCCESS_MESSAGE }];
47
+ setTimeout(() => {
48
+ this.messages = SHARED.EMPTYARRAY;
49
+ }, 3000);
50
+ // this.baseStore.setIsApiValidated(SHARED.TRUE);
51
+ }
52
+ },
53
+ error: (error: any) => {
54
+ // this.baseStore.setIsApiValidated(SHARED.FALSE);
55
+ },
56
+ });
57
+ }
58
+
59
+ override handleSubmit(): void {
60
+ if (typeof this.record.formFields !== SHARED.STRING && !this.isValidJSONArray(this.record.formFields)) {
61
+ this.record.formFields = JSON.stringify(this.record.formFields);
62
+ }
63
+ super.handleSubmit();
64
+ }
65
+
66
+ private isValidJSONArray(value: string): boolean {
67
+ try {
68
+ const parsed = JSON.parse(value);
69
+ return Array.isArray(parsed);
70
+ } catch (e) {
71
+ return false;
72
+ }
73
+ }
74
+
75
+ override ngOnDestroy(): void {
76
+ this.record = {} as AdminActionModel;
77
+ super.ngOnDestroy();
78
+ }
79
+ }
@@ -0,0 +1,5 @@
1
+ <div class="dicitonary-list-wrapper">
2
+ @if(table){
3
+ <lib-table-primary [table]="table" [pathName]="pathName" [metaData]="metaData"></lib-table-primary>
4
+ }
5
+ </div>
@@ -0,0 +1,36 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { AdminActionListComponent } from './admin-action-list.component';
3
+ import { HttpClientTestingModule } from '@angular/common/http/testing';
4
+ import { TablePrimaryComponent } from '../../../../shared';
5
+ import { AdminActionService } from '../../state/admin-action.service';
6
+ import { of } from 'rxjs';
7
+
8
+ describe('AdminActionListComponent', () => {
9
+ let component: AdminActionListComponent;
10
+ let fixture: ComponentFixture<AdminActionListComponent>;
11
+ let mockActionAdminService: jasmine.SpyObj<AdminActionService>;
12
+
13
+ beforeEach(async () => {
14
+ const mockData = [{ _id: 1, name: 'Test API' }];
15
+ mockActionAdminService = jasmine.createSpyObj("AdminActionService", ['getAll']);
16
+ mockActionAdminService.getAll.and.returnValue(of(mockData) as any);
17
+ await TestBed.configureTestingModule({
18
+ declarations: [AdminActionListComponent],
19
+ imports:[HttpClientTestingModule, TablePrimaryComponent],
20
+ providers : [{provide : AdminActionService , useValue : mockActionAdminService}]
21
+ }).compileComponents();
22
+
23
+ fixture = TestBed.createComponent(AdminActionListComponent);
24
+ component = fixture.componentInstance;
25
+ fixture.detectChanges();
26
+ });
27
+
28
+ it('should create the component', () => {
29
+ expect(component).toBeTruthy();
30
+ });
31
+
32
+ it('should initialize table with data', () => {
33
+ expect(mockActionAdminService.getAll).toHaveBeenCalled();
34
+ expect(component.table).toBeDefined();
35
+ });
36
+ });
@@ -0,0 +1,33 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { BaseListComponent } from '../../../../shared/_base/base-list/base-list.component';
3
+ import { AdminActionModel } from '../../models/admin-action.model';
4
+ import { TableBuilder } from '../../../../shared/services/table.builder';
5
+ import { AdminActionService } from '../../state/admin-action.service';
6
+ import { actionHiddenHeaderList, actionList, actionTableColumnWidthList } from '../../../../shared/constant/SHARED';
7
+ import { DATASOURCES } from '../../../../shared';
8
+ import { PERMISSION } from '../../../../shared/constant/PERMISSION';
9
+
10
+ /**
11
+ * Admin Action List Component
12
+ */
13
+ @Component({
14
+ selector: 'lib-admin-action-list',
15
+ standalone : false,
16
+ templateUrl: './admin-action-list.component.html',
17
+ styleUrl: './admin-action-list.component.scss'
18
+ })
19
+ export class AdminActionListComponent extends BaseListComponent<AdminActionModel>{
20
+
21
+ pathName:string = DATASOURCES.ACTIONS;
22
+ override editPermission: string = PERMISSION.ACTIONCONFIG_PUT
23
+ override deletePermission: string = PERMISSION.ACTIONCONFIG_DELETE
24
+ constructor(service: AdminActionService, private tableBuilder: TableBuilder){
25
+ super(service, tableBuilder)
26
+ this.tableBuilder.hiddenHeaders = actionHiddenHeaderList;
27
+ }
28
+
29
+ ngOnInit() {
30
+ this.init(actionTableColumnWidthList);
31
+ }
32
+
33
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseModel } from "../../../shared/models/base.model";
2
+
3
+ export class AdminActionModel extends BaseModel {
4
+ name!: string;
5
+ apiConfigId!: string;
6
+ prompt!: string;
7
+ queueId!: string;
8
+ formFields!: string;
9
+ status!: StatusType;
10
+ isActive!: boolean;
11
+ apiDocsUrl!: string;
12
+ }
13
+
14
+ export type StatusType = "Enable" | "Disable";
@@ -0,0 +1,11 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { AdminActionModel } from '../models/admin-action.model';
3
+ import { AdminActionStore } from './admin-action.store';
4
+ import { BaseQuery } from '../../../shared/state/base.query';
5
+
6
+ @Injectable({ providedIn: 'root' })
7
+ export class AdminActionQuery extends BaseQuery<AdminActionModel> {
8
+ constructor(protected override store: AdminActionStore) {
9
+ super(store);
10
+ }
11
+ }
@@ -0,0 +1,66 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
3
+ import { AdminActionService } from './admin-action.service';
4
+ import { AdminActionStore } from './admin-action.store';
5
+ import { AdminActionModel } from '../models/admin-action.model';
6
+ import { AppConfigService } from '../../../shared';
7
+
8
+ describe('AdminActionService', () => {
9
+ let service: AdminActionService;
10
+ let httpMock: HttpTestingController;
11
+ let appConfigService: jasmine.SpyObj<AppConfigService>;
12
+ let actionStoreSpy: jasmine.SpyObj<AdminActionStore>;
13
+
14
+ const mockApiUrl = 'http://mock-api-url.com/';
15
+ const mockAppConfig = {
16
+ baseApi: mockApiUrl,
17
+ visibilityOption: [],
18
+ swaggerUrl: 'https://mock-swagger-url.com/',
19
+ };
20
+ beforeEach(() => {
21
+ const actionStoreSpyObj = jasmine.createSpyObj('ActionStore', ['set']);
22
+ const appConfigSpy = jasmine.createSpyObj('AppConfigService', ['apiBaseUrl', 'swaggerUrl']);
23
+
24
+ TestBed.configureTestingModule({
25
+ imports: [HttpClientTestingModule],
26
+ providers: [
27
+ AdminActionService,
28
+ { provide: AdminActionStore, useValue: actionStoreSpyObj },
29
+ { provide: AppConfigService, useValue: appConfigSpy },
30
+ ],
31
+ });
32
+
33
+ service = TestBed.inject(AdminActionService);
34
+ httpMock = TestBed.inject(HttpTestingController);
35
+ appConfigService = TestBed.inject(AppConfigService) as jasmine.SpyObj<AppConfigService>;
36
+ actionStoreSpy = TestBed.inject(AdminActionStore) as jasmine.SpyObj<AdminActionStore>;
37
+
38
+ Object.defineProperty(appConfigService, 'apiBaseUrl', { get: () => mockAppConfig.baseApi });
39
+ Object.defineProperty(appConfigService, 'swaggerUrl', { get: () => mockAppConfig.swaggerUrl });
40
+ });
41
+
42
+ afterEach(() => {
43
+ httpMock.verify();
44
+ });
45
+
46
+ it('should make a POST request and call actionStore.set with the response data', () => {
47
+ const mockName = 'validate-action';
48
+ const mockId = '123';
49
+ const mockRecord = { key: 'value' };
50
+ const mockResponse: AdminActionModel[] = [
51
+ { name: 'Action 1', apiConfigId: '123', prompt: '', queueId: '', formFields: '', status: 'Enable', isActive: true, apiDocsUrl:"test"},
52
+ { name: 'Action 2', apiConfigId: '124', prompt: '', queueId: '', formFields: '', status: 'Disable', isActive: false, apiDocsUrl : "test" },
53
+ ];
54
+
55
+ service.handleValidateAction(mockName, mockId, mockRecord).subscribe((response) => {
56
+ expect(response).toEqual(mockResponse);
57
+ expect(actionStoreSpy.set).toHaveBeenCalledWith(mockResponse);
58
+ });
59
+
60
+ const req = httpMock.expectOne(`${mockApiUrl}${mockName}/${encodeURIComponent(mockId)}`);
61
+ expect(req.request.method).toBe('POST');
62
+ expect(req.request.body).toEqual(mockRecord);
63
+
64
+ req.flush(mockResponse);
65
+ });
66
+ });
@@ -0,0 +1,29 @@
1
+
2
+ import { Injectable } from '@angular/core';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import { AdminActionModel } from '../models/admin-action.model';
5
+ import { AdminActionStore } from './admin-action.store';
6
+ import { DATASOURCES } from '../../../shared/constant/DATASOURCES';
7
+ import { BaseService } from '../../../shared/state/base.service';
8
+ import { AppConfigService } from '../../../shared/services/app-config.service';
9
+ import { ListService } from '../../../shared/services/list.service';
10
+ import { LISTCONFIG } from '../../../shared/constant/LIST-CONFIG';
11
+ import { Observable, tap } from 'rxjs';
12
+
13
+ @Injectable({ providedIn: 'root' })
14
+ export class AdminActionService extends BaseService<AdminActionModel> {
15
+
16
+ protected override list : any= [...LISTCONFIG.QUEUEAPICONFIG, ...LISTCONFIG.ACTIONQUEUECONFIG];
17
+
18
+ constructor(protected actionStore: AdminActionStore, http: HttpClient, appConfigService : AppConfigService, listService:ListService) {
19
+ super(http, actionStore, appConfigService,listService);
20
+ this._pathName = DATASOURCES.ACTIONS;
21
+ }
22
+
23
+ handleValidateAction(name:string, id: string, record:any): Observable<AdminActionModel[]> {
24
+ const apiUrl = `${this.apiUrl}${name}/${encodeURIComponent(id)}`;
25
+ return this.http.post<AdminActionModel[]>(`${apiUrl}`, record).pipe(
26
+ tap((entities: AdminActionModel[]) => this.actionStore.set(entities))
27
+ );
28
+ }
29
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseState } from "../../../shared/state/base.state";
2
+ import { AdminActionModel } from "../models/admin-action.model";
3
+
4
+ export interface AdminActionState extends BaseState {
5
+ actions: AdminActionModel[];
6
+ }
7
+
8
+ export function createInitialState(): AdminActionState {
9
+ return {
10
+ actions: [],
11
+ records: [],
12
+ lists: []
13
+ };
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { StoreConfig } from '@datorama/akita';
3
+ import { BaseStore } from '../../../shared/state/base.store';
4
+ import { AdminActionModel } from '../models/admin-action.model';
5
+
6
+ @Injectable({ providedIn: 'root' })
7
+ @StoreConfig({ name: 'action' })
8
+ export class AdminActionStore extends BaseStore<AdminActionModel> {
9
+
10
+ constructor() {
11
+ super();
12
+ }
13
+
14
+ }
@@ -0,0 +1,22 @@
1
+ import { APP_INITIALIZER, NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { AppConfigService } from '../shared';
4
+
5
+
6
+
7
+ @NgModule({
8
+ declarations: [],
9
+ imports: [
10
+ CommonModule
11
+ ],
12
+ providers: [
13
+ {
14
+ provide: APP_INITIALIZER,
15
+ useFactory: (configService: AppConfigService) => () =>
16
+ configService.loadAppConfig(),
17
+ deps: [AppConfigService],
18
+ multi: true,
19
+ },
20
+ ],
21
+ })
22
+ export class AdminModule { }