vc-create-dashboard 3.0.67 → 3.0.69

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 (372) hide show
  1. package/esm2022/lib/configurations.mjs +7 -0
  2. package/esm2022/lib/create-dashboard-container/categories/categories-config.mjs +2 -0
  3. package/esm2022/lib/create-dashboard-container/categories/categories.component.mjs +212 -0
  4. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.mjs +551 -0
  5. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.mjs +2 -0
  6. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets.module.mjs +47 -0
  7. package/esm2022/lib/create-dashboard-container/constants/assets.constant.mjs +36 -0
  8. package/esm2022/lib/create-dashboard-container/create-dashboard-config.mjs +2 -0
  9. package/esm2022/lib/create-dashboard-container/create-dashboard.component.mjs +1128 -0
  10. package/esm2022/lib/create-dashboard-container/create-dashboard.module.mjs +123 -0
  11. package/esm2022/lib/create-dashboard-container/directives/directives.module.mjs +24 -0
  12. package/esm2022/lib/create-dashboard-container/directives/scroll-in-view.directive.mjs +36 -0
  13. package/esm2022/lib/create-dashboard-container/form-group/form-group.component.mjs +153 -0
  14. package/esm2022/lib/create-dashboard-container/frequency/frequency.component.mjs +309 -0
  15. package/esm2022/lib/create-dashboard-container/interfaces/widget-data-model.mjs +2 -0
  16. package/esm2022/lib/create-dashboard-container/pipes/filter.pipe.mjs +30 -0
  17. package/esm2022/lib/create-dashboard-container/pipes/search.pipe.mjs +25 -0
  18. package/esm2022/lib/create-dashboard-container/pipes/text-count.pipe.mjs +19 -0
  19. package/esm2022/lib/create-dashboard-container/responsibility-center/responsibility-center.component.mjs +149 -0
  20. package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories-config.mjs +2 -0
  21. package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories.component.mjs +206 -0
  22. package/esm2022/lib/create-dashboard-container/services/auth.service.mjs +31 -0
  23. package/esm2022/lib/create-dashboard-container/services/configure-widgets.service.mjs +230 -0
  24. package/esm2022/lib/create-dashboard-container/services/create-dashboard.service.mjs +160 -0
  25. package/esm2022/lib/create-dashboard-container/services/pagination.service.mjs +28 -0
  26. package/esm2022/lib/create-dashboard-container/services/urlConfig.service.mjs +29 -0
  27. package/esm2022/lib/create-dashboard-container/user-list/user-list.component.mjs +440 -0
  28. package/esm2022/lib/create-dashboard-container/user-list/user-list.config.mjs +2 -0
  29. package/esm2022/lib/create-dashboard.service.mjs +14 -0
  30. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.mjs +52 -0
  31. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer-config.mjs +2 -0
  32. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer.module.mjs +32 -0
  33. package/esm2022/lib/ui-kit/dialog/dialog-config.mjs +7 -0
  34. package/esm2022/lib/ui-kit/dialog/dialog-injector.mjs +17 -0
  35. package/esm2022/lib/ui-kit/dialog/dialog-ref.mjs +11 -0
  36. package/esm2022/lib/ui-kit/dialog/dialog.component.mjs +99 -0
  37. package/esm2022/lib/ui-kit/dialog/dialog.module.mjs +20 -0
  38. package/esm2022/lib/ui-kit/dialog/dialog.service.mjs +56 -0
  39. package/esm2022/lib/ui-kit/dialog/insertion.directive.mjs +17 -0
  40. package/esm2022/lib/ui-kit/floating-bar/floating-bar.component.mjs +57 -0
  41. package/esm2022/lib/ui-kit/floating-bar/floating-bar.module.mjs +32 -0
  42. package/esm2022/lib/ui-kit/formgroup/click-outside.directive.mjs +30 -0
  43. package/esm2022/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.mjs +29 -0
  44. package/esm2022/lib/ui-kit/formgroup/cs-radio/cs-radio.component.mjs +34 -0
  45. package/esm2022/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.mjs +14 -0
  46. package/esm2022/lib/ui-kit/formgroup/cs-select/cs-select.component.mjs +119 -0
  47. package/esm2022/lib/ui-kit/formgroup/cs-switch/cs-switch.component.mjs +39 -0
  48. package/esm2022/lib/ui-kit/formgroup/formgroup.module.mjs +55 -0
  49. package/esm2022/lib/ui-kit/formgroup/pipes/pascal.pipe.mjs +19 -0
  50. package/esm2022/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.mjs +24 -0
  51. package/esm2022/lib/ui-kit/no-data/no-data.component.mjs +47 -0
  52. package/esm2022/lib/ui-kit/no-data/no-data.module.mjs +18 -0
  53. package/esm2022/lib/ui-kit/pagination/pagination.component.mjs +130 -0
  54. package/esm2022/lib/ui-kit/pagination/pagination.module.mjs +18 -0
  55. package/esm2022/lib/ui-kit/popover/popover.component.mjs +142 -0
  56. package/esm2022/lib/ui-kit/popover/popover.directive.mjs +93 -0
  57. package/esm2022/lib/ui-kit/popover/popover.module.mjs +21 -0
  58. package/esm2022/lib/ui-kit/popover/popover.service.mjs +23 -0
  59. package/esm2022/lib/ui-kit/select/cs-option/cs-option.component.mjs +41 -0
  60. package/esm2022/lib/ui-kit/select/cs-select/cs-select.component.mjs +107 -0
  61. package/esm2022/lib/ui-kit/select/safe-html.pipe.mjs +21 -0
  62. package/esm2022/lib/ui-kit/select/select.module.mjs +21 -0
  63. package/esm2022/lib/ui-kit/services/cs-select.service.mjs +16 -0
  64. package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.component.mjs +52 -0
  65. package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.module.mjs +18 -0
  66. package/esm2022/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.mjs +46 -0
  67. package/esm2022/lib/ui-kit/snack-bar/snack-bar.module.mjs +18 -0
  68. package/esm2022/lib/ui-kit/snack-bar/snack-bar.service.mjs +23 -0
  69. package/esm2022/lib/ui-kit/tooltip/tooltip.directive.mjs +168 -0
  70. package/esm2022/lib/ui-kit/tooltip/tooltip.module.mjs +18 -0
  71. package/esm2022/lib/ui-kit/v-loader/loader/loader.component.mjs +24 -0
  72. package/esm2022/lib/ui-kit/v-loader/loader-inline/loader-inline.component.mjs +24 -0
  73. package/esm2022/lib/ui-kit/v-loader/v-loader.module.mjs +19 -0
  74. package/esm2022/public-api.mjs +10 -0
  75. package/esm2022/vc-create-dashboard.mjs +5 -0
  76. package/fesm2022/vc-create-dashboard.mjs +5503 -0
  77. package/fesm2022/vc-create-dashboard.mjs.map +1 -0
  78. package/index.d.ts +5 -0
  79. package/lib/configurations.d.ts +4 -0
  80. package/lib/create-dashboard-container/categories/categories-config.d.ts +18 -0
  81. package/lib/create-dashboard-container/categories/categories.component.d.ts +65 -0
  82. package/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.d.ts +122 -0
  83. package/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.d.ts +9 -0
  84. package/lib/create-dashboard-container/configure-widgets/configure-widgets.module.d.ts +14 -0
  85. package/lib/create-dashboard-container/constants/assets.constant.d.ts +34 -0
  86. package/lib/create-dashboard-container/create-dashboard-config.d.ts +18 -0
  87. package/lib/create-dashboard-container/create-dashboard.component.d.ts +179 -0
  88. package/lib/create-dashboard-container/create-dashboard.module.d.ts +36 -0
  89. package/lib/create-dashboard-container/directives/directives.module.d.ts +8 -0
  90. package/lib/create-dashboard-container/directives/scroll-in-view.directive.d.ts +12 -0
  91. package/lib/create-dashboard-container/form-group/form-group.component.d.ts +48 -0
  92. package/lib/create-dashboard-container/frequency/frequency.component.d.ts +39 -0
  93. package/{src/lib/create-dashboard-container/interfaces/widget-data-model.ts → lib/create-dashboard-container/interfaces/widget-data-model.d.ts} +1 -1
  94. package/lib/create-dashboard-container/pipes/filter.pipe.d.ts +7 -0
  95. package/lib/create-dashboard-container/pipes/search.pipe.d.ts +7 -0
  96. package/lib/create-dashboard-container/pipes/text-count.pipe.d.ts +7 -0
  97. package/lib/create-dashboard-container/responsibility-center/responsibility-center.component.d.ts +61 -0
  98. package/lib/create-dashboard-container/risk-categories/risk-categories-config.d.ts +18 -0
  99. package/lib/create-dashboard-container/risk-categories/risk-categories.component.d.ts +65 -0
  100. package/lib/create-dashboard-container/services/auth.service.d.ts +11 -0
  101. package/lib/create-dashboard-container/services/configure-widgets.service.d.ts +38 -0
  102. package/lib/create-dashboard-container/services/create-dashboard.service.d.ts +45 -0
  103. package/lib/create-dashboard-container/services/pagination.service.d.ts +12 -0
  104. package/lib/create-dashboard-container/services/urlConfig.service.d.ts +10 -0
  105. package/lib/create-dashboard-container/user-list/user-list.component.d.ts +122 -0
  106. package/{src/lib/create-dashboard-container/user-list/user-list.config.ts → lib/create-dashboard-container/user-list/user-list.config.d.ts} +6 -6
  107. package/lib/create-dashboard.service.d.ts +6 -0
  108. package/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.d.ts +17 -0
  109. package/lib/ui-kit/dashboard-footer/dashboard-footer-config.d.ts +11 -0
  110. package/lib/ui-kit/dashboard-footer/dashboard-footer.module.d.ts +10 -0
  111. package/lib/ui-kit/dialog/dialog-config.d.ts +6 -0
  112. package/lib/ui-kit/dialog/dialog-injector.d.ts +7 -0
  113. package/lib/ui-kit/dialog/dialog-ref.d.ts +7 -0
  114. package/lib/ui-kit/dialog/dialog.component.d.ts +33 -0
  115. package/lib/ui-kit/dialog/dialog.module.d.ts +9 -0
  116. package/lib/ui-kit/dialog/dialog.service.d.ts +17 -0
  117. package/lib/ui-kit/dialog/insertion.directive.d.ts +8 -0
  118. package/lib/ui-kit/floating-bar/floating-bar.component.d.ts +20 -0
  119. package/lib/ui-kit/floating-bar/floating-bar.module.d.ts +10 -0
  120. package/lib/ui-kit/formgroup/click-outside.directive.d.ts +10 -0
  121. package/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.d.ts +13 -0
  122. package/lib/ui-kit/formgroup/cs-radio/cs-radio.component.d.ts +15 -0
  123. package/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.d.ts +8 -0
  124. package/lib/ui-kit/formgroup/cs-select/cs-select.component.d.ts +36 -0
  125. package/lib/ui-kit/formgroup/cs-switch/cs-switch.component.d.ts +15 -0
  126. package/lib/ui-kit/formgroup/formgroup.module.d.ts +17 -0
  127. package/lib/ui-kit/formgroup/pipes/pascal.pipe.d.ts +7 -0
  128. package/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.d.ts +7 -0
  129. package/lib/ui-kit/no-data/no-data.component.d.ts +19 -0
  130. package/lib/ui-kit/no-data/no-data.module.d.ts +8 -0
  131. package/lib/ui-kit/pagination/pagination.component.d.ts +21 -0
  132. package/lib/ui-kit/pagination/pagination.module.d.ts +8 -0
  133. package/lib/ui-kit/popover/popover.component.d.ts +28 -0
  134. package/lib/ui-kit/popover/popover.directive.d.ts +17 -0
  135. package/lib/ui-kit/popover/popover.module.d.ts +9 -0
  136. package/lib/ui-kit/popover/popover.service.d.ts +13 -0
  137. package/lib/ui-kit/select/cs-option/cs-option.component.d.ts +16 -0
  138. package/lib/ui-kit/select/cs-select/cs-select.component.d.ts +32 -0
  139. package/lib/ui-kit/select/safe-html.pipe.d.ts +10 -0
  140. package/lib/ui-kit/select/select.module.d.ts +11 -0
  141. package/lib/ui-kit/services/cs-select.service.d.ts +7 -0
  142. package/lib/ui-kit/smiley-dialog/smiley-dialog.component.d.ts +17 -0
  143. package/lib/ui-kit/smiley-dialog/smiley-dialog.module.d.ts +8 -0
  144. package/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.d.ts +17 -0
  145. package/lib/ui-kit/snack-bar/snack-bar.module.d.ts +8 -0
  146. package/lib/ui-kit/snack-bar/snack-bar.service.d.ts +9 -0
  147. package/lib/ui-kit/tooltip/tooltip.directive.d.ts +28 -0
  148. package/lib/ui-kit/tooltip/tooltip.module.d.ts +8 -0
  149. package/lib/ui-kit/v-loader/loader/loader.component.d.ts +11 -0
  150. package/lib/ui-kit/v-loader/loader-inline/loader-inline.component.d.ts +11 -0
  151. package/lib/ui-kit/v-loader/v-loader.module.d.ts +9 -0
  152. package/package.json +17 -3
  153. package/public-api.d.ts +3 -0
  154. package/karma.conf.js +0 -44
  155. package/ng-package.json +0 -7
  156. package/src/lib/categoryList.ts +0 -23
  157. package/src/lib/configurations.ts +0 -8
  158. package/src/lib/create-dashboard-container/categories/categories-config.ts +0 -18
  159. package/src/lib/create-dashboard-container/categories/categories.component.html +0 -150
  160. package/src/lib/create-dashboard-container/categories/categories.component.less +0 -252
  161. package/src/lib/create-dashboard-container/categories/categories.component.spec.ts +0 -43
  162. package/src/lib/create-dashboard-container/categories/categories.component.ts +0 -220
  163. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.html +0 -141
  164. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.less +0 -381
  165. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.spec.ts +0 -48
  166. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.ts +0 -589
  167. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.ts +0 -9
  168. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets.module.ts +0 -30
  169. package/src/lib/create-dashboard-container/constants/assets.constant.ts +0 -36
  170. package/src/lib/create-dashboard-container/create-dashboard-config.ts +0 -24
  171. package/src/lib/create-dashboard-container/create-dashboard-mockData.ts +0 -341
  172. package/src/lib/create-dashboard-container/create-dashboard.component.html +0 -1276
  173. package/src/lib/create-dashboard-container/create-dashboard.component.less +0 -1453
  174. package/src/lib/create-dashboard-container/create-dashboard.component.ts +0 -1333
  175. package/src/lib/create-dashboard-container/create-dashboard.module.ts +0 -75
  176. package/src/lib/create-dashboard-container/directives/directives.module.ts +0 -18
  177. package/src/lib/create-dashboard-container/directives/scroll-in-view.directive.ts +0 -28
  178. package/src/lib/create-dashboard-container/form-group/form-group.component.html +0 -288
  179. package/src/lib/create-dashboard-container/form-group/form-group.component.less +0 -450
  180. package/src/lib/create-dashboard-container/form-group/form-group.component.spec.ts +0 -90
  181. package/src/lib/create-dashboard-container/form-group/form-group.component.ts +0 -163
  182. package/src/lib/create-dashboard-container/frequency/frequency.component.html +0 -61
  183. package/src/lib/create-dashboard-container/frequency/frequency.component.less +0 -183
  184. package/src/lib/create-dashboard-container/frequency/frequency.component.spec.ts +0 -120
  185. package/src/lib/create-dashboard-container/frequency/frequency.component.ts +0 -303
  186. package/src/lib/create-dashboard-container/pipes/filter.pipe.ts +0 -25
  187. package/src/lib/create-dashboard-container/pipes/search.pipe.ts +0 -23
  188. package/src/lib/create-dashboard-container/pipes/text-count.pipe.spec.ts +0 -8
  189. package/src/lib/create-dashboard-container/pipes/text-count.pipe.ts +0 -15
  190. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.html +0 -70
  191. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.less +0 -181
  192. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.spec.ts +0 -41
  193. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.ts +0 -154
  194. package/src/lib/create-dashboard-container/risk-categories/risk-categories-config.ts +0 -18
  195. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.html +0 -152
  196. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.less +0 -230
  197. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.spec.ts +0 -39
  198. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.ts +0 -209
  199. package/src/lib/create-dashboard-container/services/auth.service.ts +0 -27
  200. package/src/lib/create-dashboard-container/services/configure-widgets.service.spec.ts +0 -19
  201. package/src/lib/create-dashboard-container/services/configure-widgets.service.ts +0 -245
  202. package/src/lib/create-dashboard-container/services/create-dashboard.service.spec.ts +0 -19
  203. package/src/lib/create-dashboard-container/services/create-dashboard.service.ts +0 -220
  204. package/src/lib/create-dashboard-container/services/pagination.service.spec.ts +0 -16
  205. package/src/lib/create-dashboard-container/services/pagination.service.ts +0 -25
  206. package/src/lib/create-dashboard-container/services/urlConfig.service.ts +0 -21
  207. package/src/lib/create-dashboard-container/user-list/user-list.component.html +0 -358
  208. package/src/lib/create-dashboard-container/user-list/user-list.component.less +0 -451
  209. package/src/lib/create-dashboard-container/user-list/user-list.component.spec.ts +0 -153
  210. package/src/lib/create-dashboard-container/user-list/user-list.component.ts +0 -472
  211. package/src/lib/create-dashboard.service.ts +0 -8
  212. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.html +0 -22
  213. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.less +0 -218
  214. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.ts +0 -30
  215. package/src/lib/ui-kit/action-dialog/action-dialog.module.ts +0 -53
  216. package/src/lib/ui-kit/action-dialog/active/active.component.html +0 -1
  217. package/src/lib/ui-kit/action-dialog/active/active.component.less +0 -0
  218. package/src/lib/ui-kit/action-dialog/active/active.component.ts +0 -12
  219. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.html +0 -18
  220. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.less +0 -98
  221. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.ts +0 -18
  222. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.html +0 -20
  223. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.less +0 -325
  224. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.ts +0 -26
  225. package/src/lib/ui-kit/action-dialog/delete/delete.component.html +0 -24
  226. package/src/lib/ui-kit/action-dialog/delete/delete.component.less +0 -240
  227. package/src/lib/ui-kit/action-dialog/delete/delete.component.ts +0 -22
  228. package/src/lib/ui-kit/action-dialog/error/error.component.html +0 -20
  229. package/src/lib/ui-kit/action-dialog/error/error.component.less +0 -103
  230. package/src/lib/ui-kit/action-dialog/error/error.component.ts +0 -18
  231. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.html +0 -23
  232. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.less +0 -167
  233. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.ts +0 -12
  234. package/src/lib/ui-kit/action-dialog/link/link.component.html +0 -57
  235. package/src/lib/ui-kit/action-dialog/link/link.component.less +0 -222
  236. package/src/lib/ui-kit/action-dialog/link/link.component.ts +0 -18
  237. package/src/lib/ui-kit/action-dialog/move/move.component.html +0 -43
  238. package/src/lib/ui-kit/action-dialog/move/move.component.less +0 -157
  239. package/src/lib/ui-kit/action-dialog/move/move.component.ts +0 -25
  240. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.html +0 -19
  241. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.less +0 -97
  242. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.ts +0 -18
  243. package/src/lib/ui-kit/action-dialog/upload/upload.component.html +0 -19
  244. package/src/lib/ui-kit/action-dialog/upload/upload.component.less +0 -97
  245. package/src/lib/ui-kit/action-dialog/upload/upload.component.ts +0 -12
  246. package/src/lib/ui-kit/chart/bar/bar.component.html +0 -28
  247. package/src/lib/ui-kit/chart/bar/bar.component.less +0 -13
  248. package/src/lib/ui-kit/chart/bar/bar.component.ts +0 -44
  249. package/src/lib/ui-kit/chart/chart.module.ts +0 -12
  250. package/src/lib/ui-kit/chart/pipes/segmenter.pipe.ts +0 -28
  251. package/src/lib/ui-kit/chart/pipes/x-calculator.pipe.ts +0 -22
  252. package/src/lib/ui-kit/circle-progresss/circle/circle.component.html +0 -37
  253. package/src/lib/ui-kit/circle-progresss/circle/circle.component.less +0 -1448
  254. package/src/lib/ui-kit/circle-progresss/circle/circle.component.ts +0 -19
  255. package/src/lib/ui-kit/circle-progresss/circle-progresss.module.ts +0 -10
  256. package/src/lib/ui-kit/click-outside/click-outside.directive.ts +0 -16
  257. package/src/lib/ui-kit/click-outside/click-outside.module.ts +0 -16
  258. package/src/lib/ui-kit/color-palette/color-palette.component.html +0 -110
  259. package/src/lib/ui-kit/color-palette/color-palette.component.less +0 -54
  260. package/src/lib/ui-kit/color-palette/color-palette.component.ts +0 -28
  261. package/src/lib/ui-kit/color-palette/color-palette.module.ts +0 -10
  262. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.html +0 -37
  263. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.less +0 -335
  264. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.spec.ts +0 -25
  265. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.ts +0 -44
  266. package/src/lib/ui-kit/dashboard-footer/dashboard-footer-config.ts +0 -11
  267. package/src/lib/ui-kit/dashboard-footer/dashboard-footer.module.ts +0 -22
  268. package/src/lib/ui-kit/dialog/dialog-config.ts +0 -6
  269. package/src/lib/ui-kit/dialog/dialog-injector.ts +0 -18
  270. package/src/lib/ui-kit/dialog/dialog-ref.ts +0 -12
  271. package/src/lib/ui-kit/dialog/dialog.component.css +0 -89
  272. package/src/lib/ui-kit/dialog/dialog.component.html +0 -27
  273. package/src/lib/ui-kit/dialog/dialog.component.ts +0 -114
  274. package/src/lib/ui-kit/dialog/dialog.module.ts +0 -11
  275. package/src/lib/ui-kit/dialog/dialog.service.ts +0 -57
  276. package/src/lib/ui-kit/dialog/insertion.directive.ts +0 -8
  277. package/src/lib/ui-kit/floating-bar/floating-bar.component.html +0 -42
  278. package/src/lib/ui-kit/floating-bar/floating-bar.component.less +0 -355
  279. package/src/lib/ui-kit/floating-bar/floating-bar.component.spec.ts +0 -25
  280. package/src/lib/ui-kit/floating-bar/floating-bar.component.ts +0 -40
  281. package/src/lib/ui-kit/floating-bar/floating-bar.module.ts +0 -22
  282. package/src/lib/ui-kit/formgroup/click-outside.directive.ts +0 -16
  283. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.html +0 -11
  284. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.less +0 -102
  285. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.ts +0 -19
  286. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.html +0 -11
  287. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.less +0 -125
  288. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.ts +0 -21
  289. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.html +0 -4
  290. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.less +0 -0
  291. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.ts +0 -12
  292. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.html +0 -78
  293. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.less +0 -259
  294. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.ts +0 -92
  295. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.html +0 -30
  296. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.less +0 -103
  297. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.ts +0 -23
  298. package/src/lib/ui-kit/formgroup/formgroup.module.ts +0 -35
  299. package/src/lib/ui-kit/formgroup/pipes/pascal.pipe.ts +0 -13
  300. package/src/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.ts +0 -18
  301. package/src/lib/ui-kit/line-loader/line-loader.component.html +0 -3
  302. package/src/lib/ui-kit/line-loader/line-loader.component.less +0 -34
  303. package/src/lib/ui-kit/line-loader/line-loader.component.ts +0 -14
  304. package/src/lib/ui-kit/line-loader/line-loader.module.ts +0 -10
  305. package/src/lib/ui-kit/longpress/longpress.directive.ts +0 -28
  306. package/src/lib/ui-kit/longpress/longpress.module.ts +0 -10
  307. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.html +0 -51
  308. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.less +0 -367
  309. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.spec.ts +0 -24
  310. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.ts +0 -141
  311. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.html +0 -9
  312. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.less +0 -105
  313. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.spec.ts +0 -27
  314. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.ts +0 -24
  315. package/src/lib/ui-kit/multi-select/multi-select.module.ts +0 -24
  316. package/src/lib/ui-kit/multi-select/multi-select.service.ts +0 -10
  317. package/src/lib/ui-kit/no-data/no-data.component.html +0 -14
  318. package/src/lib/ui-kit/no-data/no-data.component.less +0 -86
  319. package/src/lib/ui-kit/no-data/no-data.component.ts +0 -26
  320. package/src/lib/ui-kit/no-data/no-data.module.ts +0 -10
  321. package/src/lib/ui-kit/pagination/pagination.component.html +0 -11
  322. package/src/lib/ui-kit/pagination/pagination.component.less +0 -72
  323. package/src/lib/ui-kit/pagination/pagination.component.spec.ts +0 -25
  324. package/src/lib/ui-kit/pagination/pagination.component.ts +0 -138
  325. package/src/lib/ui-kit/pagination/pagination.module.ts +0 -10
  326. package/src/lib/ui-kit/pipes/pipes.module.ts +0 -10
  327. package/src/lib/ui-kit/pipes/safeHTML.pipe.ts +0 -12
  328. package/src/lib/ui-kit/pipes/trim.pipe.ts +0 -10
  329. package/src/lib/ui-kit/popover/popover.component.html +0 -6
  330. package/src/lib/ui-kit/popover/popover.component.less +0 -20
  331. package/src/lib/ui-kit/popover/popover.component.ts +0 -124
  332. package/src/lib/ui-kit/popover/popover.directive.ts +0 -72
  333. package/src/lib/ui-kit/popover/popover.module.ts +0 -13
  334. package/src/lib/ui-kit/popover/popover.service.ts +0 -17
  335. package/src/lib/ui-kit/ripple/ripple.directive.ts +0 -33
  336. package/src/lib/ui-kit/ripple/ripple.module.ts +0 -10
  337. package/src/lib/ui-kit/select/cs-option/cs-option.component.html +0 -8
  338. package/src/lib/ui-kit/select/cs-option/cs-option.component.less +0 -49
  339. package/src/lib/ui-kit/select/cs-option/cs-option.component.ts +0 -31
  340. package/src/lib/ui-kit/select/cs-select/cs-select.component.html +0 -16
  341. package/src/lib/ui-kit/select/cs-select/cs-select.component.less +0 -142
  342. package/src/lib/ui-kit/select/cs-select/cs-select.component.ts +0 -98
  343. package/src/lib/ui-kit/select/safe-html.pipe.ts +0 -13
  344. package/src/lib/ui-kit/select/select.module.ts +0 -13
  345. package/src/lib/ui-kit/services/cs-select.service.ts +0 -10
  346. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.html +0 -30
  347. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.less +0 -442
  348. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.ts +0 -40
  349. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.module.ts +0 -11
  350. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.html +0 -10
  351. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.less +0 -110
  352. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.ts +0 -42
  353. package/src/lib/ui-kit/snack-bar/snack-bar.module.ts +0 -10
  354. package/src/lib/ui-kit/snack-bar/snack-bar.service.ts +0 -18
  355. package/src/lib/ui-kit/time-filter/time-filter.component.html +0 -126
  356. package/src/lib/ui-kit/time-filter/time-filter.component.less +0 -482
  357. package/src/lib/ui-kit/time-filter/time-filter.component.ts +0 -284
  358. package/src/lib/ui-kit/time-filter/time-filter.module.ts +0 -10
  359. package/src/lib/ui-kit/tooltip/tooltip.directive.ts +0 -150
  360. package/src/lib/ui-kit/tooltip/tooltip.module.ts +0 -10
  361. package/src/lib/ui-kit/v-loader/loader/loader.component.html +0 -6
  362. package/src/lib/ui-kit/v-loader/loader/loader.component.less +0 -52
  363. package/src/lib/ui-kit/v-loader/loader/loader.component.ts +0 -22
  364. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.html +0 -6
  365. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.less +0 -52
  366. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.ts +0 -22
  367. package/src/lib/ui-kit/v-loader/v-loader.module.ts +0 -11
  368. package/src/public-api.ts +0 -11
  369. package/src/test.ts +0 -28
  370. package/tsconfig.lib.json +0 -20
  371. package/tsconfig.lib.prod.json +0 -10
  372. package/tsconfig.spec.json +0 -17
@@ -1,1333 +0,0 @@
1
- import {
2
- ChangeDetectorRef,
3
- Component,
4
- ElementRef,
5
- EventEmitter,
6
- HostListener,
7
- Input,
8
- OnChanges,
9
- OnInit,
10
- Output,
11
- ViewChild,
12
- } from '@angular/core';
13
- import { EditorConfig } from '@vcomply/editor';
14
- import { DatePickerComponent, IDatePickerConfig } from 'ng2-date-picker';
15
- import { CreateDashboardService } from './services/create-dashboard.service';
16
- import { PaginationService } from './services/pagination.service';
17
- import { UserListConfiguration } from './user-list/user-list.config';
18
- import { CreateDashboardForm } from './create-dashboard-config';
19
- import { SnackBarService } from '../ui-kit/snack-bar/snack-bar.service';
20
- import { ConfigureWidgetsService } from './services/configure-widgets.service';
21
-
22
- import dayjs from 'dayjs';
23
- import { PopoverService } from '../ui-kit/popover/popover.service';
24
- import { TextCountPipe } from './pipes/text-count.pipe';
25
- import { ASSETS } from './constants/assets.constant';
26
-
27
- @Component({
28
- selector: 'app-create-dashboard',
29
- templateUrl: './create-dashboard.component.html',
30
- styleUrls: ['./create-dashboard.component.less'],
31
- providers: [TextCountPipe],
32
- })
33
- export class CreateDashboardComponent implements OnInit, OnChanges {
34
- @Input() feature: any;
35
- activeSelector = '';
36
- disabled = false;
37
- @Input() mode = 'CREATE';
38
- @Input() dashboardId = '';
39
- @Output() close = new EventEmitter();
40
- @Input() createdBy = 0;
41
- @ViewChild('fromDatePicker') fromDatePicker!: DatePickerComponent;
42
- @ViewChild('toDatePicker') toDatePicker!: DatePickerComponent;
43
- animation = true;
44
- @Input() configureWidget = false;
45
- ASSETS: any = ASSETS;
46
-
47
- totalPages = 1;
48
- totalList = 1;
49
- usersList: any[] = [];
50
- vLoader = true;
51
- userListLoaded = false;
52
- rcListLoaded = false;
53
- complianceCategoriesListLoaded = false;
54
- riskCategoryListLoaded = false;
55
- hideToDate = false;
56
- listDetails: UserListConfiguration = {
57
- selectedUsersList: [],
58
- selectedGroupList: [],
59
- nonRemovableUsersList: [],
60
- displayElementKey: 'member_name',
61
- displayGroupKey: 'group_name',
62
- groupIdkey: 'group_id',
63
- elementIdKey: 'member_id',
64
- tooltipKey: 'member_email',
65
- };
66
- dashboardDescription: EditorConfig = {
67
- placeholder: 'Description (Max limit: 250 characters)',
68
- mode: 'prime',
69
- id: 'description',
70
- };
71
- responsibilityCategoriesTree: any = {
72
- regulations: {
73
- list: [],
74
- selectedList: [],
75
- },
76
- standards: {
77
- list: [],
78
- selectedList: [],
79
- },
80
- internalControls: {
81
- list: [],
82
- selectedList: [],
83
- },
84
- others: {
85
- list: [],
86
- selectedList: [],
87
- },
88
- };
89
- allComplianceCategories: any[] = [];
90
- allRiskCategories: any[] = [];
91
- showRiskCategory = false;
92
- showCriteria = true;
93
-
94
- dashboardForm: CreateDashboardForm = {
95
- dashboardName: '',
96
- dashboardDescriptionText: '',
97
- selectedViewers: [],
98
- selectedGroup: [],
99
- selectedFromDate: undefined,
100
- selectedToDate: undefined,
101
- selectedResponsibilityCenters: [],
102
- selectedResponsibilityCategories: [],
103
- selectedRiskCategories: [],
104
- displayCriteria: 'or',
105
- configureWidget: [],
106
- frequencyDetails: '',
107
- selectedFrequencyType: '',
108
- selectedFrequencies: [0],
109
- frequencyMessage: '',
110
- frequencyDate: 1,
111
- };
112
-
113
- openConfigureWidgets = false;
114
- selectedWidgets: any = [];
115
- displayedWidgets: any = [];
116
-
117
- responsibilityCentersList = [];
118
- datePickerOverlay = false;
119
- dayNames = [
120
- 'Monday',
121
- 'Tuesday',
122
- 'Wednesday',
123
- 'Thursday',
124
- 'Friday',
125
- 'Saturday',
126
- 'Sunday',
127
- ];
128
- monthNames = [
129
- 'January',
130
- 'February',
131
- 'March',
132
- 'April',
133
- 'May',
134
- 'June',
135
- 'July',
136
- 'August',
137
- 'September',
138
- 'October',
139
- 'November',
140
- 'December',
141
- ];
142
- quarters = [
143
- 'January, April, July, October',
144
- 'February, May, August, November',
145
- 'March, June, September, December',
146
- ];
147
-
148
- categoryListLoaded = false;
149
- showRiskWidgets = false;
150
- showComplianceWidgets = false;
151
- isManageRisk: boolean = false;
152
-
153
- riskCategoryList = {
154
- strategic: {
155
- list: [],
156
- selectedList: [],
157
- },
158
- operational: {
159
- list: [],
160
- selectedList: [],
161
- },
162
- compliance: {
163
- list: [],
164
- selectedList: [],
165
- },
166
- others: {
167
- list: [],
168
- selectedList: [],
169
- },
170
- };
171
-
172
- fromDatePickerConfig: IDatePickerConfig = {
173
- min: this.getCurrentDate(),
174
- };
175
-
176
- toDatePickerConfig: IDatePickerConfig = {};
177
-
178
- isSmiley!: boolean;
179
- smileyMessage: string = '';
180
- groupList: any;
181
- groupsEnabled: boolean = false;
182
- totalgroups: any;
183
- @ViewChild('fromDatePicker', { read: ElementRef, static: false })
184
- fromDatePickerPopup!: ElementRef;
185
- @ViewChild('toDatePicker', { read: ElementRef, static: false })
186
- toDatePickerPopup!: ElementRef;
187
- openedDatePicker: string = '';
188
-
189
- constructor(
190
- private createDashboardService: CreateDashboardService,
191
- private paginationService: PaginationService,
192
- private cdr: ChangeDetectorRef,
193
- private snackBar: SnackBarService,
194
- public popoverService: PopoverService,
195
- private configureWidgetsService: ConfigureWidgetsService,
196
- private textCount: TextCountPipe,
197
- ) {}
198
-
199
- ngOnChanges() {
200
- if (this.createdBy) {
201
- this.listDetails.nonRemovableUsersList.push(this.createdBy);
202
- }
203
- }
204
-
205
- @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(
206
- event: KeyboardEvent
207
- ) {
208
- this.close.emit({ mode: 'discard' });
209
- this.isSmiley = false;
210
- }
211
-
212
- ngOnInit(): void {
213
- this.groupsEnabled = true;
214
- this.animation = true;
215
- setTimeout(() => {
216
- this.animation = false;
217
- }, 300);
218
- // this.getOrganizationUsersCount('');
219
- this.getCategoryList();
220
- this.getRCList();
221
- this.getComplianceCategoryList();
222
- this.setFrequency('2~1~0~0', 'import');
223
- this.checkWhetherAllListsLoaded();
224
- this.getUsersList('');
225
- this.getGroupList();
226
- this.createDashboardService.getUserInformation().subscribe(
227
- (res: any) => {
228
- this.setPermission(res?.roleActions);
229
- const quickLink = res.quick_link;
230
- if (quickLink.risk) {
231
- this.showRiskCategory = true;
232
- } else {
233
- this.showRiskCategory = false;
234
- }
235
- },
236
- (error) => {
237
- console.error(error);
238
- }
239
- );
240
- }
241
-
242
- /**
243
- * Displays the listing pages the left side of policy form to set and edit the dropdown fields values
244
- * @param type holds name of particular list is to be displayed
245
- * @param event contains boolean value to display the list or not
246
- */
247
- activateSelector(type: any, event: boolean) {
248
- if (type == 'frequency' || this.activeSelector == 'frequency') {
249
- this.showCriteria = false;
250
- setTimeout(() => {
251
- this.showCriteria = true;
252
- }, 1);
253
- }
254
- this.activeSelector = event ? type : '';
255
- }
256
-
257
- openFromDatePicker() {
258
- this.openedDatePicker = 'FROM_DATE';
259
-
260
- this.fromDatePicker?.api?.open();
261
- this.datePickerOverlay = true;
262
- }
263
-
264
- openToDatePicker() {
265
- this.openedDatePicker = 'TO_DATE';
266
-
267
- this.toDatePicker?.api?.open();
268
-
269
- this.datePickerOverlay = true;
270
- }
271
- closeFromDatePicker() {
272
- this.fromDatePicker?.api?.close();
273
- if (!this.dashboardForm.selectedFromDate) {
274
- this.dashboardForm.selectedToDate = undefined;
275
- this.hideToDate = true;
276
- setTimeout(() => {
277
- this.hideToDate = false;
278
- }, 20);
279
- this.fromDatePicker.api.close();
280
- this.datePickerOverlay = false;
281
- return;
282
- }
283
- let minToDate = this.setToDate(this.dashboardForm.selectedFromDate);
284
- this.toDatePickerConfig = { min: minToDate };
285
-
286
- const fromDate = new Date(minToDate.split('-').reverse().join('-'));
287
- const toDate = new Date(this.dashboardForm.selectedToDate);
288
- const inValidDate = fromDate >= toDate ? true : false;
289
- if (inValidDate) {
290
- this.dashboardForm.selectedToDate = undefined;
291
- this.hideToDate = true;
292
- setTimeout(() => {
293
- this.hideToDate = false;
294
- }, 20);
295
- }
296
-
297
- this.datePickerOverlay = false;
298
- }
299
-
300
- closeToDatePicker() {
301
- this.toDatePicker?.api?.close();
302
- this.datePickerOverlay = false;
303
- }
304
-
305
- animateImage() {
306
- const circleImage = document.getElementsByClassName('image');
307
- }
308
-
309
- saveFrequency(eventValues: any) {
310
- this.dashboardForm.selectedFrequencyType = eventValues.frequencyType;
311
- this.dashboardForm.selectedFrequencies = eventValues.frequencies;
312
- this.dashboardForm.frequencyMessage = eventValues.frequencyString;
313
- this.dashboardForm.frequencyDate = eventValues.selectedDate;
314
- this.activateSelector('', false);
315
- }
316
-
317
- getCurrentDate() {
318
- let today = new Date();
319
- return dayjs(today).format('DD-MM-YYYY');
320
- }
321
- setToDate(data: string) {
322
- let today = new Date(data);
323
- return dayjs(today).format('DD-MM-YYYY');
324
- }
325
- getFromDate(data: string) {
326
- let today = new Date(data);
327
- return (
328
- today.getDate() + '-' + (today.getMonth() + 1) + '-' + today.getFullYear()
329
- );
330
- }
331
-
332
- /**
333
- * It takes a string, converts it to a date, then returns a string in the format of YYYY-MM-DD.
334
- * @param {string} data - the date you want to format
335
- * @returns A string in the format of YYYY-MM-DD
336
- */
337
- getDateFormate(data: string) {
338
- let today = new Date(data);
339
- return (
340
- today.getFullYear() +
341
- '-' +
342
- String(today.getMonth() + 1).padStart(2, '0') +
343
- '-' +
344
- String(today.getDate()).padStart(2, '0')
345
- );
346
- }
347
-
348
- configureDashboard() {
349
- let fieldsStatus = this.validateDashboard();
350
- if (fieldsStatus) {
351
- if (this.mode == 'CREATE') {
352
- this.vLoader = true;
353
- const payload = {
354
- dashboard_name: this.dashboardForm.dashboardName,
355
- dashboard_id: '',
356
- };
357
- this.createDashboardService
358
- .checkDuplicateDashboardName(payload)
359
- .subscribe(
360
- (res) => {
361
- if (!res) {
362
- this.vLoader = false;
363
- this.showRiskWidgets =
364
- this.isManageRisk &&
365
- this.showRiskCategory &&
366
- (this.dashboardForm.selectedRiskCategories.length > 0 ||
367
- this.dashboardForm.selectedResponsibilityCenters.length > 0)
368
- ? true
369
- : false;
370
- this.showComplianceWidgets =
371
- this.dashboardForm.selectedResponsibilityCategories.length >
372
- 0 ||
373
- this.dashboardForm.selectedResponsibilityCenters.length > 0
374
- ? true
375
- : false;
376
- this.openConfigureWidgets = true;
377
- } else {
378
- this.vLoader = false;
379
- this.snackBar.show(
380
- 'A dashboard with this name already exists. Specify a different name for the dashboard.',
381
- 'alert'
382
- );
383
- return;
384
- }
385
- },
386
- (error) => {
387
- console.error(error);
388
- this.vLoader = false;
389
- }
390
- );
391
- } else if (this.mode == 'EDIT') {
392
- this.vLoader = true;
393
- const payload = {
394
- dashboard_name: this.dashboardForm.dashboardName,
395
- dashboard_id: this.dashboardId,
396
- };
397
- this.createDashboardService
398
- .checkDuplicateDashboardName(payload)
399
- .subscribe(
400
- (res) => {
401
- if (!res) {
402
- this.vLoader = false;
403
- this.showRiskWidgets =
404
- this.isManageRisk &&
405
- this.showRiskCategory &&
406
- (this.dashboardForm.selectedRiskCategories.length > 0 ||
407
- this.dashboardForm.selectedResponsibilityCenters.length > 0)
408
- ? true
409
- : false;
410
- this.showComplianceWidgets =
411
- this.dashboardForm.selectedResponsibilityCategories.length >
412
- 0 ||
413
- this.dashboardForm.selectedResponsibilityCenters.length > 0
414
- ? true
415
- : false;
416
- this.openConfigureWidgets = true;
417
- } else {
418
- this.vLoader = false;
419
- this.snackBar.show(
420
- 'A dashboard with this name already exists. Specify a different name for the dashboard.',
421
- 'alert'
422
- );
423
- return;
424
- }
425
- },
426
- (error) => {
427
- this.vLoader = false;
428
- console.error(error);
429
- }
430
- );
431
- }
432
- }
433
- }
434
-
435
- /**
436
- * Fetches organization users count api to get total number of pages
437
- * @param Url contains prams
438
- */
439
- getOrganizationUsersCount(Url: any) {
440
- this.createDashboardService
441
- .getOrganizationUsersCount(Url)
442
- .subscribe((res) => {
443
- this.totalList = res.total_members;
444
- if (res.total_members && res.limit_per_page > 1) {
445
- this.totalPages = res.create_page;
446
- } else {
447
- this.totalPages = 1;
448
- }
449
- });
450
- }
451
-
452
- /**
453
- * Get users list by making api call and pre selects all admins by adding to viewers
454
- * @param url contains query params for organization users api
455
- */
456
- getUsersList(url: any) {
457
- this.createDashboardService.getAllUsers().subscribe((res: any) => {
458
- this.usersList = res;
459
- this.userListLoaded = true;
460
-
461
- if (this.mode === 'EDIT') {
462
- this.vLoader = true;
463
- } else {
464
- this.dashboardForm.selectedViewers = this.setList(
465
- this.usersList,
466
- [this.createdBy],
467
- 'member_id'
468
- );
469
- this.listDetails.selectedUsersList = this.dashboardForm.selectedViewers;
470
- this.vLoader = false;
471
- }
472
- });
473
- }
474
-
475
- getGroupList() {
476
- this.createDashboardService.getAllGroups().subscribe((res: any) => {
477
- this.totalgroups = res.total_items;
478
- this.groupList = res.data;
479
- this.userListLoaded = true;
480
- if (this.mode === 'EDIT') {
481
- this.vLoader = true;
482
- } else {
483
- this.dashboardForm.selectedGroup = this.setList(
484
- this.groupList,
485
- [this.createdBy],
486
- 'group_id'
487
- );
488
- this.listDetails.selectedGroupList = this.dashboardForm.selectedGroup;
489
- this.vLoader = false;
490
- }
491
- });
492
- }
493
-
494
- getComplianceCategoryList() {
495
- this.createDashboardService
496
- .getComplianceCategoriesListFromGlobal()
497
- .subscribe(
498
- (res: any) => {
499
- const data = res;
500
- this.allComplianceCategories = Object.assign(res);
501
- // cloneDeep(res);
502
- data.forEach((element: any) => {
503
- if (element && element.compliance_type == 0) {
504
- this.responsibilityCategoriesTree.others.list.push(element);
505
- }
506
- if (element && element.compliance_type == 1) {
507
- this.responsibilityCategoriesTree.regulations.list.push(element);
508
- }
509
- if (element && element.compliance_type == 2) {
510
- this.responsibilityCategoriesTree.standards.list.push(element);
511
- }
512
- if (element && element.compliance_type == 3) {
513
- this.responsibilityCategoriesTree.internalControls.list.push(
514
- element
515
- );
516
- }
517
- });
518
- this.complianceCategoriesListLoaded = true;
519
- },
520
- (err: any) => {
521
- console.error(err);
522
- this.complianceCategoriesListLoaded = true;
523
- }
524
- );
525
- }
526
-
527
- getCategoryList() {
528
- this.createDashboardService.getCategoryList().subscribe(
529
- (res: any) => {
530
- this.riskCategoryList.strategic.list = res.strategic_arr;
531
- this.riskCategoryList.operational.list = res.operational_arr;
532
- this.riskCategoryList.compliance.list = res.compliance_arr;
533
- this.riskCategoryList.others.list = res.others_arr;
534
- this.riskCategoryListLoaded = true;
535
- this.allRiskCategories = [
536
- ...new Set(
537
- this.allRiskCategories.concat(
538
- res.strategic_arr,
539
- res.operational_arr,
540
- res.compliance_arr,
541
- res.others_arr
542
- )
543
- ),
544
- ];
545
- },
546
- (err) => {
547
- console.error(err);
548
- this.riskCategoryListLoaded = true;
549
- }
550
- );
551
- }
552
-
553
- /**
554
- * It is to ensure whether all required lists on Policy from is loaded from the api call or not
555
- */
556
- checkWhetherAllListsLoaded() {
557
- if (
558
- this.rcListLoaded &&
559
- this.complianceCategoriesListLoaded &&
560
- this.riskCategoryListLoaded &&
561
- this.userListLoaded
562
- ) {
563
- if (this.mode === 'EDIT') {
564
- this.editDashboard();
565
- } else {
566
- this.vLoader = false;
567
- }
568
- } else {
569
- setTimeout(() => {
570
- this.checkWhetherAllListsLoaded();
571
- }, 300);
572
- }
573
- }
574
-
575
- setSelectedWidgets(data: any) {
576
- if (this.mode === 'CREATE') {
577
- const widgetsArray: any = [];
578
- data.forEach((element: any) => {
579
- let obj: any = {};
580
- obj.module_name = element.module;
581
- obj._id = '';
582
- obj.widget_name = element.title;
583
- obj.widget_code = element.id;
584
- obj.sub_widgets = [];
585
- obj.state = 'ACTIVE';
586
- if (element.subWidgets.length > 0) {
587
- element.subWidgets.forEach((subWidget: any) => {
588
- let subWidgetObject: any = {};
589
- subWidgetObject._id = '';
590
- subWidgetObject.widget_name = subWidget.title;
591
- subWidgetObject.widget_code = subWidget.id;
592
- subWidgetObject.state = subWidget.value ? 'ACTIVE' : 'INACTIVE';
593
- obj.sub_widgets.push(Object.assign(subWidgetObject));
594
- });
595
- }
596
- widgetsArray.push(obj);
597
- });
598
-
599
- this.dashboardForm.configureWidget = widgetsArray;
600
- } else if (this.mode === 'EDIT') {
601
- const widgetsArray: any = [];
602
-
603
- data.forEach((element: any) => {
604
- if (
605
- !JSON.stringify(this.dashboardForm.configureWidget).includes(
606
- element.id
607
- )
608
- ) {
609
- let obj: any = {};
610
- obj.module_name = element.module;
611
- obj._id = '';
612
- obj.widget_name = element.title;
613
- obj.widget_code = element.id;
614
- obj.sub_widgets = [];
615
- obj.state = 'ACTIVE';
616
- if (element.subWidgets.length > 0) {
617
- element.subWidgets.forEach((subWidget: any) => {
618
- let subWidgetObject: any = {};
619
- subWidgetObject._id = '';
620
- subWidgetObject.widget_name = subWidget.title;
621
- subWidgetObject.widget_code = subWidget.id;
622
- subWidgetObject.state = subWidget.value ? 'ACTIVE' : 'INACTIVE';
623
- obj.sub_widgets.push(subWidgetObject);
624
- });
625
- }
626
- this.dashboardForm.configureWidget.push(obj);
627
- } else {
628
- const index = this.selectedWidgets.findIndex(
629
- (ele: any) => ele.widget_code == element.id
630
- );
631
- if (index != -1) {
632
- this.selectedWidgets[index].state = 'ACTIVE';
633
- if (this.selectedWidgets[index].sub_widgets.length > 0) {
634
- this.selectedWidgets[index].sub_widgets.forEach(
635
- (subWidgetData: any) => {
636
- const elementIndex = element.subWidgets.findIndex(
637
- (ele: any) => ele.id == subWidgetData.widget_code
638
- );
639
- if (elementIndex != -1) {
640
- subWidgetData.state = element.subWidgets[elementIndex].value
641
- ? 'ACTIVE'
642
- : 'INACTIVE';
643
- }
644
- }
645
- );
646
- }
647
- }
648
- }
649
- });
650
- this.dashboardForm.configureWidget.forEach((savedWidget: any) => {
651
- const index = data.findIndex(
652
- (dataElement: any) => dataElement.id == savedWidget.widget_code
653
- );
654
- if (index == -1) {
655
- savedWidget.state = 'INACTIVE';
656
- if (savedWidget.sub_widgets.length > 0) {
657
- savedWidget.sub_widgets.forEach((saveSubWidget: any) => {
658
- saveSubWidget.state = 'INACTIVE';
659
- });
660
- }
661
- }
662
- });
663
- }
664
- this.selectedWidgets = data;
665
- this.openConfigureWidgets = false;
666
- this.submitDashboard();
667
- }
668
-
669
- closeConfigureWidgets(event: boolean) {
670
- this.openConfigureWidgets = event;
671
- }
672
-
673
- /**
674
- * Filter list user's list based on pagination by making api call
675
- * @param event specifies a boolean value to call api
676
- */
677
- paginationFilter(event: any) {
678
- if (event) {
679
- this.getUsersList({
680
- p:
681
- this.paginationService.currentPage === 1
682
- ? ''
683
- : this.paginationService.currentPage,
684
- type: 'all_except_executive',
685
- q: !this.paginationService.searchValue
686
- ? ''
687
- : this.paginationService.searchValue,
688
- });
689
- }
690
- }
691
-
692
- getRCList() {
693
- this.createDashboardService.getResponsibilityCenterList().subscribe(
694
- (res: any) => {
695
- this.responsibilityCentersList = res;
696
- this.rcListLoaded = true;
697
- },
698
- (err: any) => {
699
- console.error(err);
700
- this.rcListLoaded = true;
701
- }
702
- );
703
- }
704
- /**
705
- * #### Description
706
- *
707
- * Returns the unique array of object based on unique key
708
- * @param array
709
- * @param key
710
- * @returns
711
- */
712
- uniqueByProp(array: any, key: string) {
713
- return Array.from(
714
- array
715
- .reduce(
716
- (acc: any, item: any) => (
717
- item && item[key] && acc.set(item[key], item), acc
718
- ),
719
- new Map()
720
- )
721
- .values()
722
- );
723
- }
724
-
725
- saveSelectedList(type: string, selectedItems: any) {
726
- switch (type) {
727
- case 'rc':
728
- this.dashboardForm.selectedResponsibilityCenters = this.setList(
729
- this.responsibilityCentersList,
730
- selectedItems,
731
- 'item_id'
732
- );
733
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
734
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
735
- this.selectedWidgets = this.selectedWidgets.filter(
736
- (element: any) => element.module_name != 'COMPLIANCE'
737
- );
738
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
739
- this.selectedWidgets = this.selectedWidgets.filter(
740
- (element: any) => element.module_name != 'RISK'
741
- );
742
- }
743
- }
744
- break;
745
- case 'whoCanView':
746
- this.dashboardForm.selectedViewers = this.uniqueByProp(
747
- selectedItems?.users,
748
- 'member_id'
749
- );
750
- this.listDetails.selectedUsersList = this.dashboardForm.selectedViewers;
751
- this.dashboardForm.selectedGroup = this.uniqueByProp(
752
- selectedItems?.groups,
753
- 'group_id'
754
- );
755
- this.listDetails.selectedGroupList = this.dashboardForm.selectedGroup;
756
- break;
757
- case 'responsibilityCategories':
758
- this.dashboardForm.selectedResponsibilityCategories = selectedItems;
759
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
760
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
761
- this.selectedWidgets = this.selectedWidgets.filter(
762
- (element: any) => element.module_name != 'COMPLIANCE'
763
- );
764
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
765
- this.selectedWidgets = this.selectedWidgets.filter(
766
- (element: any) => element.module_name != 'RISK'
767
- );
768
- }
769
- }
770
- break;
771
- case 'riskCategory':
772
- this.dashboardForm.selectedRiskCategories = selectedItems;
773
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
774
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
775
- this.selectedWidgets = this.selectedWidgets.filter(
776
- (element: any) => element.module_name != 'COMPLIANCE'
777
- );
778
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
779
- this.selectedWidgets = this.selectedWidgets.filter(
780
- (element: any) => element.module_name != 'RISK'
781
- );
782
- }
783
- }
784
- break;
785
- }
786
- this.activateSelector('', false);
787
- }
788
-
789
- remove(type: any, event: any, removeIndex?: any) {
790
- switch (type) {
791
- case 'rc':
792
- const rcIndex =
793
- this.dashboardForm.selectedResponsibilityCenters.findIndex(
794
- (rc: any) => rc.rc_id == event.rc_id
795
- );
796
- if (rcIndex !== -1) {
797
- const parentRc: any =
798
- this.dashboardForm.selectedResponsibilityCenters[rcIndex];
799
- this.dashboardForm.selectedResponsibilityCenters.splice(rcIndex, 1);
800
-
801
- if (parentRc?.item_child_ids?.length > 0) {
802
- parentRc.item_child_ids.forEach((childElement: any) => {
803
- const removeIndex =
804
- this.dashboardForm.selectedResponsibilityCenters.findIndex(
805
- (removeElement: any) => removeElement.rc_id == childElement
806
- );
807
- this.dashboardForm.selectedResponsibilityCenters.splice(
808
- removeIndex,
809
- 1
810
- );
811
- });
812
- }
813
- }
814
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
815
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
816
- this.selectedWidgets = this.selectedWidgets.filter(
817
- (element: any) => element.module_name != 'COMPLIANCE'
818
- );
819
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
820
- this.selectedWidgets = this.selectedWidgets.filter(
821
- (element: any) => element.module_name != 'RISK'
822
- );
823
- }
824
- }
825
- break;
826
-
827
- case 'whoCanView':
828
- const reviewerIndex = this.dashboardForm.selectedViewers.findIndex(
829
- (viewer: any) => viewer.member_id == event.member_id
830
- );
831
- this.dashboardForm.selectedViewers.splice(reviewerIndex, 1);
832
- break;
833
- case 'whoCanViewGroup':
834
- const groups = this.dashboardForm.selectedGroup.findIndex(
835
- (ele: any) => ele?.group_id == event?.group_id
836
- );
837
- this.dashboardForm.selectedGroup.splice(groups, 1);
838
- break;
839
- case 'responsibilityCategories':
840
- const CCcategoryIndex =
841
- this.dashboardForm.selectedResponsibilityCategories.findIndex(
842
- (CCcategory: any) => CCcategory.category_id == event.category_id
843
- );
844
- this.dashboardForm.selectedResponsibilityCategories.splice(
845
- CCcategoryIndex,
846
- 1
847
- );
848
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
849
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
850
- this.selectedWidgets = this.selectedWidgets.filter(
851
- (element: any) => element.module_name != 'COMPLIANCE'
852
- );
853
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
854
- this.selectedWidgets = this.selectedWidgets.filter(
855
- (element: any) => element.module_name != 'RISK'
856
- );
857
- }
858
- }
859
- break;
860
-
861
- case 'riskCategory':
862
- const riskCategoryIndex =
863
- this.dashboardForm.selectedRiskCategories.findIndex(
864
- (riskCategory: any) => riskCategory.category_id == event.category_id
865
- );
866
- if (riskCategoryIndex !== -1) {
867
- const parent: any =
868
- this.dashboardForm.selectedRiskCategories[riskCategoryIndex];
869
- this.dashboardForm.selectedRiskCategories.splice(
870
- riskCategoryIndex,
871
- 1
872
- );
873
- if (parent?.child_cat_ids?.length > 0) {
874
- parent.child_cat_ids.forEach((childElement: any) => {
875
- const removeIndex =
876
- this.dashboardForm.selectedRiskCategories.findIndex(
877
- (removeElement: any) =>
878
- removeElement.category_id == childElement
879
- );
880
- this.dashboardForm.selectedRiskCategories.splice(removeIndex, 1);
881
- });
882
- }
883
- }
884
- this.dashboardForm.selectedRiskCategories.splice(riskCategoryIndex, 1);
885
- if (this.dashboardForm.selectedResponsibilityCenters.length == 0) {
886
- if (this.dashboardForm.selectedResponsibilityCategories.length == 0) {
887
- this.selectedWidgets = this.selectedWidgets.filter(
888
- (element: any) => element.module_name != 'COMPLIANCE'
889
- );
890
- } else if (this.dashboardForm.selectedRiskCategories.length == 0) {
891
- this.selectedWidgets = this.selectedWidgets.filter(
892
- (element: any) => element.module_name != 'RISK'
893
- );
894
- }
895
- }
896
- break;
897
- }
898
- }
899
-
900
- setList(list: any[], ids: any[], key: string) {
901
- const data: any = [];
902
-
903
- ids.forEach((element: any) => {
904
- const index = list.findIndex(
905
- (listElement: any) => listElement[key] == element
906
- );
907
- if (index !== -1) {
908
- data.push(list[index]);
909
- }
910
- });
911
- return data;
912
- }
913
- submitted = false;
914
-
915
- /**
916
- * Returns id's from a particular list elements
917
- * @param list actual selected list
918
- * @param key contains key to extract id from the list
919
- */
920
- returnIds(list: any[], key: string) {
921
- return list?.map((ele) => {
922
- if (ele[key]) {
923
- return ele[key];
924
- }
925
- });
926
- }
927
-
928
- /**
929
- * Validates the data submitted on create dashboard form
930
- */
931
- validateDashboard() {
932
- setTimeout(() => {
933
- this.submitted = true;
934
- }, 100);
935
- const event = this.dashboardForm.dashboardName;
936
- const re = /&nbsp;|<br>/g;
937
- this.dashboardForm.dashboardName = event.replace(re, '').trim();
938
- const description = this.dashboardForm.dashboardDescriptionText;
939
- this.dashboardForm.dashboardDescriptionText = description
940
- .replace(re, '')
941
- .trim();
942
- if (
943
- !this.dashboardForm.dashboardName ||
944
- this.dashboardForm.dashboardName.trim() == '' ||
945
- this.dashboardForm.dashboardName.length > 30 ||
946
- this.textCount.transform(this.dashboardForm?.dashboardDescriptionText) >
947
- 250 ||
948
- (this.dashboardForm?.selectedFromDate &&
949
- !this.dashboardForm?.selectedToDate) ||
950
- (this.dashboardForm.selectedResponsibilityCenters.length == 0 &&
951
- this.dashboardForm.selectedResponsibilityCategories.length == 0 &&
952
- this.dashboardForm.selectedRiskCategories.length == 0)
953
- ) {
954
- return false;
955
- } else {
956
- return true;
957
- }
958
- }
959
-
960
- /**
961
- * Makes an api call to create a policy
962
- * @param dashboard contains dashboardForm data
963
- */
964
- submitDashboard() {
965
- this.submitted = false;
966
- const valid = this.validateDashboard();
967
- if (!valid) {
968
- return false;
969
- }
970
- this.vLoader = true;
971
- const dashboard = this.dashboardForm;
972
- const payload: any = {
973
- dashboard_name: dashboard.dashboardName,
974
- description: [
975
- {
976
- content: dashboard.dashboardDescriptionText,
977
- attachments: [],
978
- },
979
- ],
980
- visible_to_users: this.returnIds(dashboard.selectedViewers, 'member_id'),
981
- visible_to_groups: this.returnIds(dashboard.selectedGroup, 'group_id'),
982
- responsibility_center: this.returnIds(
983
- dashboard.selectedResponsibilityCenters,
984
- 'item_id'
985
- ),
986
- responsibility_category: this.returnIds(
987
- dashboard.selectedResponsibilityCategories,
988
- 'category_id'
989
- ),
990
- risk_category: this.returnIds(
991
- dashboard.selectedRiskCategories,
992
- 'category_id'
993
- ),
994
- display_criteria:
995
- dashboard.displayCriteria === 'and'
996
- ? 'BOTH_RC_AND_CATEGORY'
997
- : 'RC_OR_CATEGORY',
998
- timeframe: {
999
- start_date: dashboard.selectedFromDate
1000
- ? this.getDateFormate(dashboard?.selectedFromDate)
1001
- : '',
1002
- end_date: dashboard.selectedToDate
1003
- ? this.getDateFormate(dashboard?.selectedToDate)
1004
- : '',
1005
- },
1006
- email_summary: this.setFrequency('', 'export'), //setFormat
1007
- widget_details: dashboard.configureWidget,
1008
- };
1009
- if (this.mode == 'CREATE') {
1010
- this.createDashboardService.submitDashboard(payload).subscribe(
1011
- (res: any) => {
1012
- this.vLoader = false;
1013
- // this.snackBar.show('The dashboard has been created.','info');
1014
- this.isSmiley = true;
1015
- this.smileyMessage = 'The dashboard has been created.';
1016
- setTimeout(() => {
1017
- this.isSmiley = false;
1018
- this.close.emit({ mode: 'created', id: res._id });
1019
- }, 3000);
1020
- },
1021
- (err) => {
1022
- if (err.status === 409) {
1023
- this.snackBar.show(
1024
- 'A dashboard with this name already exists. Specify a different name for the dashboard.',
1025
- 'alert'
1026
- );
1027
- this.vLoader = false;
1028
- } else {
1029
- console.error(err);
1030
- this.vLoader = false;
1031
- this.snackBar.show(
1032
- 'OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?',
1033
- 'alert'
1034
- );
1035
- }
1036
- }
1037
- );
1038
- }
1039
- if (this.mode === 'EDIT') {
1040
- payload.widget_update_flag = true;
1041
- this.createDashboardService
1042
- .updateDashboard(this.dashboardId, payload)
1043
- .subscribe({
1044
- next: (res: any) => {
1045
- this.vLoader = false;
1046
- // this.snackBar.show('The dashboard has been updated','info');
1047
- this.isSmiley = true;
1048
- this.smileyMessage = 'The dashboard has been updated';
1049
- setTimeout(() => {
1050
- this.isSmiley = false;
1051
- this.close.emit({ mode: 'updated' });
1052
- }, 3000);
1053
- },
1054
- error: (error: any) => {
1055
- console.error(error);
1056
- this.vLoader = false;
1057
- this.snackBar.show(
1058
- 'OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?',
1059
- 'alert'
1060
- );
1061
- },
1062
- });
1063
- }
1064
- }
1065
-
1066
- editDashboard() {
1067
- if (this.dashboardId) {
1068
- this.createDashboardService.fetchDashboard(this.dashboardId).subscribe(
1069
- (res: any) => {
1070
- const data = res;
1071
- this.listDetails.nonRemovableUsersList = [res.created_by];
1072
- data.visible_to_groups =
1073
- data?.visible_to_groups && data.visible_to_groups.length
1074
- ? data.visible_to_groups
1075
- : [];
1076
- this.populateDashboardForm(data);
1077
- },
1078
- (error) => {
1079
- console.error(error);
1080
- }
1081
- );
1082
- }
1083
- }
1084
-
1085
- populateDashboardForm(data: any) {
1086
- try {
1087
- (this.dashboardForm.dashboardName = data?.dashboard_name),
1088
- (this.dashboardForm.dashboardDescriptionText =
1089
- data?.description[0]?.content ?? ''),
1090
- (this.dashboardForm.selectedViewers = this.setList(
1091
- this.usersList,
1092
- data?.visible_to_users,
1093
- 'member_id'
1094
- ));
1095
- this.listDetails.selectedUsersList = this.dashboardForm.selectedViewers;
1096
- data.visible_to_groups =
1097
- data?.visible_to_groups && data?.visible_to_groups.length
1098
- ? data?.visible_to_groups
1099
- : [];
1100
- this.dashboardForm.selectedGroup = this.setList(
1101
- this.groupList,
1102
- data?.visible_to_groups ?? [],
1103
- 'group_id'
1104
- );
1105
- this.listDetails.selectedGroupList = this.dashboardForm.selectedGroup;
1106
- this.dashboardForm.selectedResponsibilityCenters = this.setList(
1107
- this.responsibilityCentersList,
1108
- data?.responsibility_center,
1109
- 'item_id'
1110
- );
1111
- this.dashboardForm.selectedResponsibilityCategories = this.setList(
1112
- this.allComplianceCategories,
1113
- data?.responsibility_category,
1114
- 'category_id'
1115
- );
1116
- this.dashboardForm.selectedRiskCategories = this.setList(
1117
- this.allRiskCategories,
1118
- data?.risk_category,
1119
- 'category_id'
1120
- );
1121
- this.dashboardForm.displayCriteria =
1122
- data?.display_criteria === 'BOTH_RC_AND_CATEGORY' ? 'and' : 'or';
1123
- this.dashboardForm.selectedFromDate = data?.timeframe?.start_date
1124
- ? new Date(data?.timeframe?.start_date)
1125
- : undefined;
1126
- this.dashboardForm.selectedToDate = data?.timeframe?.end_date
1127
- ? new Date(data?.timeframe?.end_date)
1128
- : undefined;
1129
- this.vLoader = false;
1130
- this.dashboardForm.configureWidget = data.widget_details;
1131
- this.selectedWidgets =
1132
- data.widget_details.length > 0 ? [...new Set(data.widget_details)] : [];
1133
- this.displayedWidgets =
1134
- data.all_widgets.length > 0 ? [...new Set(data.all_widgets)] : [];
1135
- this.setFrequency(data?.email_summary, 'import');
1136
- let minToDate = this.setToDate(data?.timeframe?.start_date);
1137
- this.toDatePickerConfig = { min: minToDate };
1138
- this.hideToDate = true;
1139
- setTimeout(() => {
1140
- this.hideToDate = false;
1141
- }, 20);
1142
- } catch (error) {
1143
- console.error('populate dashboard error =>', error);
1144
- }
1145
- }
1146
-
1147
- setFrequency(event: any, mode: any) {
1148
- if (mode === 'export') {
1149
- switch (this.dashboardForm.selectedFrequencyType) {
1150
- case 'weekly':
1151
- const weeklyValueData = this.dashboardForm?.selectedFrequencies?.map(
1152
- (ele: any) => Number(ele) + 1
1153
- );
1154
- const weeklyValue = weeklyValueData?.join();
1155
- return '2~' + weeklyValue + '~0~0';
1156
- case 'monthly':
1157
- const monthlyValueData = this.dashboardForm?.selectedFrequencies?.map(
1158
- (ele: any) => Number(ele) + 1
1159
- );
1160
- const monthlyValue = monthlyValueData?.join();
1161
- return (
1162
- '3~' + this.dashboardForm?.frequencyDate + '~' + monthlyValue + '~0'
1163
- );
1164
- case 'quarterly':
1165
- const quarterlyValueData =
1166
- Number(this.dashboardForm.selectedFrequencies) + 1;
1167
- return (
1168
- '7~' +
1169
- this.dashboardForm.frequencyDate +
1170
- '~' +
1171
- quarterlyValueData +
1172
- '~0'
1173
- );
1174
- }
1175
- }
1176
- if (mode === 'import') {
1177
- const val = event.split('~');
1178
- switch (val[0]) {
1179
- case '2':
1180
- {
1181
- let stringVal = 'Every ';
1182
- this.dashboardForm.selectedFrequencyType = 'weekly';
1183
- this.dashboardForm.selectedFrequencies = val[1]
1184
- ?.split(',')
1185
- ?.map((element: any) => Number(element) - 1);
1186
- this.dashboardForm.selectedFrequencies?.forEach(
1187
- (dayIndex: any, index: any) => {
1188
- stringVal +=
1189
- index === 0
1190
- ? this.dayNames[dayIndex]
1191
- : ', ' + this.dayNames[dayIndex];
1192
- }
1193
- );
1194
- this.dashboardForm.frequencyMessage = stringVal;
1195
- }
1196
-
1197
- break;
1198
- case '3':
1199
- {
1200
- let stringVal = 'every ';
1201
- this.dashboardForm.selectedFrequencyType = 'monthly';
1202
- this.dashboardForm.frequencyDate = val[1];
1203
- this.dashboardForm.selectedFrequencies = val[2]
1204
- ?.split(',')
1205
- ?.map((element: any) => Number(element) - 1);
1206
- this.dashboardForm.selectedFrequencies.forEach(
1207
- (monthIndex: any, index: any) => {
1208
- stringVal +=
1209
- index === 0
1210
- ? this.monthNames[monthIndex]
1211
- : ', ' + this.monthNames[monthIndex];
1212
- }
1213
- );
1214
- let monthDateName;
1215
- if (this.dashboardForm.frequencyDate == '1') {
1216
- monthDateName = '1st';
1217
- } else if (this.dashboardForm.frequencyDate == '2') {
1218
- monthDateName = '2nd';
1219
- } else if (this.dashboardForm.frequencyDate == '3') {
1220
- monthDateName = '3rd';
1221
- } else {
1222
- monthDateName = this.dashboardForm.frequencyDate + 'th';
1223
- }
1224
- this.dashboardForm.frequencyMessage =
1225
- monthDateName + ' of ' + stringVal;
1226
- }
1227
- break;
1228
- case '7':
1229
- {
1230
- let stringVal = 'every ';
1231
- this.dashboardForm.selectedFrequencyType = 'quarterly';
1232
- this.dashboardForm.frequencyDate = val[1];
1233
- this.dashboardForm.selectedFrequencies =
1234
- Number(val[2].split(',')[0]) - 1;
1235
- stringVal += this.quarters[this.dashboardForm.selectedFrequencies];
1236
- let monthDateName;
1237
- if (this.dashboardForm.frequencyDate == '1') {
1238
- monthDateName = '1st';
1239
- } else if (this.dashboardForm.frequencyDate == '2') {
1240
- monthDateName = '2nd';
1241
- } else if (this.dashboardForm.frequencyDate == '3') {
1242
- monthDateName = '3rd';
1243
- } else {
1244
- monthDateName = this.dashboardForm.frequencyDate + 'th';
1245
- }
1246
- this.dashboardForm.frequencyMessage =
1247
- monthDateName + ' of ' + stringVal;
1248
- }
1249
- break;
1250
- }
1251
- }
1252
- }
1253
-
1254
- ngAfterViewChecked() {
1255
- //your code to update the model
1256
- this.cdr.detectChanges();
1257
- }
1258
-
1259
- setPermission(roleActions: any) {
1260
- let ifExistRisk = roleActions?.find((el: any) => el.moduleName == 'risk');
1261
- ifExistRisk?.subModule?.forEach((module: any) => {
1262
- module?.permissions?.forEach((permission: any) => {
1263
- switch (permission?.code) {
1264
- case 'RRMR': {
1265
- if (permission?.defaultPermission == 1 || permission?.enable == 1) {
1266
- this.isManageRisk = true;
1267
- }
1268
- break;
1269
- }
1270
- }
1271
- });
1272
- });
1273
- }
1274
- @HostListener('document:click', ['$event'])
1275
- documentClick(event: any): void {
1276
- const targetElement = event?.target as Element;
1277
- const fromDateInputElement =
1278
- document.getElementById(this.openedDatePicker.toLowerCase()) || null;
1279
- const datePickerCalendarContainer = document.getElementsByClassName(
1280
- 'dp-day-calendar-container'
1281
- )[0];
1282
- const monthYearElement = document.querySelector(
1283
- '.dp-month-calendar-container'
1284
- );
1285
- const isNotMonthYearElement = !monthYearElement?.contains(targetElement);
1286
-
1287
- const openedElement =
1288
- this.openedDatePicker === 'FROM_DATE'
1289
- ? this.fromDatePickerPopup
1290
- : this.toDatePickerPopup;
1291
- const isOutsideFromDateInput =
1292
- !openedElement?.nativeElement?.contains(targetElement);
1293
- const isNotFromDateElement = event?.target !== fromDateInputElement;
1294
- const isNotInsideCalendar =
1295
- !datePickerCalendarContainer?.contains(targetElement);
1296
- const selectedDatePicker =
1297
- this.openedDatePicker === 'FROM_DATE'
1298
- ? this.fromDatePicker
1299
- : this.toDatePicker;
1300
-
1301
- const isNotCalendarMonth =
1302
- !targetElement.className.includes('dp-calendar-month');
1303
-
1304
- if (
1305
- isOutsideFromDateInput &&
1306
- isNotFromDateElement &&
1307
- isNotInsideCalendar &&
1308
- isNotCalendarMonth &&
1309
- isNotMonthYearElement &&
1310
- datePickerCalendarContainer
1311
- ) {
1312
- this.documentClickListener(
1313
- event.target,
1314
- openedElement,
1315
- selectedDatePicker
1316
- );
1317
- }
1318
- }
1319
-
1320
- documentClickListener(
1321
- target: any,
1322
- openedElements: ElementRef,
1323
- selectedDatePicker: any
1324
- ): void {
1325
- if (
1326
- !openedElements?.nativeElement?.contains(target) &&
1327
- selectedDatePicker?.areCalendarsShown
1328
- ) {
1329
- selectedDatePicker?.api?.close();
1330
- this.datePickerOverlay = false;
1331
- }
1332
- }
1333
- }