verben-authentication-ui 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/ng-package.json +8 -0
  2. package/package.json +8 -14
  3. package/src/lib/components/button/button.component.css +3 -0
  4. package/src/lib/components/button/button.component.html +13 -0
  5. package/src/lib/components/button/button.component.spec.ts +23 -0
  6. package/src/lib/components/button/button.component.ts +24 -0
  7. package/src/lib/components/button/button.module.ts +11 -0
  8. package/{lib/components/forgot-password/ForgotPasswordData.d.ts → src/lib/components/forgot-password/ForgotPasswordData.ts} +1 -1
  9. package/src/lib/components/forgot-password/forgot-password.component.css +29 -0
  10. package/src/lib/components/forgot-password/forgot-password.component.html +13 -0
  11. package/src/lib/components/forgot-password/forgot-password.component.spec.ts +23 -0
  12. package/src/lib/components/forgot-password/forgot-password.component.ts +86 -0
  13. package/src/lib/components/forgot-password/forgot-password.module.ts +18 -0
  14. package/src/lib/components/mail/mail.component.css +0 -0
  15. package/src/lib/components/mail/mail.component.html +11 -0
  16. package/src/lib/components/mail/mail.component.spec.ts +23 -0
  17. package/src/lib/components/mail/mail.component.ts +47 -0
  18. package/src/lib/components/mail/mail.module.ts +13 -0
  19. package/src/lib/components/mail-validation/mail-validation.component.css +59 -0
  20. package/src/lib/components/mail-validation/mail-validation.component.html +37 -0
  21. package/src/lib/components/mail-validation/mail-validation.component.spec.ts +23 -0
  22. package/src/lib/components/mail-validation/mail-validation.component.ts +66 -0
  23. package/src/lib/components/mail-validation/mail-validation.module.ts +18 -0
  24. package/src/lib/components/o-auth/o-auth.component.css +21 -0
  25. package/src/lib/components/o-auth/o-auth.component.html +60 -0
  26. package/src/lib/components/o-auth/o-auth.component.spec.ts +23 -0
  27. package/src/lib/components/o-auth/o-auth.component.ts +43 -0
  28. package/src/lib/components/o-auth/o-auth.module.ts +11 -0
  29. package/src/lib/components/otp-input/otp-input.component.css +19 -0
  30. package/src/lib/components/otp-input/otp-input.component.html +14 -0
  31. package/src/lib/components/otp-input/otp-input.component.spec.ts +23 -0
  32. package/src/lib/components/otp-input/otp-input.component.ts +73 -0
  33. package/src/lib/components/otp-input/otp-input.module.ts +15 -0
  34. package/src/lib/components/reset-password/ResetPasswordData.ts +5 -0
  35. package/src/lib/components/reset-password/reset-password.component.css +29 -0
  36. package/src/lib/components/reset-password/reset-password.component.html +22 -0
  37. package/src/lib/components/reset-password/reset-password.component.spec.ts +23 -0
  38. package/src/lib/components/reset-password/reset-password.component.ts +108 -0
  39. package/src/lib/components/reset-password/reset-password.module.ts +18 -0
  40. package/src/lib/components/sign-in/sign-in.component.css +21 -0
  41. package/src/lib/components/sign-in/sign-in.component.html +84 -0
  42. package/src/lib/components/sign-in/sign-in.component.spec.ts +23 -0
  43. package/src/lib/components/sign-in/sign-in.component.ts +184 -0
  44. package/src/lib/components/sign-in/sign-in.module.ts +17 -0
  45. package/src/lib/components/sign-up/sign-up.component.css +36 -0
  46. package/src/lib/components/sign-up/sign-up.component.html +132 -0
  47. package/src/lib/components/sign-up/sign-up.component.spec.ts +23 -0
  48. package/src/lib/components/sign-up/sign-up.component.ts +176 -0
  49. package/src/lib/components/sign-up/sign-up.module.ts +15 -0
  50. package/src/lib/components/sso/base-table-style.ts +52 -0
  51. package/src/lib/components/sso/helper.ts +15 -0
  52. package/src/lib/components/sso/sso-form/sso-form.component.css +13 -0
  53. package/src/lib/components/sso/sso-form/sso-form.component.html +109 -0
  54. package/src/lib/components/sso/sso-form/sso-form.component.spec.ts +23 -0
  55. package/src/lib/components/sso/sso-form/sso-form.component.ts +70 -0
  56. package/src/lib/components/sso/sso.columns.ts +32 -0
  57. package/src/lib/components/sso/sso.component.css +47 -0
  58. package/src/lib/components/sso/sso.component.html +208 -0
  59. package/src/lib/components/sso/sso.component.spec.ts +23 -0
  60. package/src/lib/components/sso/sso.component.ts +261 -0
  61. package/src/lib/components/sso/sso.module.ts +40 -0
  62. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.css +8 -0
  63. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.html +30 -0
  64. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.spec.ts +23 -0
  65. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.ts +183 -0
  66. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.ts +15 -0
  67. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.css +17 -0
  68. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.html +45 -0
  69. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.spec.ts +23 -0
  70. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.ts +57 -0
  71. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.ts +11 -0
  72. package/src/lib/components/user-management/base-table-style.ts +52 -0
  73. package/src/lib/components/user-management/helper.ts +29 -0
  74. package/src/lib/components/user-management/index.ts +4 -0
  75. package/src/lib/components/user-management/useer-management.module.ts +48 -0
  76. package/src/lib/components/user-management/user-management-form/use-management-form.component.ts +61 -0
  77. package/src/lib/components/user-management/user-management-form/user-management-form.component.css +0 -0
  78. package/src/lib/components/user-management/user-management-form/user-management-form.component.html +91 -0
  79. package/src/lib/components/user-management/user-management-form/user-management-form.component.spec.ts +23 -0
  80. package/src/lib/components/user-management/user-management.columns.ts +45 -0
  81. package/src/lib/components/user-management/user-management.component.css +26 -0
  82. package/src/lib/components/user-management/user-management.component.html +275 -0
  83. package/src/lib/components/user-management/user-management.component.spec.ts +23 -0
  84. package/src/lib/components/user-management/user-management.component.ts +380 -0
  85. package/src/lib/components/user-management/user-management.service.ts +42 -0
  86. package/src/lib/components/user-request/user-request.component.css +91 -0
  87. package/src/lib/components/user-request/user-request.component.html +165 -0
  88. package/src/lib/components/user-request/user-request.component.spec.ts +23 -0
  89. package/src/lib/components/user-request/user-request.component.ts +167 -0
  90. package/src/lib/components/user-request/user-request.module.ts +18 -0
  91. package/src/lib/components/user-request-approval/access-request.columns.ts +26 -0
  92. package/src/lib/components/user-request-approval/base-table-style.ts +52 -0
  93. package/src/lib/components/user-request-approval/facades/user-access-request.facade.ts +152 -0
  94. package/src/lib/components/user-request-approval/helper.ts +39 -0
  95. package/src/lib/components/user-request-approval/services/user-access-request.service.spec.ts +16 -0
  96. package/src/lib/components/user-request-approval/services/user-access-request.service.ts +87 -0
  97. package/src/lib/components/user-request-approval/states/user-access-request.state.ts +65 -0
  98. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.css +0 -0
  99. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.html +7 -0
  100. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.spec.ts +23 -0
  101. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.ts +22 -0
  102. package/src/lib/components/user-request-approval/user-request-approval.component.css +1 -0
  103. package/src/lib/components/user-request-approval/user-request-approval.component.html +218 -0
  104. package/src/lib/components/user-request-approval/user-request-approval.component.spec.ts +23 -0
  105. package/src/lib/components/user-request-approval/user-request-approval.component.ts +301 -0
  106. package/src/lib/components/user-request-approval/user-request-approval.module.ts +52 -0
  107. package/src/lib/components/user-request-approval/user-request-approval.service.spec.ts +16 -0
  108. package/src/lib/components/user-request-approval/user-request-approval.service.ts +58 -0
  109. package/src/lib/components/user-request-approval/user-request-form/use-request-form.component.ts +66 -0
  110. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.css +0 -0
  111. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.html +97 -0
  112. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.spec.ts +23 -0
  113. package/src/lib/models/ErrorResponse.ts +7 -0
  114. package/src/lib/models/PasswordRequestParam.ts +5 -0
  115. package/src/lib/models/ResponseKeyValue.ts +5 -0
  116. package/src/lib/models/UserRequest.ts +28 -0
  117. package/src/lib/models/auth-mechanism.ts +14 -0
  118. package/src/lib/models/base.ts +11 -0
  119. package/src/lib/models/log-in.ts +7 -0
  120. package/{lib/models/mainUser.d.ts → src/lib/models/mainUser.ts} +3 -2
  121. package/src/lib/models/object-state.ts +6 -0
  122. package/{lib/models/otpValue.d.ts → src/lib/models/otpValue.ts} +3 -1
  123. package/src/lib/models/paged.ts +9 -0
  124. package/src/lib/models/query-params.ts +7 -0
  125. package/src/lib/models/request-status.ts +4 -0
  126. package/src/lib/models/resend-otp-data.ts +8 -0
  127. package/src/lib/models/resource.ts +27 -0
  128. package/src/lib/models/sign-up.ts +11 -0
  129. package/src/lib/models/single-sign-on.ts +9 -0
  130. package/src/lib/models/status.ts +5 -0
  131. package/src/lib/models/user-access-request-status.ts +5 -0
  132. package/{lib/models/user-access-request.d.ts → src/lib/models/user-access-request.ts} +4 -3
  133. package/src/lib/models/user.ts +24 -0
  134. package/src/lib/services/environment.service.spec.ts +16 -0
  135. package/src/lib/services/environment.service.ts +23 -0
  136. package/src/lib/services/http-web-request.service.spec.ts +16 -0
  137. package/src/lib/services/http-web-request.service.ts +101 -0
  138. package/src/lib/services/util.service.spec.ts +16 -0
  139. package/src/lib/services/util.service.ts +28 -0
  140. package/{public-api.d.ts → src/public-api.ts} +21 -0
  141. package/src/styles.css +96 -0
  142. package/src/theme/tailwind-setup.css +3 -0
  143. package/src/theme/tailwind.css +980 -0
  144. package/tailwind.config.js +20 -0
  145. package/tsconfig.lib.json +15 -0
  146. package/tsconfig.lib.prod.json +11 -0
  147. package/tsconfig.spec.json +15 -0
  148. package/esm2022/lib/components/button/button.component.mjs +0 -46
  149. package/esm2022/lib/components/button/button.module.mjs +0 -20
  150. package/esm2022/lib/components/forgot-password/ForgotPasswordData.mjs +0 -2
  151. package/esm2022/lib/components/forgot-password/forgot-password.component.mjs +0 -86
  152. package/esm2022/lib/components/forgot-password/forgot-password.module.mjs +0 -34
  153. package/esm2022/lib/components/mail/mail.component.mjs +0 -69
  154. package/esm2022/lib/components/mail/mail.module.mjs +0 -21
  155. package/esm2022/lib/components/mail-validation/mail-validation.component.mjs +0 -108
  156. package/esm2022/lib/components/mail-validation/mail-validation.module.mjs +0 -34
  157. package/esm2022/lib/components/o-auth/o-auth.component.mjs +0 -25
  158. package/esm2022/lib/components/o-auth/o-auth.module.mjs +0 -19
  159. package/esm2022/lib/components/otp-input/otp-input.component.mjs +0 -75
  160. package/esm2022/lib/components/otp-input/otp-input.module.mjs +0 -23
  161. package/esm2022/lib/components/reset-password/ResetPasswordData.mjs +0 -2
  162. package/esm2022/lib/components/reset-password/reset-password.component.mjs +0 -107
  163. package/esm2022/lib/components/reset-password/reset-password.module.mjs +0 -34
  164. package/esm2022/lib/components/sign-in/sign-in.component.mjs +0 -214
  165. package/esm2022/lib/components/sign-in/sign-in.module.mjs +0 -24
  166. package/esm2022/lib/components/sign-up/sign-up.component.mjs +0 -223
  167. package/esm2022/lib/components/sign-up/sign-up.module.mjs +0 -24
  168. package/esm2022/lib/components/sso/base-table-style.mjs +0 -53
  169. package/esm2022/lib/components/sso/helper.mjs +0 -14
  170. package/esm2022/lib/components/sso/sso-form/sso-form.component.mjs +0 -74
  171. package/esm2022/lib/components/sso/sso.columns.mjs +0 -29
  172. package/esm2022/lib/components/sso/sso.component.mjs +0 -197
  173. package/esm2022/lib/components/sso/sso.module.mjs +0 -63
  174. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.mjs +0 -201
  175. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.mjs +0 -22
  176. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.mjs +0 -90
  177. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.mjs +0 -19
  178. package/esm2022/lib/components/user-management/base-table-style.mjs +0 -53
  179. package/esm2022/lib/components/user-management/helper.mjs +0 -26
  180. package/esm2022/lib/components/user-management/useer-management.module.mjs +0 -68
  181. package/esm2022/lib/components/user-management/user-management-form/use-management-form.component.mjs +0 -57
  182. package/esm2022/lib/components/user-management/user-management.columns.mjs +0 -43
  183. package/esm2022/lib/components/user-management/user-management.component.mjs +0 -323
  184. package/esm2022/lib/components/user-request/user-request.component.mjs +0 -180
  185. package/esm2022/lib/components/user-request/user-request.module.mjs +0 -34
  186. package/esm2022/lib/components/user-request-approval/access-request.columns.mjs +0 -24
  187. package/esm2022/lib/components/user-request-approval/base-table-style.mjs +0 -53
  188. package/esm2022/lib/components/user-request-approval/facades/user-access-request.facade.mjs +0 -128
  189. package/esm2022/lib/components/user-request-approval/helper.mjs +0 -35
  190. package/esm2022/lib/components/user-request-approval/services/user-access-request.service.mjs +0 -72
  191. package/esm2022/lib/components/user-request-approval/states/user-access-request.state.mjs +0 -59
  192. package/esm2022/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.mjs +0 -26
  193. package/esm2022/lib/components/user-request-approval/user-request-approval.component.mjs +0 -251
  194. package/esm2022/lib/components/user-request-approval/user-request-approval.module.mjs +0 -77
  195. package/esm2022/lib/components/user-request-approval/user-request-approval.service.mjs +0 -32
  196. package/esm2022/lib/components/user-request-approval/user-request-form/use-request-form.component.mjs +0 -64
  197. package/esm2022/lib/models/ErrorResponse.mjs +0 -11
  198. package/esm2022/lib/models/PasswordRequestParam.mjs +0 -2
  199. package/esm2022/lib/models/ResponseKeyValue.mjs +0 -2
  200. package/esm2022/lib/models/UserRequest.mjs +0 -2
  201. package/esm2022/lib/models/base.mjs +0 -2
  202. package/esm2022/lib/models/log-in.mjs +0 -2
  203. package/esm2022/lib/models/mainUser.mjs +0 -2
  204. package/esm2022/lib/models/object-state.mjs +0 -8
  205. package/esm2022/lib/models/otpValue.mjs +0 -2
  206. package/esm2022/lib/models/paged.mjs +0 -2
  207. package/esm2022/lib/models/query-params.mjs +0 -2
  208. package/esm2022/lib/models/request-status.mjs +0 -5
  209. package/esm2022/lib/models/sign-up.mjs +0 -2
  210. package/esm2022/lib/models/single-sign-on.mjs +0 -2
  211. package/esm2022/lib/models/status.mjs +0 -6
  212. package/esm2022/lib/models/user-access-request-status.mjs +0 -7
  213. package/esm2022/lib/models/user-access-request.mjs +0 -2
  214. package/esm2022/lib/models/user.mjs +0 -2
  215. package/esm2022/lib/services/environment.service.mjs +0 -26
  216. package/esm2022/lib/services/http-web-request.service.mjs +0 -83
  217. package/esm2022/lib/services/util.service.mjs +0 -32
  218. package/esm2022/public-api.mjs +0 -43
  219. package/esm2022/verben-authentication-ui.mjs +0 -5
  220. package/fesm2022/verben-authentication-ui.mjs +0 -3481
  221. package/fesm2022/verben-authentication-ui.mjs.map +0 -1
  222. package/index.d.ts +0 -5
  223. package/lib/components/button/button.component.d.ts +0 -17
  224. package/lib/components/button/button.module.d.ts +0 -10
  225. package/lib/components/forgot-password/forgot-password.component.d.ts +0 -28
  226. package/lib/components/forgot-password/forgot-password.module.d.ts +0 -10
  227. package/lib/components/mail/mail.component.d.ts +0 -32
  228. package/lib/components/mail/mail.module.d.ts +0 -11
  229. package/lib/components/mail-validation/mail-validation.component.d.ts +0 -42
  230. package/lib/components/mail-validation/mail-validation.module.d.ts +0 -10
  231. package/lib/components/o-auth/o-auth.component.d.ts +0 -10
  232. package/lib/components/o-auth/o-auth.module.d.ts +0 -9
  233. package/lib/components/otp-input/otp-input.component.d.ts +0 -20
  234. package/lib/components/otp-input/otp-input.module.d.ts +0 -13
  235. package/lib/components/reset-password/ResetPasswordData.d.ts +0 -5
  236. package/lib/components/reset-password/reset-password.component.d.ts +0 -30
  237. package/lib/components/reset-password/reset-password.module.d.ts +0 -10
  238. package/lib/components/sign-in/sign-in.component.d.ts +0 -77
  239. package/lib/components/sign-in/sign-in.module.d.ts +0 -13
  240. package/lib/components/sign-up/sign-up.component.d.ts +0 -66
  241. package/lib/components/sign-up/sign-up.module.d.ts +0 -13
  242. package/lib/components/sso/base-table-style.d.ts +0 -1
  243. package/lib/components/sso/helper.d.ts +0 -2
  244. package/lib/components/sso/sso-form/sso-form.component.d.ts +0 -21
  245. package/lib/components/sso/sso.columns.d.ts +0 -3
  246. package/lib/components/sso/sso.component.d.ts +0 -50
  247. package/lib/components/sso/sso.module.d.ts +0 -11
  248. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.d.ts +0 -65
  249. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.d.ts +0 -12
  250. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.d.ts +0 -39
  251. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.d.ts +0 -9
  252. package/lib/components/user-management/base-table-style.d.ts +0 -1
  253. package/lib/components/user-management/helper.d.ts +0 -2
  254. package/lib/components/user-management/useer-management.module.d.ts +0 -11
  255. package/lib/components/user-management/user-management-form/use-management-form.component.d.ts +0 -20
  256. package/lib/components/user-management/user-management.columns.d.ts +0 -3
  257. package/lib/components/user-management/user-management.component.d.ts +0 -60
  258. package/lib/components/user-request/user-request.component.d.ts +0 -56
  259. package/lib/components/user-request/user-request.module.d.ts +0 -10
  260. package/lib/components/user-request-approval/access-request.columns.d.ts +0 -3
  261. package/lib/components/user-request-approval/base-table-style.d.ts +0 -1
  262. package/lib/components/user-request-approval/facades/user-access-request.facade.d.ts +0 -23
  263. package/lib/components/user-request-approval/helper.d.ts +0 -6
  264. package/lib/components/user-request-approval/services/user-access-request.service.d.ts +0 -50
  265. package/lib/components/user-request-approval/states/user-access-request.state.d.ts +0 -21
  266. package/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.d.ts +0 -12
  267. package/lib/components/user-request-approval/user-request-approval.component.d.ts +0 -59
  268. package/lib/components/user-request-approval/user-request-approval.module.d.ts +0 -12
  269. package/lib/components/user-request-approval/user-request-approval.service.d.ts +0 -18
  270. package/lib/components/user-request-approval/user-request-form/use-request-form.component.d.ts +0 -21
  271. package/lib/models/ErrorResponse.d.ts +0 -6
  272. package/lib/models/PasswordRequestParam.d.ts +0 -5
  273. package/lib/models/ResponseKeyValue.d.ts +0 -5
  274. package/lib/models/UserRequest.d.ts +0 -24
  275. package/lib/models/base.d.ts +0 -10
  276. package/lib/models/log-in.d.ts +0 -7
  277. package/lib/models/object-state.d.ts +0 -6
  278. package/lib/models/paged.d.ts +0 -9
  279. package/lib/models/query-params.d.ts +0 -7
  280. package/lib/models/request-status.d.ts +0 -3
  281. package/lib/models/sign-up.d.ts +0 -9
  282. package/lib/models/single-sign-on.d.ts +0 -7
  283. package/lib/models/status.d.ts +0 -4
  284. package/lib/models/user-access-request-status.d.ts +0 -5
  285. package/lib/models/user.d.ts +0 -23
  286. package/lib/services/environment.service.d.ts +0 -16
  287. package/lib/services/http-web-request.service.d.ts +0 -23
  288. package/lib/services/util.service.d.ts +0 -8
@@ -0,0 +1,301 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ ChangeDetectorRef,
4
+ Component,
5
+ computed,
6
+ OnInit,
7
+ Signal,
8
+ signal,
9
+ ViewChild,
10
+ WritableSignal,
11
+ } from '@angular/core';
12
+ import { columns } from './access-request.columns';
13
+ import { mockData } from './helper';
14
+ import { baseStyle } from './base-table-style';
15
+ import { UserAccessRequest } from '../../models/user-access-request';
16
+ import {
17
+ CardData,
18
+ CardDataViewComponent,
19
+ ColumnDefinition,
20
+ DataFilterType,
21
+ DataViewComponent,
22
+ IDataFilter,
23
+ } from 'verben-ng-ui';
24
+ import { UserRequestApprovalService } from './user-request-approval.service';
25
+ import { UserAccessRequestFacade } from './facades/user-access-request.facade';
26
+
27
+ interface UserFormData {
28
+ MailAddress: string;
29
+ Name: string;
30
+ PhoneNumber: string;
31
+ }
32
+
33
+ @Component({
34
+ selector: 'lib-user-request-approval',
35
+ templateUrl: './user-request-approval.component.html',
36
+ styleUrl: './user-request-approval.component.css',
37
+ // changeDetection: ChangeDetectionStrategy.OnPush,
38
+ })
39
+ export class UserRequestApprovalComponent implements OnInit {
40
+ @ViewChild('vdcv') cardDataView!: CardDataViewComponent;
41
+ @ViewChild('vdv') dataView!: DataViewComponent;
42
+
43
+ columns: ColumnDefinition<UserAccessRequest>[] = columns;
44
+ // visibleColumnDef: WritableSignal<ColumnDefinition<UserAccessRequest>[]> =
45
+ // signal(columns);
46
+ visibleColumnDef = this.columns;
47
+ data: WritableSignal<UserAccessRequest[]> = signal([]);
48
+ styles = baseStyle;
49
+ currentData: CardData | null = null;
50
+ isGridView = true;
51
+ selected: CardData | null = null;
52
+
53
+ cardData: Signal<CardData[]> = computed(() =>
54
+ this.data()?.map(
55
+ ({
56
+ FirstName,
57
+ LastName,
58
+ MailAddress,
59
+ PhoneNumber,
60
+ RoleID,
61
+ RequestStatus,
62
+ }) => ({
63
+ selected: false,
64
+ title: `${FirstName} ${LastName}`,
65
+ data: {
66
+ FirstName,
67
+ LastName,
68
+ MailAddress,
69
+ PhoneNumber,
70
+ RoleID,
71
+ RequestStatus,
72
+ } as Partial<UserAccessRequest>,
73
+ body: [
74
+ { title: 'Name', value: `${FirstName} ${LastName}` },
75
+ { title: 'E-Mail Address', value: MailAddress },
76
+ { title: 'Phone Number', value: PhoneNumber ?? '' },
77
+ ],
78
+ children: [],
79
+ })
80
+ )
81
+ );
82
+
83
+ constructor(
84
+ private cdr: ChangeDetectorRef,
85
+ // private service: UserRequestApprovalService,
86
+ private userAccessRequestFacade: UserAccessRequestFacade
87
+ ) {}
88
+
89
+ async ngOnInit() {
90
+ // this.data = this.service.getMockUserRequests();
91
+ this.userAccessRequestFacade.getRequests$().subscribe((data) => {
92
+ this.data.set(data);
93
+ });
94
+
95
+ try {
96
+ await this.userAccessRequestFacade.loadRequests();
97
+ } catch (error) {
98
+ // Handle error
99
+ }
100
+ }
101
+
102
+ // To search with parameter:
103
+ async searchRequests(param: string) {
104
+ try {
105
+ await this.userAccessRequestFacade.loadRequestsWithParam(param);
106
+ } catch (error) {
107
+ // Handle error
108
+ }
109
+ }
110
+
111
+ async onApprove(mailAddress: string) {
112
+ const data = this.data().find(
113
+ ({ MailAddress }) => MailAddress === mailAddress
114
+ );
115
+
116
+ if (data) {
117
+ await this.userAccessRequestFacade.approveRequest(data);
118
+ }
119
+ }
120
+
121
+ openDetailView(mailAddress: string) {
122
+ const cardItem = this.getCardDataByMailAddress(mailAddress);
123
+ if (cardItem && this.cardDataView) {
124
+ this.dataView.toggleView();
125
+ // First reset all selections
126
+ this.cardData().forEach((item) => {
127
+ item.selected = false;
128
+ if (item.children) {
129
+ item.children.forEach((child) => (child.selected = false));
130
+ }
131
+ });
132
+
133
+ // Set the selected item
134
+ cardItem.selected = true;
135
+ this.currentData = this.cardDataView.onItemClick(cardItem);
136
+
137
+ // Force change detection if needed
138
+ // this.changeDetectorRef.detectChanges();
139
+ }
140
+ }
141
+
142
+ getCardDataByMailAddress(mailAddress: string): CardData | undefined {
143
+ return this.cardData().find(({ data }) => data.MailAddress === mailAddress);
144
+ }
145
+
146
+ onViewChange(isGridView: boolean): void {
147
+ this.isGridView = isGridView;
148
+ // Reset selection when switching views
149
+ if (this.currentData) {
150
+ this.cardDataView?.clearData();
151
+ this.currentData = null;
152
+ }
153
+
154
+ console.log('SELECTED', this.selected);
155
+
156
+ if (this.selected) {
157
+ this.cardDataView.onItemClick(this.selected);
158
+ }
159
+ }
160
+
161
+ openFormView(index: number) {
162
+ const item = this.cardData()[index];
163
+ console.log('ITEM = ', item);
164
+ }
165
+
166
+ handleExport(exportedData: Partial<any>[]) {
167
+ console.log('Exported data:', exportedData);
168
+ this.downloadCSV(exportedData);
169
+ }
170
+
171
+ /**
172
+ *
173
+ * @param data Simple csv export for testing
174
+ */
175
+ private downloadCSV(data: Partial<any>[]) {
176
+ const headers = Object.keys(data[0]);
177
+ const csvContent = [
178
+ headers.join(','),
179
+ ...data.map((row) => headers.map((header) => row[header]).join(',')),
180
+ ].join('\n');
181
+
182
+ const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
183
+ const link = document.createElement('a');
184
+ if (link.download !== undefined) {
185
+ const url = URL.createObjectURL(blob);
186
+ link.setAttribute('href', url);
187
+ link.setAttribute('download', 'export.csv');
188
+ link.style.visibility = 'hidden';
189
+ document.body.appendChild(link);
190
+ link.click();
191
+ document.body.removeChild(link);
192
+ }
193
+ }
194
+
195
+ onSelectionChange(selectedRows: UserAccessRequest[]) {
196
+ console.log('Selection changed:', selectedRows);
197
+ // Handle the selection change
198
+ }
199
+
200
+ /**
201
+ * Copied over from card view doc until I understand usage
202
+ */
203
+ selectedColumnCount: number = 0;
204
+ selectedFilterTableCount: number = 0;
205
+ isOPen: boolean = true;
206
+ selectedSortCount: number = 0;
207
+ showColumn: boolean = false;
208
+ showSort: boolean = false;
209
+ selectedAll: boolean = false;
210
+ visibleColumns: IDataFilter[] = columns.map((col) => ({
211
+ checked: true,
212
+ name: typeof col.header === 'string' ? col.header : col.id,
213
+ type: DataFilterType.Bool,
214
+ }));
215
+ filterArray: IDataFilter[] = [
216
+ {
217
+ name: 'Name',
218
+ type: DataFilterType.String,
219
+ checked: false,
220
+ },
221
+ {
222
+ name: 'MailAddress',
223
+ type: DataFilterType.String,
224
+ checked: false,
225
+ },
226
+ {
227
+ name: 'PhoneNumber',
228
+ type: DataFilterType.String,
229
+ checked: false,
230
+ },
231
+ {
232
+ name: 'CreatedAt',
233
+ type: DataFilterType.Date,
234
+ checked: false,
235
+ },
236
+ ];
237
+
238
+ sortOptions: IDataFilter[] = [
239
+ {
240
+ name: 'Name',
241
+ type: DataFilterType.String,
242
+ checked: false,
243
+ },
244
+ {
245
+ name: 'MailAddress',
246
+ type: DataFilterType.String,
247
+ checked: false,
248
+ },
249
+ {
250
+ name: 'PhoneNumber',
251
+ type: DataFilterType.String,
252
+ checked: false,
253
+ },
254
+ {
255
+ name: 'CreatedAt',
256
+ type: DataFilterType.Date,
257
+ checked: false,
258
+ },
259
+ ];
260
+ clearData() {
261
+ this.currentData = {} as CardData;
262
+ }
263
+ loadMore() {
264
+ // this.cardData = this.cardData.concat(this.cardData);
265
+ }
266
+ onColumnChange(event: boolean) {
267
+ this.showColumn = event;
268
+ }
269
+ onSortChange(event: boolean) {
270
+ this.showSort = event;
271
+ console.log(event);
272
+ }
273
+ onColumnsUpdated(updatedColumns: IDataFilter[]) {
274
+ console.log(updatedColumns);
275
+ const updatedColumnDef: ColumnDefinition<UserAccessRequest>[] = [];
276
+ updatedColumns.forEach((col) => {
277
+ const matchingCol = this.columns.find(
278
+ (column) => column.header === col.name || column.id === col.name
279
+ );
280
+ if (matchingCol) {
281
+ updatedColumnDef.push(matchingCol);
282
+ }
283
+ });
284
+
285
+ console.log(updatedColumnDef);
286
+ this.visibleColumnDef = [...updatedColumnDef];
287
+ this.cdr.markForCheck();
288
+
289
+ this.onColumnChange(false);
290
+ this.selectedColumnCount = updatedColumns.length;
291
+ }
292
+ onSortUpdated(updatedSorts: IDataFilter[]) {
293
+ this.onSortChange(false);
294
+ this.selectedSortCount = updatedSorts.length;
295
+ console.log(updatedSorts);
296
+ }
297
+
298
+ onStateChange(event: { key: string; value: boolean }): void {
299
+ console.log(`State changed for ${event.key}:`, event.value);
300
+ }
301
+ }
@@ -0,0 +1,52 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { UserRequestApprovalComponent } from './user-request-approval.component';
4
+ import {
5
+ CardDataViewModule,
6
+ CardModule,
7
+ DataExportModule,
8
+ DataTableModule,
9
+ DataViewModule,
10
+ DropDownModule,
11
+ SortTableModule,
12
+ SvgModule,
13
+ TableFilterModule,
14
+ VerbenaBadgeModule,
15
+ VerbenaButtonModule,
16
+ VerbenaInputModule,
17
+ VisibleColumnModule,
18
+ } from 'verben-ng-ui';
19
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
20
+ import { UserRequestFormComponent } from './user-request-form/use-request-form.component';
21
+ import { UserAccessRequestStatusBadgeComponent } from './user-access-request-status-badge/user-access-request-status-badge.component';
22
+ import { UserRequestApprovalService } from './user-request-approval.service';
23
+
24
+ @NgModule({
25
+ declarations: [
26
+ UserRequestApprovalComponent,
27
+ UserRequestFormComponent,
28
+ UserAccessRequestStatusBadgeComponent,
29
+ ],
30
+ imports: [
31
+ CommonModule,
32
+
33
+ DataTableModule,
34
+ CardModule,
35
+ SvgModule,
36
+ DataViewModule,
37
+ CardDataViewModule,
38
+ SortTableModule,
39
+ VisibleColumnModule,
40
+ TableFilterModule,
41
+ DataExportModule,
42
+ FormsModule,
43
+ ReactiveFormsModule,
44
+ VerbenaInputModule,
45
+ VerbenaButtonModule,
46
+ VerbenaBadgeModule,
47
+ DropDownModule,
48
+ ],
49
+ providers: [UserRequestApprovalService],
50
+ exports: [UserRequestApprovalComponent],
51
+ })
52
+ export class LibUserRequestApprovalModule {}
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { UserRequestApprovalService } from './user-request-approval.service';
4
+
5
+ describe('UserRequestApprovalService', () => {
6
+ let service: UserRequestApprovalService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(UserRequestApprovalService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,58 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Inject, Injectable, InjectionToken } from '@angular/core';
3
+ import { UserAccessRequest } from '../../models/user-access-request';
4
+ import { UserAccessRequestStatus } from '../../models/user-access-request-status';
5
+ import { ObjectState } from '../../models/object-state';
6
+ import { mockData } from './helper';
7
+
8
+ export interface ServiceConfig {
9
+ resourceEndpoint: string;
10
+ }
11
+
12
+ export const SERVICE_CONFIG = new InjectionToken<ServiceConfig>(
13
+ 'ServiceConfig'
14
+ );
15
+
16
+ @Injectable()
17
+ export class UserRequestApprovalService {
18
+ // protected readonly baseUrl: string;
19
+ protected readonly resourceEndpoint: string;
20
+ roles: { id: string; name: string }[] = [
21
+ { id: 'admin', name: 'Admin' },
22
+ { id: 'manager', name: 'Manager' },
23
+ { id: 'staff', name: 'Staff' },
24
+ ];
25
+
26
+ constructor() { // @Inject(SERVICE_CONFIG) config: ServiceConfig // protected httpClient: HttpClient,
27
+ // this.baseUrl = environment.serviceUrl;
28
+ // this.resourceEndpoint = config.resourceEndpoint;
29
+ this.resourceEndpoint = '';
30
+ }
31
+
32
+ getMockUserRequests(): UserAccessRequest[] {
33
+ return mockData;
34
+ }
35
+
36
+ // getUserRequests() {
37
+ // return this.httpClient.get<UserAccessRequest[]>(`${this.resourceEndpoint}`);
38
+ // }
39
+
40
+ // getUserRequestById(id: number) {
41
+ // return this.httpClient.get<UserAccessRequest>(
42
+ // `${this.resourceEndpoint}/${id}`
43
+ // );
44
+ // }
45
+
46
+ // processUserReuqests(ids: string[], approval: boolean = true) {
47
+ // return this.httpClient.post<UserAccessRequest[]>(
48
+ // `${this.resourceEndpoint}`,
49
+ // ids
50
+ // );
51
+ // }
52
+ }
53
+
54
+ function randomEnum<T extends object>(anEnum: T): T[keyof T] {
55
+ const enumValues = Object.values(anEnum) as unknown as T[keyof T][];
56
+ const randomIndex = Math.floor(Math.random() * enumValues.length);
57
+ return enumValues[randomIndex];
58
+ }
@@ -0,0 +1,66 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { FormBuilder, FormGroup } from '@angular/forms';
3
+ import { CardData } from 'verben-ng-ui';
4
+
5
+ interface UserFormData {
6
+ MailAddress: string;
7
+ Name: string;
8
+ PhoneNumber: string;
9
+ }
10
+
11
+ @Component({
12
+ selector: 'lib-user-request-form',
13
+ templateUrl: './user-request-form.component.html',
14
+ styleUrl: './user-request-form.component.css',
15
+ })
16
+ export class UserRequestFormComponent {
17
+ @Input() set currentData(value: CardData | null) {
18
+ if (value?.data) {
19
+ this.form.patchValue({
20
+ MailAddress: value.data.MailAddress || '',
21
+ FirstName: value.data.FirstName || '',
22
+ LastName: value.data.LastName || '',
23
+ OtherName: value.data.OtherName || '',
24
+ PhoneNumber: value.data.PhoneNumber || '',
25
+ });
26
+ } else {
27
+ this.form.reset();
28
+ }
29
+ }
30
+
31
+ @Output() switchView = new EventEmitter<undefined>();
32
+ @Output() onApproval = new EventEmitter<string>();
33
+
34
+ form: FormGroup;
35
+
36
+ roles: { id: string; name: string }[] = [
37
+ { id: 'admin', name: 'Admin' },
38
+ { id: 'manager', name: 'Manager' },
39
+ { id: 'staff', name: 'Staff' },
40
+ ];
41
+
42
+ constructor(private fb: FormBuilder) {
43
+ this.form = this.fb.group({
44
+ MailAddress: ['', { readonly: true }],
45
+ FirstName: ['', { readonly: true }],
46
+ LastName: ['', { readonly: true }],
47
+ OtherName: ['', { readonly: true }],
48
+ PhoneNumber: ['', { readonly: true }],
49
+ RoleId: [''],
50
+ });
51
+ }
52
+
53
+ ngOnInit(): void {}
54
+
55
+ onSave(): void {
56
+ if (this.form.valid) {
57
+ // Emit save event with form value
58
+ console.log('Form saved:', this.form.value);
59
+ }
60
+ }
61
+
62
+ onDelete(): void {
63
+ // Emit delete event
64
+ console.log('Delete requested');
65
+ }
66
+ }
@@ -0,0 +1,97 @@
1
+ <form
2
+ [formGroup]="form"
3
+ class="flex flex-col px-3 pb-3 rounded-xl h-full w-full relative space-y-4"
4
+ >
5
+ <verbena-input
6
+ name="MailAddress"
7
+ label="Mail Address:"
8
+ formControlName="MailAddress"
9
+ />
10
+ <verbena-input
11
+ label="First Name:"
12
+ name="FirstName"
13
+ type="text"
14
+ formControlName="FirstName"
15
+ />
16
+ <verbena-input
17
+ label="Last Name:"
18
+ name="LastName"
19
+ type="text"
20
+ formControlName="LastName"
21
+ />
22
+ <verbena-input
23
+ label="OtherName:"
24
+ name="OtherName"
25
+ type="text"
26
+ formControlName="OtherName"
27
+ />
28
+ <verbena-input
29
+ label="Phone Number:"
30
+ name="PhoneNumber"
31
+ type="tel"
32
+ formControlName="PhoneNumber"
33
+ />
34
+
35
+ <div class="space-y-1">
36
+ <label for="role">Role</label>
37
+
38
+ <verben-drop-down
39
+ label="Role"
40
+ styleClass="w-full"
41
+ width="100%"
42
+ [multiselect]="false"
43
+ [filter]="true"
44
+ [showClear]="true"
45
+ placeholder=""
46
+ [(options)]="roles"
47
+ id="role"
48
+ optionLabel="name"
49
+ optionValue="id"
50
+ formControlName="RoleId"
51
+ class="form-control"
52
+ >
53
+ </verben-drop-down>
54
+ </div>
55
+
56
+ <!-- buttons -->
57
+ <div class="flex justify-between bottom-8 left-0 right-0 px-3 pb-2">
58
+ <!-- <verbena-button
59
+ text="Delete"
60
+ class="bg-secondary-200 text-[black]"
61
+ (click)="onDelete()"
62
+ />
63
+ <verbena-button
64
+ text="Save"
65
+ class="bg-primary text-[black]"
66
+ (click)="onSave()"
67
+ />
68
+
69
+ <verbena-button
70
+ text="Secondary Button"
71
+ styleType="secondary"
72
+ ></verbena-button> -->
73
+ <verbena-button
74
+ width="114px"
75
+ height="39px"
76
+ text="Reject"
77
+ styleType="danger"
78
+ borderRadius="10px"
79
+ ></verbena-button>
80
+ <verbena-button
81
+ (click)="switchView.emit()"
82
+ text="Switch To Table"
83
+ styleType="ylw-outline"
84
+ ></verbena-button>
85
+ <verbena-button
86
+ (click)="onApproval.emit(form.get('MailAddress')?.value)"
87
+ text="Approve"
88
+ bgColor="#28a745"
89
+ textColor="white"
90
+ border="1px solid #28a745"
91
+ borderRadius="10px"
92
+ pd="10px 20px"
93
+ width="114px"
94
+ height="39px"
95
+ ></verbena-button>
96
+ </div>
97
+ </form>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { UserRequestFormComponent } from './use-request-form.component';
4
+
5
+ describe('UserRequestFormComponent', () => {
6
+ let component: UserRequestFormComponent;
7
+ let fixture: ComponentFixture<UserRequestFormComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [UserRequestFormComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(UserRequestFormComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,7 @@
1
+ export class ErrorResponse {
2
+ constructor(
3
+ public ErrorMsg: string,
4
+ public StatusCode?: number,
5
+ public FullLog?: any
6
+ ) {}
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface PasswordRequestParam {
2
+ OldPassword?: string;
3
+ NewPassword: string;
4
+ Token?: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface ResponseKeyValue {
2
+ Key: string;
3
+ Value: string;
4
+ OtherInfo?: string;
5
+ }
@@ -0,0 +1,28 @@
1
+ import { ObjectState } from "./object-state";
2
+ import { RequestStatus } from "./request-status";
3
+ import { Status } from "./status";
4
+
5
+
6
+
7
+ export interface UserRequestPayload {
8
+ Code:string;
9
+ FirstName:string;
10
+ LastName:string;
11
+ MailAddress:string;
12
+ Password:string;
13
+ PhoneNumber:string;
14
+ OtherName:string;
15
+ Role: string[];
16
+ Tags: [];
17
+ Status: Status;
18
+ UpdatedAt: Date;
19
+ CreatedAt: Date;
20
+ Id:string;
21
+ DataState: ObjectState;
22
+ TenantId: string;
23
+ ServiceName:string;
24
+ ActionBy:string;
25
+ RequestStatus:RequestStatus
26
+ Comment:string;
27
+ }
28
+
@@ -0,0 +1,14 @@
1
+ export enum MechanismType {
2
+ InApp = 'InApp',
3
+ Google = 'Google',
4
+ Apple = 'Apple',
5
+ MicrosoftAD = 'MicrosoftAD',
6
+ }
7
+
8
+ export interface AuthMechanism {
9
+ AuthMechanism: string;
10
+ ClientId: string;
11
+ ClientSecret: string;
12
+ RedirectUri: string;
13
+ Scope: string;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { ObjectState } from './object-state';
2
+
3
+ export interface BaseModel {
4
+ id: string | number;
5
+ Id: string;
6
+ CreatedAt: Date;
7
+ UpdatedAt: Date;
8
+ DataState: ObjectState;
9
+ Tenant: string;
10
+ readonly Error?: string;
11
+ }