verben-authentication-ui 1.0.1 → 1.0.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 (434) hide show
  1. package/ng-package.json +8 -0
  2. package/package.json +10 -15
  3. package/src/lib/base/base-data.component.ts +86 -0
  4. package/src/lib/base/base-data.facade.ts +157 -0
  5. package/src/lib/base/base-data.service.ts +49 -0
  6. package/src/lib/base/base-data.state.ts +94 -0
  7. package/src/lib/base/models.ts +14 -0
  8. package/src/lib/components/auth-callback/auth-callback.component.css +30 -0
  9. package/src/lib/components/auth-callback/auth-callback.component.html +6 -0
  10. package/src/lib/components/auth-callback/auth-callback.component.spec.ts +23 -0
  11. package/src/lib/components/auth-callback/auth-callback.component.ts +56 -0
  12. package/src/lib/components/auth-callback/auth-callback.module.ts +10 -0
  13. package/src/lib/components/button/button.component.css +3 -0
  14. package/src/lib/components/button/button.component.html +13 -0
  15. package/src/lib/components/button/button.component.spec.ts +23 -0
  16. package/src/lib/components/button/button.component.ts +24 -0
  17. package/src/lib/components/button/button.module.ts +11 -0
  18. package/{lib/components/forgot-password/ForgotPasswordData.d.ts → src/lib/components/forgot-password/ForgotPasswordData.ts} +1 -1
  19. package/src/lib/components/forgot-password/forgot-password.component.css +46 -0
  20. package/src/lib/components/forgot-password/forgot-password.component.html +19 -0
  21. package/src/lib/components/forgot-password/forgot-password.component.spec.ts +23 -0
  22. package/src/lib/components/forgot-password/forgot-password.component.ts +88 -0
  23. package/src/lib/components/forgot-password/forgot-password.module.ts +18 -0
  24. package/src/lib/components/mail/mail.component.css +0 -0
  25. package/src/lib/components/mail/mail.component.html +11 -0
  26. package/src/lib/components/mail/mail.component.spec.ts +23 -0
  27. package/src/lib/components/mail/mail.component.ts +47 -0
  28. package/src/lib/components/mail/mail.module.ts +13 -0
  29. package/src/lib/components/mail-validation/mail-validation.component.css +59 -0
  30. package/src/lib/components/mail-validation/mail-validation.component.html +37 -0
  31. package/src/lib/components/mail-validation/mail-validation.component.spec.ts +23 -0
  32. package/src/lib/components/mail-validation/mail-validation.component.ts +66 -0
  33. package/src/lib/components/mail-validation/mail-validation.module.ts +18 -0
  34. package/src/lib/components/o-auth/o-auth.component.css +26 -0
  35. package/src/lib/components/o-auth/o-auth.component.html +26 -0
  36. package/src/lib/components/o-auth/o-auth.component.spec.ts +23 -0
  37. package/src/lib/components/o-auth/o-auth.component.ts +115 -0
  38. package/src/lib/components/o-auth/o-auth.module.ts +11 -0
  39. package/src/lib/components/otp-input/otp-input.component.css +19 -0
  40. package/src/lib/components/otp-input/otp-input.component.html +15 -0
  41. package/src/lib/components/otp-input/otp-input.component.spec.ts +23 -0
  42. package/src/lib/components/otp-input/otp-input.component.ts +88 -0
  43. package/src/lib/components/otp-input/otp-input.module.ts +15 -0
  44. package/src/lib/components/reset-password/ResetPasswordData.ts +5 -0
  45. package/src/lib/components/reset-password/reset-password.component.css +29 -0
  46. package/src/lib/components/reset-password/reset-password.component.html +24 -0
  47. package/src/lib/components/reset-password/reset-password.component.spec.ts +23 -0
  48. package/src/lib/components/reset-password/reset-password.component.ts +108 -0
  49. package/src/lib/components/reset-password/reset-password.module.ts +18 -0
  50. package/src/lib/components/role-control/ChildrenType.ts +4 -0
  51. package/{lib/components/role-control/MappedRole.d.ts → src/lib/components/role-control/MappedRole.ts} +3 -2
  52. package/{lib/components/role-control/MappedRoleAction.d.ts → src/lib/components/role-control/MappedRoleAction.ts} +2 -1
  53. package/{lib/components/role-control/MappedRoleContext.d.ts → src/lib/components/role-control/MappedRoleContext.ts} +4 -3
  54. package/src/lib/components/role-control/UIActions.ts +5 -0
  55. package/src/lib/components/role-control/UIs.ts +38 -0
  56. package/src/lib/components/role-control/base-table-style.ts +52 -0
  57. package/src/lib/components/role-control/role-control.component.css +55 -0
  58. package/src/lib/components/role-control/role-control.component.html +571 -0
  59. package/src/lib/components/role-control/role-control.component.spec.ts +23 -0
  60. package/src/lib/components/role-control/role-control.component.ts +1817 -0
  61. package/src/lib/components/role-control/role-control.module.ts +10 -0
  62. package/src/lib/components/role-control/role-control.service.spec.ts +16 -0
  63. package/src/lib/components/role-control/role-control.service.ts +53 -0
  64. package/src/lib/components/sign-in/sign-in.component.css +21 -0
  65. package/src/lib/components/sign-in/sign-in.component.html +83 -0
  66. package/src/lib/components/sign-in/sign-in.component.spec.ts +23 -0
  67. package/src/lib/components/sign-in/sign-in.component.ts +267 -0
  68. package/src/lib/components/sign-in/sign-in.module.ts +17 -0
  69. package/src/lib/components/sign-up/sign-up.component.css +36 -0
  70. package/src/lib/components/sign-up/sign-up.component.html +132 -0
  71. package/src/lib/components/sign-up/sign-up.component.spec.ts +23 -0
  72. package/src/lib/components/sign-up/sign-up.component.ts +180 -0
  73. package/src/lib/components/sign-up/sign-up.module.ts +15 -0
  74. package/src/lib/components/sso/base-table-style.ts +52 -0
  75. package/src/lib/components/sso/helper.ts +17 -0
  76. package/src/lib/components/sso/sso-form/sso-form.component.css +13 -0
  77. package/src/lib/components/sso/sso-form/sso-form.component.html +109 -0
  78. package/src/lib/components/sso/sso-form/sso-form.component.spec.ts +23 -0
  79. package/src/lib/components/sso/sso-form/sso-form.component.ts +70 -0
  80. package/src/lib/components/sso/sso.columns.ts +32 -0
  81. package/src/lib/components/sso/sso.component.css +47 -0
  82. package/src/lib/components/sso/sso.component.html +208 -0
  83. package/src/lib/components/sso/sso.component.spec.ts +23 -0
  84. package/src/lib/components/sso/sso.component.ts +261 -0
  85. package/src/lib/components/sso/sso.module.ts +40 -0
  86. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.css +8 -0
  87. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.html +30 -0
  88. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.spec.ts +23 -0
  89. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.ts +155 -0
  90. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.ts +15 -0
  91. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.css +17 -0
  92. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.html +45 -0
  93. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.spec.ts +23 -0
  94. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.ts +57 -0
  95. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.ts +11 -0
  96. package/src/lib/components/user-management/base-table-style.ts +52 -0
  97. package/src/lib/components/user-management/facades/user-management.facades.ts +133 -0
  98. package/src/lib/components/user-management/helper.ts +38 -0
  99. package/src/lib/components/user-management/index.ts +4 -0
  100. package/src/lib/components/user-management/services/user-management.service.spec.ts +16 -0
  101. package/src/lib/components/user-management/services/user-management.service.ts +111 -0
  102. package/src/lib/components/user-management/states/user-management.state.ts +65 -0
  103. package/src/lib/components/user-management/user-management-form/use-management-form.component.ts +73 -0
  104. package/src/lib/components/user-management/user-management-form/user-management-form.component.css +0 -0
  105. package/src/lib/components/user-management/user-management-form/user-management-form.component.html +80 -0
  106. package/src/lib/components/user-management/user-management-form/user-management-form.component.spec.ts +23 -0
  107. package/src/lib/components/user-management/user-management.columns.ts +51 -0
  108. package/src/lib/components/user-management/user-management.component.css +31 -0
  109. package/src/lib/components/user-management/user-management.component.html +319 -0
  110. package/src/lib/components/user-management/user-management.component.spec.ts +23 -0
  111. package/src/lib/components/user-management/user-management.component.ts +604 -0
  112. package/src/lib/components/user-management/user-management.module.ts +56 -0
  113. package/src/lib/components/user-management/user-status-badge/user-status-badge.component.css +0 -0
  114. package/src/lib/components/user-management/user-status-badge/user-status-badge.component.html +8 -0
  115. package/src/lib/components/user-management/user-status-badge/user-status-badge.component.spec.ts +22 -0
  116. package/src/lib/components/user-management/user-status-badge/user-status-badge.component.ts +22 -0
  117. package/src/lib/components/user-request/user-request.component.css +91 -0
  118. package/src/lib/components/user-request/user-request.component.html +137 -0
  119. package/src/lib/components/user-request/user-request.component.spec.ts +23 -0
  120. package/src/lib/components/user-request/user-request.component.ts +306 -0
  121. package/src/lib/components/user-request/user-request.module.ts +20 -0
  122. package/src/lib/components/user-request-approval/access-request.columns.ts +31 -0
  123. package/src/lib/components/user-request-approval/base-table-style.ts +52 -0
  124. package/src/lib/components/user-request-approval/facades/user-access-request.facade.ts +324 -0
  125. package/src/lib/components/user-request-approval/helper.ts +61 -0
  126. package/src/lib/components/user-request-approval/services/user-access-request.service.spec.ts +16 -0
  127. package/src/lib/components/user-request-approval/services/user-access-request.service.ts +122 -0
  128. package/src/lib/components/user-request-approval/states/user-access-request.state.ts +109 -0
  129. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.css +0 -0
  130. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.html +8 -0
  131. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.spec.ts +23 -0
  132. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.ts +22 -0
  133. package/src/lib/components/user-request-approval/user-request-approval.component.css +6 -0
  134. package/src/lib/components/user-request-approval/user-request-approval.component.html +269 -0
  135. package/src/lib/components/user-request-approval/user-request-approval.component.spec.ts +23 -0
  136. package/src/lib/components/user-request-approval/user-request-approval.component.ts +326 -0
  137. package/src/lib/components/user-request-approval/user-request-approval.module.ts +54 -0
  138. package/src/lib/components/user-request-approval/user-request-form/use-request-form.component.ts +98 -0
  139. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.css +0 -0
  140. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.html +94 -0
  141. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.spec.ts +23 -0
  142. package/src/lib/components/user-request-process/user-request-process.component.css +0 -0
  143. package/src/lib/components/user-request-process/user-request-process.component.html +1 -0
  144. package/src/lib/components/user-request-process/user-request-process.component.spec.ts +23 -0
  145. package/src/lib/components/user-request-process/user-request-process.component.ts +12 -0
  146. package/src/lib/components/user-request-process/user-request-process.module.ts +12 -0
  147. package/src/lib/models/ApplicationRoleAction.ts +10 -0
  148. package/{lib/models/ApplicationRoleContext.d.ts → src/lib/models/ApplicationRoleContext copy.ts } +6 -5
  149. package/src/lib/models/ApplicationRoleContext.ts +10 -0
  150. package/src/lib/models/ErrorResponse.ts +7 -0
  151. package/src/lib/models/FilterTypes.ts +8 -0
  152. package/src/lib/models/MailConfig.ts +13 -0
  153. package/src/lib/models/MessageConfig.ts +5 -0
  154. package/src/lib/models/MessageMedium.ts +4 -0
  155. package/src/lib/models/OAuthParam.ts +10 -0
  156. package/src/lib/models/OAuthType.ts +7 -0
  157. package/src/lib/models/PagedResult.ts +9 -0
  158. package/src/lib/models/PasswordRequestParam.ts +5 -0
  159. package/src/lib/models/PeriodMode.ts +10 -0
  160. package/{lib/models/PermissionConfig.d.ts → src/lib/models/PermissionConfig.ts} +4 -3
  161. package/src/lib/models/ReportSchedule.ts +23 -0
  162. package/src/lib/models/ReportType.ts +5 -0
  163. package/src/lib/models/ResponseKeyValue.ts +5 -0
  164. package/{lib/models/Role.d.ts → src/lib/models/Role.ts} +6 -5
  165. package/src/lib/models/RoleAction.ts +11 -0
  166. package/src/lib/models/RoleContext.ts +11 -0
  167. package/src/lib/models/SMSConfig.ts +11 -0
  168. package/{lib/models/SearchDynamicWrapper.d.ts → src/lib/models/SearchDynamicWrapper.ts} +3 -2
  169. package/src/lib/models/SearchOperator.ts +4 -0
  170. package/src/lib/models/SearchPropertySign.ts +9 -0
  171. package/{lib/models/SearchPropertyValue.d.ts → src/lib/models/SearchPropertyValue.ts} +7 -6
  172. package/src/lib/models/SearchPropertyValueType.ts +9 -0
  173. package/src/lib/models/SortDirection.ts +5 -0
  174. package/{lib/models/Tag.d.ts → src/lib/models/Tag.ts} +4 -3
  175. package/src/lib/models/TaskNotification.ts +14 -0
  176. package/src/lib/models/TaskNotificationMessageType.ts +4 -0
  177. package/src/lib/models/TaskNotificationType.ts +4 -0
  178. package/src/lib/models/Tenant.ts +22 -0
  179. package/src/lib/models/TenantConfig.ts +19 -0
  180. package/src/lib/models/UserRequest.ts +38 -0
  181. package/src/lib/models/auth-mechanism.ts +15 -0
  182. package/src/lib/models/base.ts +13 -0
  183. package/src/lib/models/conditions.ts +11 -0
  184. package/src/lib/models/log-in.ts +8 -0
  185. package/{lib/models/mainUser.d.ts → src/lib/models/mainUser.ts} +3 -2
  186. package/src/lib/models/oauth-resp.ts +6 -0
  187. package/{lib/models/oauth-response.d.ts → src/lib/models/oauth-response.ts} +1 -1
  188. package/src/lib/models/object-state.ts +6 -0
  189. package/{lib/models/otpValue.d.ts → src/lib/models/otpValue.ts} +4 -2
  190. package/src/lib/models/paged.ts +9 -0
  191. package/src/lib/models/query-params.ts +9 -0
  192. package/src/lib/models/request-status.ts +4 -0
  193. package/src/lib/models/resend-otp-data.ts +8 -0
  194. package/src/lib/models/resource.ts +27 -0
  195. package/src/lib/models/sign-up.ts +11 -0
  196. package/src/lib/models/single-sign-on.ts +9 -0
  197. package/src/lib/models/status.ts +5 -0
  198. package/src/lib/models/user-access-request-status.ts +5 -0
  199. package/{lib/models/user-access-request.d.ts → src/lib/models/user-access-request.ts} +5 -4
  200. package/src/lib/models/user-object-state.ts +6 -0
  201. package/src/lib/models/user.ts +19 -0
  202. package/src/lib/pipes/async-label.pipe.spec.ts +8 -0
  203. package/src/lib/pipes/async-label.pipe.ts +20 -0
  204. package/src/lib/services/authorization.service.spec.ts +16 -0
  205. package/src/lib/services/authorization.service.ts +24 -0
  206. package/src/lib/services/encryption.service.ts +57 -0
  207. package/src/lib/services/environment.service.spec.ts +16 -0
  208. package/src/lib/services/environment.service.ts +30 -0
  209. package/src/lib/services/http-web-request.service.spec.ts +16 -0
  210. package/src/lib/services/http-web-request.service.ts +114 -0
  211. package/src/lib/services/label.service.spec.ts +16 -0
  212. package/src/lib/services/label.service.ts +177 -0
  213. package/src/lib/services/util.service.spec.ts +16 -0
  214. package/src/lib/services/util.service.ts +49 -0
  215. package/src/lib/shared/shared.module.ts +55 -0
  216. package/{public-api.d.ts → src/public-api.ts} +24 -0
  217. package/src/styles.css +96 -0
  218. package/src/theme/tailwind-setup.css +3 -0
  219. package/src/theme/tailwind.css +1030 -0
  220. package/src/utils/components/base-data-view.component.ts +131 -0
  221. package/src/utils/models/DataViewConfig.ts +19 -0
  222. package/tailwind.config.js +20 -0
  223. package/tsconfig.lib.json +15 -0
  224. package/tsconfig.lib.prod.json +11 -0
  225. package/tsconfig.spec.json +15 -0
  226. package/esm2022/lib/components/auth-callback/auth-callback.component.mjs +0 -57
  227. package/esm2022/lib/components/auth-callback/auth-callback.module.mjs +0 -18
  228. package/esm2022/lib/components/button/button.component.mjs +0 -46
  229. package/esm2022/lib/components/button/button.module.mjs +0 -20
  230. package/esm2022/lib/components/forgot-password/ForgotPasswordData.mjs +0 -2
  231. package/esm2022/lib/components/forgot-password/forgot-password.component.mjs +0 -89
  232. package/esm2022/lib/components/forgot-password/forgot-password.module.mjs +0 -34
  233. package/esm2022/lib/components/mail/mail.component.mjs +0 -69
  234. package/esm2022/lib/components/mail/mail.module.mjs +0 -21
  235. package/esm2022/lib/components/mail-validation/mail-validation.component.mjs +0 -108
  236. package/esm2022/lib/components/mail-validation/mail-validation.module.mjs +0 -34
  237. package/esm2022/lib/components/o-auth/o-auth.component.mjs +0 -107
  238. package/esm2022/lib/components/o-auth/o-auth.module.mjs +0 -19
  239. package/esm2022/lib/components/otp-input/otp-input.component.mjs +0 -86
  240. package/esm2022/lib/components/otp-input/otp-input.module.mjs +0 -23
  241. package/esm2022/lib/components/reset-password/ResetPasswordData.mjs +0 -2
  242. package/esm2022/lib/components/reset-password/reset-password.component.mjs +0 -108
  243. package/esm2022/lib/components/reset-password/reset-password.module.mjs +0 -34
  244. package/esm2022/lib/components/role-control/ChildrenType.mjs +0 -6
  245. package/esm2022/lib/components/role-control/MappedRole.mjs +0 -2
  246. package/esm2022/lib/components/role-control/MappedRoleAction.mjs +0 -2
  247. package/esm2022/lib/components/role-control/MappedRoleContext.mjs +0 -2
  248. package/esm2022/lib/components/role-control/UIActions.mjs +0 -7
  249. package/esm2022/lib/components/role-control/UIs.mjs +0 -40
  250. package/esm2022/lib/components/role-control/base-table-style.mjs +0 -53
  251. package/esm2022/lib/components/role-control/role-control.component.mjs +0 -1364
  252. package/esm2022/lib/components/role-control/role-control.module.mjs +0 -18
  253. package/esm2022/lib/components/role-control/role-control.service.mjs +0 -54
  254. package/esm2022/lib/components/sign-in/sign-in.component.mjs +0 -318
  255. package/esm2022/lib/components/sign-in/sign-in.module.mjs +0 -24
  256. package/esm2022/lib/components/sign-up/sign-up.component.mjs +0 -229
  257. package/esm2022/lib/components/sign-up/sign-up.module.mjs +0 -24
  258. package/esm2022/lib/components/sso/base-table-style.mjs +0 -53
  259. package/esm2022/lib/components/sso/helper.mjs +0 -16
  260. package/esm2022/lib/components/sso/sso-form/sso-form.component.mjs +0 -74
  261. package/esm2022/lib/components/sso/sso.columns.mjs +0 -29
  262. package/esm2022/lib/components/sso/sso.component.mjs +0 -236
  263. package/esm2022/lib/components/sso/sso.module.mjs +0 -63
  264. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.mjs +0 -209
  265. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.mjs +0 -22
  266. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.mjs +0 -90
  267. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.mjs +0 -19
  268. package/esm2022/lib/components/user-management/base-table-style.mjs +0 -53
  269. package/esm2022/lib/components/user-management/services/user-management.service.mjs +0 -88
  270. package/esm2022/lib/components/user-management/user-management-form/use-management-form.component.mjs +0 -71
  271. package/esm2022/lib/components/user-management/user-management.columns.mjs +0 -47
  272. package/esm2022/lib/components/user-management/user-management.component.mjs +0 -475
  273. package/esm2022/lib/components/user-management/user-management.module.mjs +0 -79
  274. package/esm2022/lib/components/user-management/user-status-badge/user-status-badge.component.mjs +0 -26
  275. package/esm2022/lib/components/user-request/user-request.component.mjs +0 -320
  276. package/esm2022/lib/components/user-request/user-request.module.mjs +0 -38
  277. package/esm2022/lib/components/user-request-approval/access-request.columns.mjs +0 -29
  278. package/esm2022/lib/components/user-request-approval/base-table-style.mjs +0 -53
  279. package/esm2022/lib/components/user-request-approval/facades/user-access-request.facade.mjs +0 -260
  280. package/esm2022/lib/components/user-request-approval/helper.mjs +0 -56
  281. package/esm2022/lib/components/user-request-approval/services/user-access-request.service.mjs +0 -93
  282. package/esm2022/lib/components/user-request-approval/states/user-access-request.state.mjs +0 -92
  283. package/esm2022/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.mjs +0 -26
  284. package/esm2022/lib/components/user-request-approval/user-request-approval.component.mjs +0 -270
  285. package/esm2022/lib/components/user-request-approval/user-request-approval.module.mjs +0 -80
  286. package/esm2022/lib/components/user-request-approval/user-request-form/use-request-form.component.mjs +0 -86
  287. package/esm2022/lib/models/ApplicationRoleAction.mjs +0 -2
  288. package/esm2022/lib/models/ApplicationRoleContext.mjs +0 -2
  289. package/esm2022/lib/models/ErrorResponse.mjs +0 -11
  290. package/esm2022/lib/models/OAuthParam.mjs +0 -2
  291. package/esm2022/lib/models/OAuthType.mjs +0 -9
  292. package/esm2022/lib/models/PagedResult.mjs +0 -2
  293. package/esm2022/lib/models/PasswordRequestParam.mjs +0 -2
  294. package/esm2022/lib/models/PermissionConfig.mjs +0 -2
  295. package/esm2022/lib/models/ResponseKeyValue.mjs +0 -2
  296. package/esm2022/lib/models/Role.mjs +0 -2
  297. package/esm2022/lib/models/RoleAction.mjs +0 -2
  298. package/esm2022/lib/models/RoleContext.mjs +0 -2
  299. package/esm2022/lib/models/SearchDynamicWrapper.mjs +0 -2
  300. package/esm2022/lib/models/SearchOperator.mjs +0 -6
  301. package/esm2022/lib/models/SearchPropertySign.mjs +0 -11
  302. package/esm2022/lib/models/SearchPropertyValue.mjs +0 -2
  303. package/esm2022/lib/models/SearchPropertyValueType.mjs +0 -11
  304. package/esm2022/lib/models/SortDirection.mjs +0 -7
  305. package/esm2022/lib/models/Tag.mjs +0 -2
  306. package/esm2022/lib/models/TenantConfig.mjs +0 -2
  307. package/esm2022/lib/models/UserRequest.mjs +0 -2
  308. package/esm2022/lib/models/auth-mechanism.mjs +0 -8
  309. package/esm2022/lib/models/base.mjs +0 -2
  310. package/esm2022/lib/models/conditions.mjs +0 -13
  311. package/esm2022/lib/models/log-in.mjs +0 -2
  312. package/esm2022/lib/models/mainUser.mjs +0 -2
  313. package/esm2022/lib/models/oauth-resp.mjs +0 -2
  314. package/esm2022/lib/models/oauth-response.mjs +0 -2
  315. package/esm2022/lib/models/object-state.mjs +0 -8
  316. package/esm2022/lib/models/otpValue.mjs +0 -2
  317. package/esm2022/lib/models/paged.mjs +0 -2
  318. package/esm2022/lib/models/query-params.mjs +0 -2
  319. package/esm2022/lib/models/request-status.mjs +0 -5
  320. package/esm2022/lib/models/resend-otp-data.mjs +0 -2
  321. package/esm2022/lib/models/sign-up.mjs +0 -2
  322. package/esm2022/lib/models/single-sign-on.mjs +0 -2
  323. package/esm2022/lib/models/status.mjs +0 -6
  324. package/esm2022/lib/models/user-access-request-status.mjs +0 -7
  325. package/esm2022/lib/models/user-access-request.mjs +0 -2
  326. package/esm2022/lib/models/user.mjs +0 -2
  327. package/esm2022/lib/pipes/async-label.pipe.mjs +0 -25
  328. package/esm2022/lib/services/authorization.service.mjs +0 -26
  329. package/esm2022/lib/services/encryption.service.mjs +0 -52
  330. package/esm2022/lib/services/environment.service.mjs +0 -26
  331. package/esm2022/lib/services/http-web-request.service.mjs +0 -85
  332. package/esm2022/lib/services/label.service.mjs +0 -134
  333. package/esm2022/lib/services/util.service.mjs +0 -55
  334. package/esm2022/lib/shared/shared.module.mjs +0 -84
  335. package/esm2022/public-api.mjs +0 -48
  336. package/esm2022/verben-authentication-ui.mjs +0 -5
  337. package/fesm2022/verben-authentication-ui.mjs +0 -6299
  338. package/fesm2022/verben-authentication-ui.mjs.map +0 -1
  339. package/index.d.ts +0 -5
  340. package/lib/components/auth-callback/auth-callback.component.d.ts +0 -17
  341. package/lib/components/auth-callback/auth-callback.module.d.ts +0 -8
  342. package/lib/components/button/button.component.d.ts +0 -17
  343. package/lib/components/button/button.module.d.ts +0 -10
  344. package/lib/components/forgot-password/forgot-password.component.d.ts +0 -29
  345. package/lib/components/forgot-password/forgot-password.module.d.ts +0 -10
  346. package/lib/components/mail/mail.component.d.ts +0 -32
  347. package/lib/components/mail/mail.module.d.ts +0 -11
  348. package/lib/components/mail-validation/mail-validation.component.d.ts +0 -42
  349. package/lib/components/mail-validation/mail-validation.module.d.ts +0 -10
  350. package/lib/components/o-auth/o-auth.component.d.ts +0 -30
  351. package/lib/components/o-auth/o-auth.module.d.ts +0 -9
  352. package/lib/components/otp-input/otp-input.component.d.ts +0 -21
  353. package/lib/components/otp-input/otp-input.module.d.ts +0 -13
  354. package/lib/components/reset-password/ResetPasswordData.d.ts +0 -5
  355. package/lib/components/reset-password/reset-password.component.d.ts +0 -30
  356. package/lib/components/reset-password/reset-password.module.d.ts +0 -10
  357. package/lib/components/role-control/ChildrenType.d.ts +0 -4
  358. package/lib/components/role-control/UIActions.d.ts +0 -5
  359. package/lib/components/role-control/UIs.d.ts +0 -38
  360. package/lib/components/role-control/base-table-style.d.ts +0 -1
  361. package/lib/components/role-control/role-control.component.d.ts +0 -121
  362. package/lib/components/role-control/role-control.module.d.ts +0 -8
  363. package/lib/components/role-control/role-control.service.d.ts +0 -9
  364. package/lib/components/sign-in/sign-in.component.d.ts +0 -95
  365. package/lib/components/sign-in/sign-in.module.d.ts +0 -13
  366. package/lib/components/sign-up/sign-up.component.d.ts +0 -68
  367. package/lib/components/sign-up/sign-up.module.d.ts +0 -13
  368. package/lib/components/sso/base-table-style.d.ts +0 -1
  369. package/lib/components/sso/helper.d.ts +0 -2
  370. package/lib/components/sso/sso-form/sso-form.component.d.ts +0 -21
  371. package/lib/components/sso/sso.columns.d.ts +0 -3
  372. package/lib/components/sso/sso.component.d.ts +0 -54
  373. package/lib/components/sso/sso.module.d.ts +0 -11
  374. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.d.ts +0 -67
  375. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.d.ts +0 -12
  376. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.d.ts +0 -39
  377. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.d.ts +0 -9
  378. package/lib/components/user-management/base-table-style.d.ts +0 -1
  379. package/lib/components/user-management/services/user-management.service.d.ts +0 -44
  380. package/lib/components/user-management/user-management-form/use-management-form.component.d.ts +0 -22
  381. package/lib/components/user-management/user-management.columns.d.ts +0 -3
  382. package/lib/components/user-management/user-management.component.d.ts +0 -123
  383. package/lib/components/user-management/user-management.module.d.ts +0 -14
  384. package/lib/components/user-management/user-status-badge/user-status-badge.component.d.ts +0 -12
  385. package/lib/components/user-request/user-request.component.d.ts +0 -80
  386. package/lib/components/user-request/user-request.module.d.ts +0 -11
  387. package/lib/components/user-request-approval/access-request.columns.d.ts +0 -3
  388. package/lib/components/user-request-approval/base-table-style.d.ts +0 -1
  389. package/lib/components/user-request-approval/facades/user-access-request.facade.d.ts +0 -39
  390. package/lib/components/user-request-approval/helper.d.ts +0 -7
  391. package/lib/components/user-request-approval/services/user-access-request.service.d.ts +0 -65
  392. package/lib/components/user-request-approval/states/user-access-request.state.d.ts +0 -35
  393. package/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.d.ts +0 -12
  394. package/lib/components/user-request-approval/user-request-approval.component.d.ts +0 -69
  395. package/lib/components/user-request-approval/user-request-approval.module.d.ts +0 -12
  396. package/lib/components/user-request-approval/user-request-form/use-request-form.component.d.ts +0 -25
  397. package/lib/models/ApplicationRoleAction.d.ts +0 -9
  398. package/lib/models/ErrorResponse.d.ts +0 -6
  399. package/lib/models/OAuthParam.d.ts +0 -9
  400. package/lib/models/OAuthType.d.ts +0 -7
  401. package/lib/models/PagedResult.d.ts +0 -9
  402. package/lib/models/PasswordRequestParam.d.ts +0 -5
  403. package/lib/models/ResponseKeyValue.d.ts +0 -5
  404. package/lib/models/RoleAction.d.ts +0 -10
  405. package/lib/models/RoleContext.d.ts +0 -10
  406. package/lib/models/SearchOperator.d.ts +0 -4
  407. package/lib/models/SearchPropertySign.d.ts +0 -9
  408. package/lib/models/SearchPropertyValueType.d.ts +0 -9
  409. package/lib/models/SortDirection.d.ts +0 -5
  410. package/lib/models/TenantConfig.d.ts +0 -18
  411. package/lib/models/UserRequest.d.ts +0 -32
  412. package/lib/models/auth-mechanism.d.ts +0 -14
  413. package/lib/models/base.d.ts +0 -12
  414. package/lib/models/conditions.d.ts +0 -11
  415. package/lib/models/log-in.d.ts +0 -8
  416. package/lib/models/oauth-resp.d.ts +0 -6
  417. package/lib/models/object-state.d.ts +0 -6
  418. package/lib/models/paged.d.ts +0 -9
  419. package/lib/models/query-params.d.ts +0 -8
  420. package/lib/models/request-status.d.ts +0 -3
  421. package/lib/models/resend-otp-data.d.ts +0 -8
  422. package/lib/models/sign-up.d.ts +0 -9
  423. package/lib/models/single-sign-on.d.ts +0 -7
  424. package/lib/models/status.d.ts +0 -4
  425. package/lib/models/user-access-request-status.d.ts +0 -5
  426. package/lib/models/user.d.ts +0 -18
  427. package/lib/pipes/async-label.pipe.d.ts +0 -11
  428. package/lib/services/authorization.service.d.ts +0 -14
  429. package/lib/services/encryption.service.d.ts +0 -13
  430. package/lib/services/environment.service.d.ts +0 -22
  431. package/lib/services/http-web-request.service.d.ts +0 -23
  432. package/lib/services/label.service.d.ts +0 -15
  433. package/lib/services/util.service.d.ts +0 -11
  434. package/lib/shared/shared.module.d.ts +0 -10
@@ -0,0 +1,115 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { AuthMechanism, MechanismType } from '../../models/auth-mechanism';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
+ import { HttpWebRequestService } from '../../services/http-web-request.service';
5
+ import { UtilService } from '../../services/util.service';
6
+
7
+ declare global {
8
+ interface Window {
9
+ google: any;
10
+ }
11
+ }
12
+
13
+ @Component({
14
+ selector: 'verben-o-auth',
15
+ templateUrl: './o-auth.component.html',
16
+ styleUrl: './o-auth.component.css',
17
+ })
18
+ export class OAuthComponent implements OnInit {
19
+ showGoogle: boolean = false;
20
+ showMicrosoft: boolean = false;
21
+ showApple: boolean = false;
22
+ @Input() authMechanisms: AuthMechanism[] | null = null;
23
+ @Output() emitMechanismFn = new EventEmitter<string>();
24
+ page: string = '';
25
+ type: string = '';
26
+
27
+ constructor(private router: Router) {}
28
+
29
+ ngOnInit(): void {
30
+ this.loadPage();
31
+ this.loadGoogleScript();
32
+ if (this.authMechanisms !== null) {
33
+ this.authMechanisms = this.authMechanisms.filter(
34
+ (item) => item.AuthMechanism !== MechanismType.InApp
35
+ );
36
+ }
37
+ }
38
+
39
+ loadPage() {
40
+ this.page = this.router.url;
41
+ }
42
+
43
+ loadGoogleScript(): void {
44
+ if (!document.getElementById('google-jssdk')) {
45
+ const script = document.createElement('script');
46
+ script.src = 'https://accounts.google.com/gsi/client';
47
+ script.id = 'google-jssdk';
48
+ script.async = true;
49
+ script.defer = true;
50
+ script.onload = () => console.log('Google SDK loaded');
51
+ script.onerror = () => console.log('Error loading Google SDK');
52
+ document.head.appendChild(script);
53
+ }
54
+ }
55
+
56
+ oAuthWithGoogle(data: AuthMechanism) {
57
+ this.type = data.AuthMechanism;
58
+ localStorage.setItem('type', JSON.stringify(this.type));
59
+ const redirectUri = encodeURIComponent(data.RedirectUri);
60
+ const scope = encodeURIComponent('openid email profile');
61
+ const responseType = 'code';
62
+ const state = encodeURIComponent(JSON.stringify({ returnTo: this.page }));
63
+ const authUrl = `https://accounts.google.com/o/oauth2/v2/auth?client_id=${data.ClientId}&redirect_uri=${redirectUri}&response_type=${responseType}&scope=${scope}&state=${state}`;
64
+ window.location.href = authUrl;
65
+ }
66
+
67
+ oAuthWithApple() {}
68
+
69
+ oAuthWithMicrosoft(data: AuthMechanism) {
70
+ this.type = data.AuthMechanism;
71
+ const cleanUrl = window.location.href.split('?')[0];
72
+ window.history.replaceState({}, document.title, cleanUrl); // Update the URL without reloading
73
+ localStorage.setItem('type', JSON.stringify(this.type));
74
+ const redirectUri = encodeURIComponent(data.RedirectUri);
75
+ const scope = encodeURIComponent('openid email profile');
76
+ const responseType = 'code';
77
+ const state = encodeURIComponent(JSON.stringify({ returnTo: this.page }));
78
+ // const authUrl = `https://login.microsoftonline.com/${data.TenantId}/oauth2/v2.0/authorize?client_id=${data.ClientId}&response_type=${responseType}&redirect_uri=${redirectUri}&response_mode=query&state=${state}`;
79
+ const authUrl = `https://login.microsoftonline.com/common/oauth2/v2.0/authorize
80
+ ?client_id=${data.ClientId}
81
+ &response_type=${responseType}
82
+ &redirect_uri=${redirectUri}&scope=${scope}
83
+ &response_mode=query&state=${state}`;
84
+ window.location.href = authUrl;
85
+ }
86
+
87
+ checkForValue(value: string) {
88
+ switch (value) {
89
+ case MechanismType.Google:
90
+ return 'google-logo';
91
+ case MechanismType.Apple:
92
+ return 'apple-logo';
93
+ case MechanismType.MicrosoftAD:
94
+ return 'microsoft-logo';
95
+ default:
96
+ return '';
97
+ }
98
+ }
99
+
100
+ handleOauthClick(value: AuthMechanism) {
101
+ switch (value.AuthMechanism) {
102
+ case MechanismType.Google:
103
+ return this.oAuthWithGoogle(value);
104
+ break;
105
+ case MechanismType.Apple:
106
+ return this.oAuthWithApple();
107
+ break;
108
+ case MechanismType.MicrosoftAD:
109
+ return this.oAuthWithMicrosoft(value);
110
+ break;
111
+ default:
112
+ return '';
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,11 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { VerbenaButtonModule, VerbenaInputModule } from 'verben-ng-ui';
4
+ import { OAuthComponent } from './o-auth.component';
5
+
6
+ @NgModule({
7
+ declarations: [OAuthComponent],
8
+ imports: [CommonModule,VerbenaInputModule,VerbenaButtonModule],
9
+ exports: [OAuthComponent]
10
+ })
11
+ export class OAuthModule {}
@@ -0,0 +1,19 @@
1
+ .otp-container {
2
+ display: flex;
3
+ gap: 15px;
4
+ }
5
+
6
+ .otp-input {
7
+ width: 50px;
8
+ height: 46px;
9
+ text-align: center;
10
+ font-size: 1.5rem;
11
+ border: 1px solid #66666658;
12
+ border-radius: 12px;
13
+ }
14
+
15
+
16
+ .otp-input:focus {
17
+ border-color: #FFE681;
18
+ outline: none;
19
+ }
@@ -0,0 +1,15 @@
1
+ <form [formGroup]="otpForm" >
2
+ <div formArrayName="otpArray" class="otp-container">
3
+ <input
4
+ *ngFor="let control of otpArray.controls; let i = index"
5
+ [id]="'otp-input-' + i"
6
+ class="otp-input {{otpClass}}"
7
+ maxlength="1"
8
+ (input)="handleInput($event, i)"
9
+ (keydown)="handleKeydown($event, i)"
10
+ (paste)="handlePaste($event)"
11
+ [formControlName]="i"
12
+ type="text"
13
+ />
14
+ </div>
15
+ </form>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { OtpInputComponent } from './otp-input.component';
4
+
5
+ describe('OtpInputComponent', () => {
6
+ let component: OtpInputComponent;
7
+ let fixture: ComponentFixture<OtpInputComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [OtpInputComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(OtpInputComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,88 @@
1
+ import { Component, EventEmitter, Input, Output, OnInit } from '@angular/core';
2
+ import { FormBuilder, FormArray, FormControl, FormGroup } from '@angular/forms';
3
+
4
+ @Component({
5
+ selector: 'verben-otp-input',
6
+ templateUrl: './otp-input.component.html',
7
+ styleUrl: './otp-input.component.css'
8
+ })
9
+ export class OtpInputComponent implements OnInit {
10
+ @Input() length: number = 6;
11
+ @Input() otpClass: string = '';
12
+ @Output() otpChange = new EventEmitter<string>();
13
+
14
+ otpForm!: FormGroup;
15
+
16
+ constructor(private fb: FormBuilder) {}
17
+
18
+ ngOnInit() {
19
+ this.otpForm = this.fb.group({
20
+ otpArray: this.fb.array(Array(this.length).fill('').map(() => new FormControl('')))
21
+ });
22
+
23
+ this.otpArray.valueChanges.subscribe(() => {
24
+ this.emitOtp();
25
+ });
26
+ }
27
+
28
+ get otpArray(): FormArray {
29
+ return this.otpForm.get('otpArray') as FormArray;
30
+ }
31
+
32
+ handleInput(event: any, index: number) {
33
+ let value = event.target.value;
34
+
35
+ // /\d/.test(value)
36
+ if (value.length > 0) {
37
+ value = value.toUpperCase();
38
+ this.otpArray.at(index).setValue(value);
39
+
40
+ if (index < this.length - 1) {
41
+ this.focusNextInput(index);
42
+ }
43
+ } else {
44
+ this.otpArray.at(index).setValue('');
45
+ }
46
+ }
47
+
48
+ handleKeydown(event: KeyboardEvent, index: number) {
49
+ if (event.key === 'Backspace') {
50
+ const currentValue = this.otpArray.at(index).value;
51
+
52
+ if (currentValue) {
53
+ this.otpArray.at(index).setValue('');
54
+ } else if (index > 0) {
55
+ this.focusPreviousInput(index);
56
+ }
57
+ }
58
+ }
59
+
60
+ handlePaste(event: ClipboardEvent) {
61
+ event.preventDefault();
62
+ const pastedData = (event.clipboardData?.getData('text') || '').toUpperCase();
63
+ const validData = pastedData.slice(0, this.length);
64
+
65
+ validData.split('').forEach((char, index) => {
66
+ this.otpArray.at(index).setValue(char);
67
+ });
68
+
69
+ const nextIndex = validData.length < this.length ? validData.length : this.length - 1;
70
+ this.focusNextInput(nextIndex - 1);
71
+ }
72
+
73
+
74
+ private focusNextInput(index: number) {
75
+ const nextInput = document.getElementById(`otp-input-${index + 1}`);
76
+ nextInput?.focus();
77
+ }
78
+
79
+ private focusPreviousInput(index: number) {
80
+ const prevInput = document.getElementById(`otp-input-${index - 1}`);
81
+ prevInput?.focus();
82
+ }
83
+
84
+ private emitOtp() {
85
+ const otp = this.otpArray.value.join('');
86
+ this.otpChange.emit(otp);
87
+ }
88
+ }
@@ -0,0 +1,15 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+ import { RouterLink } from '@angular/router';
5
+ import { VerbenaInputModule } from 'verben-ng-ui';
6
+ import { OAuthModule } from '../o-auth/o-auth.module';
7
+ import { ButtonModule } from '../button/button.module';
8
+ import { OtpInputComponent } from './otp-input.component';
9
+
10
+ @NgModule({
11
+ declarations: [OtpInputComponent],
12
+ imports: [CommonModule, FormsModule,VerbenaInputModule, RouterLink,ButtonModule,OAuthModule,ReactiveFormsModule],
13
+ exports: [OtpInputComponent]
14
+ })
15
+ export class OtpInputModule {}
@@ -0,0 +1,5 @@
1
+ export interface ResetPasswordData {
2
+ OldPassword?: string;
3
+ Password: string;
4
+ ConfirmPassword: string;
5
+ }
@@ -0,0 +1,29 @@
1
+ @import '../../../styles.css';
2
+
3
+ .reset-password-container {
4
+ gap: 25px;
5
+ padding: 50px;
6
+ border: 1px solid rgba(102, 102, 102, 0.5);
7
+ box-shadow: 4px 4px 4px 0px rgba(0, 0, 0, 0.25);
8
+ border-radius: 24px;
9
+ }
10
+
11
+ .reset-password-title {
12
+ font-size: 30px;
13
+ font-weight: bold;
14
+ }
15
+
16
+ .reset-password-subtitle {
17
+ font-size: 14px;
18
+ font-weight: 500;
19
+ color: rgba(102, 102, 102, 1);
20
+ }
21
+
22
+ .form-field {
23
+ gap: 5px;
24
+ }
25
+
26
+ .form-field-caption {
27
+ color: rgba(102, 102, 102, 1);
28
+ /* font-weight: 600; */
29
+ }
@@ -0,0 +1,24 @@
1
+ <div [formGroup]="this.resetPasswordForm" class="reset-password-container flex flex-col">
2
+ <div class="reset-password-header flex flex-col">
3
+ <div class="reset-password-title">{{title}}</div>
4
+ <div class="reset-password-subtitle">{{subTitle}}</div>
5
+ </div>
6
+ <div *ngIf="showOldPassword" class="form-field flex flex-col">
7
+ <div class="form-field-caption">Old Password</div>
8
+ <verbena-input bgColor="white" borderRadius="12px" formControlName="OldPassword" [passwordToggle]="true"
9
+ type="password"></verbena-input>
10
+ </div>
11
+ <div class="form-field flex flex-col">
12
+ <div class="form-field-caption">New Password</div>
13
+ <verbena-input bgColor="white" borderRadius="12px" formControlName="Password" [passwordToggle]="true"
14
+ type="password"></verbena-input>
15
+ </div>
16
+ <div class="form-field flex flex-col">
17
+ <div class="form-field-caption">Confirm Password</div>
18
+ <verbena-input bgColor="white" borderRadius="12px" formControlName="ConfirmPassword" [passwordToggle]="true"
19
+ type="password"></verbena-input>
20
+ </div>
21
+ <verbena-button fontWeight="700" (click)="submit()" [text]="buttonCaption" width="100%" [textColor]="buttonTextColor"
22
+ [bgColor]="buttonBackgroundColor" borderRadius="25px" [disable]="!this.checkForm()"></verbena-button>
23
+
24
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ResetPasswordComponent } from './reset-password.component';
4
+
5
+ describe('ResetPasswordComponent', () => {
6
+ let component: ResetPasswordComponent;
7
+ let fixture: ComponentFixture<ResetPasswordComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [ResetPasswordComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ResetPasswordComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,108 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import {
3
+ AbstractControl,
4
+ FormBuilder,
5
+ FormControl,
6
+ FormGroup,
7
+ ValidationErrors,
8
+ Validators,
9
+ } from '@angular/forms';
10
+ import { ResetPasswordData } from './ResetPasswordData';
11
+ import { HttpWebRequestService } from '../../services/http-web-request.service';
12
+ import { ErrorResponse } from '../../models/ErrorResponse';
13
+ import { ResponseKeyValue } from '../../models/ResponseKeyValue';
14
+ import { PasswordRequestParam } from '../../models/PasswordRequestParam';
15
+ import { UtilService } from '../../services/util.service';
16
+ import CryptoJS from 'crypto-js';
17
+ @Component({
18
+ selector: 'verben-reset-password',
19
+ templateUrl: './reset-password.component.html',
20
+ styleUrl: './reset-password.component.css',
21
+ })
22
+
23
+ export class ResetPasswordComponent {
24
+ @Input() title: string = 'Reset Password';
25
+ @Input() subTitle: string = 'Create a New Password';
26
+ @Input() buttonCaption: string = 'Submit';
27
+ @Input() buttonTextColor?: string;
28
+ @Input() buttonBackgroundColor?: string;
29
+ @Input() showOldPassword: boolean = false;
30
+ @Input() token?: string;
31
+
32
+ @Output() onSubmit: EventEmitter<ResetPasswordData> = new EventEmitter();
33
+ @Output() onSubmitEnd: EventEmitter<ResponseKeyValue | ErrorResponse> =
34
+ new EventEmitter();
35
+
36
+ resetPasswordForm: FormGroup;
37
+
38
+ constructor(
39
+ private fb: FormBuilder,
40
+ private server: HttpWebRequestService,
41
+ private utilService: UtilService
42
+ ) {
43
+ this.resetPasswordForm = this.fb.group({
44
+ OldPassword: new FormControl<string | null>(
45
+ null,
46
+ this.oldPasswordValidator.bind(this)
47
+ ),
48
+ Password: new FormControl<string | null>(null, Validators.required),
49
+ ConfirmPassword: new FormControl<string | null>(null, [
50
+ Validators.required,
51
+ this.confirmPasswordValidator.bind(this),
52
+ ]),
53
+ });
54
+ }
55
+
56
+ checkForm(): boolean {
57
+ return this.resetPasswordForm.valid;
58
+ }
59
+
60
+ oldPasswordValidator(control: AbstractControl): ValidationErrors | null {
61
+ if (this.showOldPassword && control.value == null) {
62
+ return { customValidation: true };
63
+ }
64
+ return null;
65
+ }
66
+ confirmPasswordValidator(control: AbstractControl): ValidationErrors | null {
67
+ if (
68
+ this.resetPasswordForm &&
69
+ this.resetPasswordForm.controls['Password'] &&
70
+ this.resetPasswordForm.controls['Password'].value !== control.value
71
+ ) {
72
+ return { customValidation: true };
73
+ }
74
+ return null;
75
+ }
76
+
77
+ async submit() {
78
+ if (!this.checkForm()) {
79
+ return;
80
+ }
81
+ var data: ResetPasswordData = {
82
+ OldPassword: this.showOldPassword
83
+ ? String(CryptoJS.MD5(this.resetPasswordForm.controls['OldPassword'].value))
84
+ : undefined,
85
+ Password: String(CryptoJS.MD5(this.resetPasswordForm.controls['Password'].value)),
86
+ ConfirmPassword: String(CryptoJS.MD5(this.resetPasswordForm.controls['ConfirmPassword'].value)),
87
+ };
88
+ this.onSubmit.emit(data);
89
+ var passwordRequest: PasswordRequestParam = {
90
+ NewPassword: data.Password,
91
+ OldPassword: data.OldPassword,
92
+ Token: this.token,
93
+ };
94
+ this.utilService.sendBI(true);
95
+ const res = await this.server.post(
96
+ `User/CompleteChangePasswordRequest`,
97
+ passwordRequest
98
+ );
99
+ this.utilService.sendBI(false);
100
+ if (res instanceof ErrorResponse) {
101
+ this.onSubmitEnd.emit(res);
102
+ } else {
103
+ var result = res as ResponseKeyValue;
104
+ this.onSubmitEnd.emit(result);
105
+ }
106
+ }
107
+ }
108
+
@@ -0,0 +1,18 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { ResetPasswordComponent } from './reset-password.component';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+ import { VerbenaButtonModule, VerbenaInputModule } from 'verben-ng-ui';
5
+ import { CommonModule } from '@angular/common';
6
+
7
+ @NgModule({
8
+ declarations: [ResetPasswordComponent],
9
+ imports: [
10
+ FormsModule,
11
+ ReactiveFormsModule,
12
+ VerbenaInputModule,
13
+ VerbenaButtonModule,
14
+ CommonModule,
15
+ ],
16
+ exports: [ResetPasswordComponent],
17
+ })
18
+ export class ResetPasswordModule {}
@@ -0,0 +1,4 @@
1
+ export enum ChildrenType {
2
+ Permission = 'Permission',
3
+ Action = 'Action',
4
+ }
@@ -1,7 +1,8 @@
1
1
  import { Role } from '../../models/Role';
2
2
  import { MappedRoleContext } from './MappedRoleContext';
3
3
  import { ChildrenType } from './ChildrenType';
4
+
4
5
  export interface MappedRole extends Role {
5
- RoleContexts: MappedRoleContext[];
6
- ChildrenType: ChildrenType;
6
+ RoleContexts: MappedRoleContext[];
7
+ ChildrenType: ChildrenType;
7
8
  }
@@ -1,4 +1,5 @@
1
1
  import { RoleAction } from '../../models/RoleAction';
2
+
2
3
  export interface MappedRoleAction extends RoleAction {
3
- Selected: boolean;
4
+ Selected: boolean;
4
5
  }
@@ -1,8 +1,9 @@
1
1
  import { RoleContext } from '../../models/RoleContext';
2
2
  import { ChildrenType } from './ChildrenType';
3
3
  import { MappedRoleAction } from './MappedRoleAction';
4
+
4
5
  export interface MappedRoleContext extends RoleContext {
5
- Selected: boolean;
6
- RoleActions: MappedRoleAction[];
7
- ChildrenType: ChildrenType;
6
+ Selected: boolean;
7
+ RoleActions: MappedRoleAction[];
8
+ ChildrenType: ChildrenType;
8
9
  }
@@ -0,0 +1,5 @@
1
+ export enum UIActions {
2
+ Save = 'Save',
3
+ Edit = 'Edit',
4
+ Delete = 'Delete',
5
+ }
@@ -0,0 +1,38 @@
1
+ export enum UIs {
2
+ ProductDistribution = 'ProductDistribution',
3
+ Terminals = 'Terminals',
4
+ Meters = 'Meters',
5
+ ProductInbound = 'ProductInbound',
6
+ TerminalDocumentation = 'TerminalDocumentation',
7
+ Laboratories = 'Laboratories',
8
+ Surveyors = 'Surveyors',
9
+ Products = 'Products',
10
+ Stocks = 'Stocks',
11
+ Tanks = 'Tanks',
12
+ Customers = 'Customers',
13
+ ProductAllocation = 'ProductAllocation',
14
+ ReleaseManagement = 'ReleaseManagement',
15
+ ProductPricing = 'ProductPricing',
16
+ Purchases = 'Purchases',
17
+ Agents = 'Agents',
18
+ Banks = 'Banks',
19
+ Vendors = 'Vendors',
20
+ Vessels = 'Vessels',
21
+ ExpenseList = 'ExpenseList',
22
+ ProcurementDocumentation = 'ProcurementDocumentation',
23
+ Journal = 'Journal',
24
+ JournalTemplate = 'JournalTemplate',
25
+ RecurringJournal = 'RecurringJournal',
26
+ InterCompanyJournal = 'InterCompanyJournal',
27
+ InterCompanyJournalTemplate = 'InterCompanyJournalTemplate',
28
+ UserManagement = 'UserManagement',
29
+ AccessRequest = 'AccessRequest',
30
+ RolesAndPermissions = 'RolesAndPermissions',
31
+ AuditTrail = 'AuditTrail',
32
+ LogViewer = 'LogViewer',
33
+ MessageHistory = 'MessageHistory',
34
+ MessageConfig = 'MessageConfig',
35
+ MessageList = 'MessageList',
36
+ Config = 'Config',
37
+ Reports = 'Reports',
38
+ }
@@ -0,0 +1,52 @@
1
+ export const baseStyle: any = {
2
+ width: '100%',
3
+ fontFamily: '"Fraunces", serif',
4
+ fontSize: '125%',
5
+ whiteSpace: 'nowrap',
6
+ margin: '0',
7
+ border: '1px solid #D4A007',
8
+ borderRadius: '16px',
9
+ borderCollapse: 'separate',
10
+ borderSpacing: '0',
11
+ // tableLayout: 'fixed',
12
+ overflow: 'hidden',
13
+ rows: {
14
+ even: {
15
+ backgroundColor: '#FDFDFD',
16
+ },
17
+ odd: {
18
+ backgroundColor: '#F1F4FB',
19
+ },
20
+ height: '68px',
21
+ },
22
+ cells: {
23
+ padding: '0.5rem 1rem',
24
+ },
25
+ header: {
26
+ // stickyTop: true,
27
+ // zIndex: 2,
28
+ backgroundColor: '#EFF2FB',
29
+ fontWeight: 'bold',
30
+ textAlign: 'left',
31
+ padding: '12px 16px',
32
+ height: '30px',
33
+ },
34
+ footer: {
35
+ // stickyBottom: true,
36
+ // zIndex: 2,
37
+ padding: '3px',
38
+ },
39
+ // body: {
40
+ // background: '#fff',
41
+ // padding: '4px 5px',
42
+ // textAlign: 'center',
43
+ // },
44
+ // firstColumn: {
45
+ // stickyLeft: true,
46
+ // zIndex: 1,
47
+ // },
48
+ lastColumn: {
49
+ // stickyRight: true,
50
+ // zIndex: 1,
51
+ },
52
+ };